git: d3be3768facd - main - security/pks: the port had been further improved (+)

From: Alexey Dokuchaev <danfe_at_FreeBSD.org>
Date: Fri, 10 Mar 2023 04:02:42 UTC
The branch main has been updated by danfe:

URL: https://cgit.FreeBSD.org/ports/commit/?id=d3be3768facd06bcf8af3d9d8d8caf741942fae7

commit d3be3768facd06bcf8af3d9d8d8caf741942fae7
Author:     Alexey Dokuchaev <danfe@FreeBSD.org>
AuthorDate: 2023-03-10 04:01:40 +0000
Commit:     Alexey Dokuchaev <danfe@FreeBSD.org>
CommitDate: 2023-03-10 04:01:40 +0000

    security/pks: the port had been further improved (+)
    
    - Simplify Berkeley DB detection (rather than completely deleting
      the corresponding configure script section, assume that if user
      passes DBHDR she knows what she's doing and trust that value)
    - Fix a harmless typo RSA_get0_p() -> DSA_get0_p() in the previous
      commit 6074b736dee1
    - GC some more needless variables (MAKE_ENV, LDFLAGS) and enable
      IPv6 while I'm here
---
 security/pks/Makefile              |   4 +-
 security/pks/files/patch-configure | 156 ++++---------------------------------
 security/pks/files/patch-pgputil.c |   2 +-
 3 files changed, 19 insertions(+), 143 deletions(-)

diff --git a/security/pks/Makefile b/security/pks/Makefile
index 90a249c889e2..6ecedd1cfd41 100644
--- a/security/pks/Makefile
+++ b/security/pks/Makefile
@@ -20,10 +20,8 @@ WRKSRC=		${WRKDIR}/${PORTNAME}
 GNU_CONFIGURE=	yes
 CONFIGURE_ARGS=	--datadir=${DATADIR} \
 		--localstatedir=/var/pks \
-		--with-libwrap \
+		--with-db --with-ipv6 --with-libwrap \
 		--with-openssl=${OPENSSLBASE}
-MAKE_ENV+=	SUBDIRS=
-LDFLAGS+=	-L${LOCALBASE}/lib
 CONFIGURE_ENV=	DBLIB="-L${BDB_LIB_DIR} -l${BDB_LIB_NAME}" \
 		DBINC=-I${BDB_INCLUDE_DIR} DBHDR=db.h
 
diff --git a/security/pks/files/patch-configure b/security/pks/files/patch-configure
index ea4c6d634acb..75600a00290d 100644
--- a/security/pks/files/patch-configure
+++ b/security/pks/files/patch-configure
@@ -1,144 +1,22 @@
 --- configure.orig	2004-01-17 23:19:56 UTC
 +++ configure
-@@ -2530,141 +2530,6 @@ echo "${ECHO_T}Compiler Optimizations Enabled" >&6
- fi;
- 
- # Checks for libraries.
--echo "$as_me:$LINENO: checking for Berkeley DB" >&5
--echo $ECHO_N "checking for Berkeley DB... $ECHO_C" >&6
--
--# Check whether --with-db or --without-db was given.
--if test "${with_db+set}" = set; then
--  withval="$with_db"
+@@ -2536,15 +2536,16 @@ echo $ECHO_N "checking for Berkeley DB... $ECHO_C" >&6
+ # Check whether --with-db or --without-db was given.
+ if test "${with_db+set}" = set; then
+   withval="$with_db"
 -  DBINC=NO
 -  DBLIB=NO
 -  DBHDR=NO
--  S=1
--  case "$withval" in
--  yes|no)
--      { { echo "$as_me:$LINENO: error: Berkeley DB was not found. Please check your installation or use --with-db=PATH" >&5
--echo "$as_me: error: Berkeley DB was not found. Please check your installation or use --with-db=PATH" >&2;}
--   { (exit 1); exit 1; }; }
--     ;;
--  *)
--  echo "$as_me:$LINENO: result: $withval" >&5
--echo "${ECHO_T}$withval" >&6
--  if test x${withval} = x ; then
--          withval=/tmp
--  fi
--  if test $S -a -r ${withval}/build_unix/db4.h -a \
--          -r "`ls ${withval}/build_unix/.libs/libdb-4.*.a 2>/dev/null | tail -1`"; then
--          DBINC=-I`echo ${withval}/build_unix/`
--          DBLIB=`ls ${withval}/build_unix/.libs/libdb-4.*.a 2>/dev/null | tail -1`
--          DBHDR="db4.h"
--          grep 'DB_VERSION_MAJOR	4$' ${withval}/build_unix/db4.h >/dev/null 2>&1
--          S=$?
--  fi
--  if test $S -a -r ${withval}/build_unix/db.h -a \
--          -r "`ls ${withval}/build_unix/.libs/libdb-4.*.a 2>/dev/null | tail -1`"; then
--          DBINC=-I`echo ${withval}/build_unix`
--          DBLIB=`ls ${withval}/build_unix/.libs/libdb-4.*.a 2>/dev/null | tail -1`
--          DBHDR="db.h"
--          grep 'DB_VERSION_MAJOR	4$' ${withval}/build_unix/db.h >/dev/null 2>&1
--          S=$?
--  fi
--  if test $S -a -r ${withval}/include/db4/db.h -a \
--          -r ${withval}/lib/db4/libdb.a ; then
--          DBINC="-I${withval}/include/db4"
--          DBLIB="-L${withval}/lib/db4 -ldb"
--          DBHDR="db.h"
--          grep 'DB_VERSION_MAJOR	4$' ${withval}/include/db4/db.h >/dev/null 2>&1
--          S=$?
--  fi
--  if test $S -a -r ${withval}/include/db4.h -a \
--          -r ${withval}/lib/libdb.a ; then
--          DBINC="-I${withval}/include"
--          DBLIB="-L${withval}/lib -ldb"
--          DBHDR="db4.h"
--          grep 'DB_VERSION_MAJOR	4$' ${withval}/include/db4.h >/dev/null 2>&1
--          S=$?
--  fi
--  if test $S -a -r ${withval}/include/db.h -a \
--          -r ${withval}/lib/libdb.a ; then
--          DBINC="-I${withval}/include"
--          DBLIB="-L${withval}/lib -ldb"
--          DBHDR="db.h"
--          grep 'DB_VERSION_MAJOR	4$' ${withval}/include/db.h >/dev/null 2>&1
--          S=$?
--  fi
--  if test $S -eq 1 ; then
--      { { echo "$as_me:$LINENO: error: Berkeley DB was not found. Please check your installation or use --with-db=DIR" >&5
--echo "$as_me: error: Berkeley DB was not found. Please check your installation or use --with-db=DIR" >&2;}
--   { (exit 1); exit 1; }; }
--  fi
--  echo "$as_me:$LINENO: result: yes" >&5
--echo "${ECHO_T}yes" >&6
--  esac
--else
--  DBINC=NO
--  DBLIB=NO
--  DBHDR=NO
--  S=1
--
--  if test $S -a -r /usr/local/include/db4.h -a \
--          -r /usr/local/lib/libdb.a ; then
--          DBINC="-I/usr/local/include"
--          DBLIB="-L/usr/local/lib -ldb"
--          DBHDR="db4.h"
--          grep 'DB_VERSION_MAJOR	4$' /usr/local/include/db4.h >/dev/null 2>&1
--          S=$?
--  fi
--  if test $S -a -r /usr/local/include/db.h -a \
--          -r /usr/local/lib/libdb.a ; then
--          DBINC="-I/usr/local/include"
--          DBLIB="-L/usr/local/lib -ldb"
--          DBHDR="db.h"
--          grep 'DB_VERSION_MAJOR	4$' /usr/local/include/db.h >/dev/null 2>&1
--          S=$?
--  fi
--  if test $S -a -r /usr/include/db4.h -a \
--          -r /usr/lib/libdb.a ; then
--          DBINC=""
--          DBLIB="-L/usr/lib -ldb"
--          DBHDR="db4.h"
--          grep 'DB_VERSION_MAJOR	4$' /usr/include/db4.h >/dev/null 2>&1
--          S=$?
--  fi
--  if test $S -a -r /usr/include/db.h -a \
--          -r /usr/lib/libdb.a ; then
--          DBINC=""
--          DBLIB="-L/usr/lib -ldb"
--          DBHDR="db.h"
--          grep 'DB_VERSION_MAJOR	4$' /usr/include/db.h >/dev/null 2>&1
--          S=$?
--  fi
--  DIR=`ls -d ../db-4.*/. 2>/dev/null | tail -1`
--  if test $S -a -r ${DIR}/build_unix/db4.h -a \
--          -r "`ls ${DIR}/build_unix/.libs/libdb-4.*.a 2>/dev/null | tail -1`"; then
--          DBINC=-I`echo ${DIR}/build_unix/`
--          DBLIB=`ls ${DIR}/build_unix/.libs/libdb-4.*.a 2>/dev/null | tail -1`
--          DBHDR="db4.h"
--          grep 'DB_VERSION_MAJOR	4$' ${DIR}/build_unix/db4.h >/dev/null 2>&1
--          S=$?
--  fi
--  if test $S -a -r ${DIR}/build_unix/db.h -a \
--          -r "`ls ${DIR}/build_unix/.libs/libdb-4.*.a 2>/dev/null | tail -1`"; then
--          DBINC=-I`echo ${DIR}/build_unix`
--          DBLIB=`ls ${DIR}/build_unix/.libs/libdb-4.*.a 2>/dev/null | tail -1`
--          DBHDR="db.h"
--          grep 'DB_VERSION_MAJOR	4$' ${DIR}/build_unix/db.h >/dev/null 2>&1
--          S=$?
--  fi
--
--  if test $S -eq 1 ; then
--      { { echo "$as_me:$LINENO: error: Berkeley DB was not found. Please check your installation or use --with-db=DIR" >&5
--echo "$as_me: error: Berkeley DB was not found. Please check your installation or use --with-db=DIR" >&2;}
--   { (exit 1); exit 1; }; }
--  fi
--  echo "$as_me:$LINENO: result: yes" >&5
--echo "${ECHO_T}yes" >&6
--
--fi;
- 
- 
- 
+   S=1
+   case "$withval" in
+   yes|no)
++     if test -z "$DBHDR" ; then
+       { { echo "$as_me:$LINENO: error: Berkeley DB was not found. Please check your installation or use --with-db=PATH" >&5
+ echo "$as_me: error: Berkeley DB was not found. Please check your installation or use --with-db=PATH" >&2;}
+    { (exit 1); exit 1; }; }
++     fi
++     echo "$as_me:$LINENO: result: $DBHDR (${DBINC:-default location})" >&5
++     echo "${ECHO_T}$DBHDR (${DBINC:-default location})" >&6
+      ;;
+   *)
+   echo "$as_me:$LINENO: result: $withval" >&5
diff --git a/security/pks/files/patch-pgputil.c b/security/pks/files/patch-pgputil.c
index 624635bcb56f..900a86d868b0 100644
--- a/security/pks/files/patch-pgputil.c
+++ b/security/pks/files/patch-pgputil.c
@@ -14,7 +14,7 @@
        break;
      case EVP_PKEY_DSA:
 -      b = BN_dup (pkey->pkey.dsa->p);
-+      b = BN_dup (RSA_get0_p(EVP_PKEY_get0_DSA(pkey)));
++      b = BN_dup (DSA_get0_p(EVP_PKEY_get0_DSA(pkey)));
        break;
      }
    EVP_PKEY_free (pkey);