pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc Change the way that openssl/builtin.mk handles the USE...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/fc3ac9e39f55
branches:  trunk
changeset: 485515:fc3ac9e39f55
user:      jlam <jlam%pkgsrc.org@localhost>
date:      Tue Dec 14 19:24:29 2004 +0000

description:
Change the way that openssl/builtin.mk handles the USE_OLD_DES_API flag.
The idea is to prevent needing to patch source files for packages that
use OpenSSL for DES support by ensuring that including <openssl/des.h>
will always present the old DES API.

(1) If des_old.h exists, then we're using OpenSSL>=0.9.7, and
    <openssl/des.h> already does the right thing.

(2) If des_old.h doesn't exist, then one of two things is happening:
    (a) If <openssl/des.h> is old and (only) supports the old DES API,
        then <openssl/des.h> does the right thing.
    (b) If it's NetBSD's Special(TM) one that stripped out the old DES
        support into a separate library and header (-ldes, <des.h>),
        then we create a new header <openssl/des.h> that includes the
        system one and <des.h>.

Also modify existing packages that set USE_OLD_DES_API to simply include
<openssl/des.h> instead of either <des.h> or <openssl/des_old.h> (This
step is mostly just removing unnecessary patches).

This should fix building packages that use OpenSSL's old DES API support
on non-NetBSD systems where the built-in OpenSSL is at least 0.9.7.

diffstat:

 mail/libesmtp/distinfo               |   3 +-
 mail/libesmtp/patches/patch-ad       |  13 -----
 net/openvpn-current/distinfo         |   3 +-
 net/openvpn-current/patches/patch-aa |  13 -----
 security/heimdal/distinfo            |   5 +-
 security/heimdal/patches/patch-ad    |  38 +----------------
 security/heimdal/patches/patch-ah    |  13 -----
 security/openssl/builtin.mk          |  82 +++++++++++++++++++++++------------
 8 files changed, 59 insertions(+), 111 deletions(-)

diffs (244 lines):

diff -r 081fcd3372ed -r fc3ac9e39f55 mail/libesmtp/distinfo
--- a/mail/libesmtp/distinfo    Tue Dec 14 19:03:26 2004 +0000
+++ b/mail/libesmtp/distinfo    Tue Dec 14 19:24:29 2004 +0000
@@ -1,6 +1,5 @@
-$NetBSD: distinfo,v 1.6 2004/12/11 00:13:54 jlam Exp $
+$NetBSD: distinfo,v 1.7 2004/12/14 19:24:29 jlam Exp $
 
 SHA1 (libesmtp-1.0.3r1.tar.bz2) = 05a11a95f6083c25d99a850dbc0d93c8301b77fd
 Size (libesmtp-1.0.3r1.tar.bz2) = 269527 bytes
 SHA1 (patch-ab) = cc027b93ae55b84c1b569ddcdd2644d4f63a33a5
-SHA1 (patch-ad) = 48763f8db999c17230cbf671c249177ac4b882e7
diff -r 081fcd3372ed -r fc3ac9e39f55 mail/libesmtp/patches/patch-ad
--- a/mail/libesmtp/patches/patch-ad    Tue Dec 14 19:03:26 2004 +0000
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,13 +0,0 @@
-$NetBSD: patch-ad,v 1.2 2004/12/11 00:13:54 jlam Exp $
-
---- ntlm/ntlmdes.c.orig        2003-07-25 19:54:18.000000000 +0200
-+++ ntlm/ntlmdes.c     2003-07-25 19:54:34.000000000 +0200
-@@ -24,7 +24,7 @@
- #include <stdlib.h>
- #include <string.h>
- #include <ctype.h>
--#include <openssl/des.h>
-+#include <openssl/des_old.h>
- #include <openssl/md4.h>
- 
- #include "ntlm.h"
diff -r 081fcd3372ed -r fc3ac9e39f55 net/openvpn-current/distinfo
--- a/net/openvpn-current/distinfo      Tue Dec 14 19:03:26 2004 +0000
+++ b/net/openvpn-current/distinfo      Tue Dec 14 19:24:29 2004 +0000
@@ -1,5 +1,4 @@
-$NetBSD: distinfo,v 1.2 2004/12/03 23:13:10 jlam Exp $
+$NetBSD: distinfo,v 1.3 2004/12/14 19:24:29 jlam Exp $
 
 SHA1 (openvpn-2.0_beta15.tar.gz) = f1b210df6c8b6ea45737f97e3a184e6dac7b2ec1
 Size (openvpn-2.0_beta15.tar.gz) = 585952 bytes
-SHA1 (patch-aa) = 06898cead40974b91d5fa4f2d5a4a9e3ae9d3ffe
diff -r 081fcd3372ed -r fc3ac9e39f55 net/openvpn-current/patches/patch-aa
--- a/net/openvpn-current/patches/patch-aa      Tue Dec 14 19:03:26 2004 +0000
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,13 +0,0 @@
-$NetBSD: patch-aa,v 1.2 2004/12/03 23:13:10 jlam Exp $
-
---- ntlm.c.orig        2004-10-02 06:22:38.000000000 -0400
-+++ ntlm.c
-@@ -29,7 +29,7 @@
- 
- #if NTLM
- 
--#include <openssl/des.h>
-+#include <openssl/des_old.h>
- #include <openssl/md4.h>
- #include "common.h"
- #include "buffer.h"
diff -r 081fcd3372ed -r fc3ac9e39f55 security/heimdal/distinfo
--- a/security/heimdal/distinfo Tue Dec 14 19:03:26 2004 +0000
+++ b/security/heimdal/distinfo Tue Dec 14 19:24:29 2004 +0000
@@ -1,9 +1,8 @@
-$NetBSD: distinfo,v 1.8 2004/12/04 03:59:26 jlam Exp $
+$NetBSD: distinfo,v 1.9 2004/12/14 19:24:29 jlam Exp $
 
 SHA1 (heimdal-0.6.3.tar.gz) = 91863a1bd9f8a55063a09c28a5f41985b7a31145
 Size (heimdal-0.6.3.tar.gz) = 3333604 bytes
 SHA1 (patch-ab) = 400a9ac3a76ac7e8b4dcc230e0bdf7fc5222fbb7
 SHA1 (patch-ac) = 121961811f559822c6a4f3d7f7e4646b16908942
-SHA1 (patch-ad) = b2ebbf5ad71125634fd569a0ee0245d23bcfd068
+SHA1 (patch-ad) = 20347c61cf79c17500ab3508424632efc3545b65
 SHA1 (patch-ae) = 518eabed07d4fc69e86ace3f02d23ca3064d4bd1
-SHA1 (patch-ah) = b7ef27e2a218d5f69180f799b31a1b6c08ec602f
diff -r 081fcd3372ed -r fc3ac9e39f55 security/heimdal/patches/patch-ad
--- a/security/heimdal/patches/patch-ad Tue Dec 14 19:03:26 2004 +0000
+++ b/security/heimdal/patches/patch-ad Tue Dec 14 19:24:29 2004 +0000
@@ -1,4 +1,4 @@
-$NetBSD: patch-ad,v 1.4 2004/12/04 03:59:27 jlam Exp $
+$NetBSD: patch-ad,v 1.5 2004/12/14 19:24:29 jlam Exp $
 
 --- configure.orig     2004-09-13 08:27:10.000000000 -0400
 +++ configure
@@ -12,39 +12,3 @@
  # Make sure we can run config.sub.
  $ac_config_sub sun4 >/dev/null 2>&1 ||
    { { echo "$as_me:$LINENO: error: cannot run $ac_config_sub" >&5
-@@ -22005,7 +22002,7 @@ cat >>conftest.$ac_ext <<_ACEOF
-               #include <openssl/md5.h>
-               #include <openssl/sha.h>
-               #define OPENSSL_DES_LIBDES_COMPATIBILITY
--              #include <openssl/des.h>
-+              #include <openssl/des_old.h>
-               #include <openssl/rc4.h>
-               #include <openssl/rand.h>
-               #else
-@@ -22101,7 +22098,7 @@ cat >>conftest.$ac_ext <<_ACEOF
-               #include <openssl/md5.h>
-               #include <openssl/sha.h>
-               #define OPENSSL_DES_LIBDES_COMPATIBILITY
--              #include <openssl/des.h>
-+              #include <openssl/des_old.h>
-               #include <openssl/rc4.h>
-               #include <openssl/rand.h>
-               #else
-@@ -22197,7 +22194,7 @@ cat >>conftest.$ac_ext <<_ACEOF
-               #include <openssl/md5.h>
-               #include <openssl/sha.h>
-               #define OPENSSL_DES_LIBDES_COMPATIBILITY
--              #include <openssl/des.h>
-+              #include <openssl/des_old.h>
-               #include <openssl/rc4.h>
-               #include <openssl/rand.h>
-               #else
-@@ -22324,7 +22321,7 @@ cat >>conftest.$ac_ext <<_ACEOF
-               #include <openssl/md5.h>
-               #include <openssl/sha.h>
-               #define OPENSSL_DES_LIBDES_COMPATIBILITY
--              #include <openssl/des.h>
-+              #include <openssl/des_old.h>
-               #include <openssl/rc4.h>
-               #include <openssl/rand.h>
-               #else
diff -r 081fcd3372ed -r fc3ac9e39f55 security/heimdal/patches/patch-ah
--- a/security/heimdal/patches/patch-ah Tue Dec 14 19:03:26 2004 +0000
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,13 +0,0 @@
-$NetBSD: patch-ah,v 1.1 2004/12/04 03:59:27 jlam Exp $
-
---- include/make_crypto.c.orig 2003-05-05 16:10:27.000000000 -0400
-+++ include/make_crypto.c
-@@ -61,7 +61,7 @@ main(int argc, char **argv)
-     fprintf(f, "#define __%s__\n", argv[1]);
- #ifdef HAVE_OPENSSL
-     fputs("#define OPENSSL_DES_LIBDES_COMPATIBILITY\n", f);
--    fputs("#include <openssl/des.h>\n", f);
-+    fputs("#include <openssl/des_old.h>\n", f);
-     fputs("#include <openssl/rc4.h>\n", f);
-     fputs("#include <openssl/md4.h>\n", f);
-     fputs("#include <openssl/md5.h>\n", f);
diff -r 081fcd3372ed -r fc3ac9e39f55 security/openssl/builtin.mk
--- a/security/openssl/builtin.mk       Tue Dec 14 19:03:26 2004 +0000
+++ b/security/openssl/builtin.mk       Tue Dec 14 19:24:29 2004 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: builtin.mk,v 1.7 2004/12/11 00:04:14 jlam Exp $
+# $NetBSD: builtin.mk,v 1.8 2004/12/14 19:24:29 jlam Exp $
 
 _OPENSSL_PKGSRC_PKGNAME=       openssl-0.9.6m
 _OPENSSL_OPENSSLV_H=           /usr/include/openssl/opensslv.h
@@ -146,45 +146,71 @@
        "Unable to satisfy dependency: ${BUILDLINK_DEPENDS.openssl}"
 .endif
 
+.if !empty(USE_BUILTIN.openssl:M[yY][eE][sS])
+BUILDLINK_PREFIX.openssl=      /usr
+.endif
+
 # By default, we don't bother with the old DES API.
 USE_OLD_DES_API?=      no
-
-.if !empty(USE_BUILTIN.openssl:M[yY][eE][sS])
-BUILDLINK_PREFIX.openssl=      /usr
+.if !empty(USE_OLD_DES_API:M[yY][eE][sS])
 #
 # If we're using the old DES API, then check to see if the old DES
 # code was factored out into a separate library and header files and
 # no longer a part of libcrypto.
 #
-.  if !empty(USE_OLD_DES_API:M[yY][eE][sS]) && \
-      !exists(${BUILDLINK_PREFIX.openssl}/include/openssl/des_old.h)
+.  if !empty(USE_BUILTIN.openssl:M[yY][eE][sS])
 .    if exists(${BUILDLINK_PREFIX.openssl}/include/des.h) && \
-        !empty(_BLNK_LIB_FOUND.des:M[yY][eE][sS])
-BUILDLINK_TRANSFORM+=          l:crypto:des:crypto
-WRAPPER_REORDER_CMDS+=         reorder:l:des:crypto
+      !empty(_BLNK_LIB_FOUND.des:M[yY][eE][sS])
+BUILDLINK_TRANSFORM+=  l:crypto:des:crypto
+WRAPPER_REORDER_CMDS+= reorder:l:des:crypto
 .    endif
+.  endif
 
-BUILDLINK_TARGETS+=            buildlink-openssl-des-old.h
-.    if !target(buildlink-openssl-des-old.h)
-.PHONY: buildlink-openssl-des-old.h
-buildlink-openssl-des-old.h:
+# The idea is to prevent needing to patch source files for packages that
+# use OpenSSL for DES support by ensuring that including <openssl/des.h>
+# will always present the old DES API.
+#
+# (1) If des_old.h exists, then we're using OpenSSL>=0.9.7, and
+#     <openssl/des.h> already does the right thing.
+#
+# (2) If des_old.h doesn't exist, then one of two things is happening:
+#     (a) If <openssl/des.h> is old and (only) supports the old DES API,
+#         then <openssl/des.h> does the right thing.
+#     (b) If it's NetBSD's Special(TM) one that stripped out the old DES
+#         support into a separate library and header (-ldes, <des.h>),
+#         then we create a new header <openssl/des.h> that includes the
+#         system one and <des.h>.
+#
+BUILDLINK_TARGETS+=    buildlink-openssl-des-h
+.  if !target(buildlink-openssl-des-h)
+.PHONY: buildlink-openssl-des-h
+buildlink-openssl-des-h:
        ${_PKG_SILENT}${_PKG_DEBUG}                                     \
-       dest="${BUILDLINK_DIR}/include/openssl/des_old.h";              \
-       if ${TEST} ! -f "$$dest"; then                                  \
-               for src in                                              \
-                       ${BUILDLINK_PREFIX.openssl}/include/des.h       \
-                       ${BUILDLINK_PREFIX.openssl}/include/openssl/des.h; \
-               do                                                      \
-                       if ${TEST} -f "$$src"; then                     \
-                               ${MKDIR} -p `${DIRNAME} "$$dest"`;      \
-                               ${LN} -fs $$src $$dest;                 \
-                               break;                                  \
-                       fi;                                             \
-               done;                                                   \
+       bl_odes_h="${BUILDLINK_DIR}/include/openssl/des.h";             \
+       odes_h="${BUILDLINK_PREFIX.openssl}/include/openssl/des.h";     \
+       odes_old_h="${BUILDLINK_PREFIX.openssl}/include/openssl/des_old.h"; \
+       des_h="${BUILDLINK_PREFIX.openssl}/include/des.h";              \
+       if ${TEST} -f "$$odes_old_h"; then                              \
+               ${ECHO_BUILDLINK_MSG} "<openssl/des.h> supports old DES API."; \
+               exit 0;                                                 \
+       elif ${GREP} -q "des_cblock" "$$ossl_h" 2>/dev/null; then       \
+               ${ECHO_BUILDLINK_MSG} "<openssl/des.h> supports old DES API."; \
+               exit 0;                                                 \
+       elif ${TEST} -f "$$des_h" -a -f "$$odes_h"; then                \
+               ${ECHO_BUILDLINK_MSG} "Creating $$bl_odes_h";           \
+               ${RM} -f $$bl_odes_h;                                   \
+               ${MKDIR} `${DIRNAME} $$bl_odes_h`;                      \
+               ( ${ECHO} "/* Created by openssl/builtin.mk:${.TARGET} */"; \
+                 ${ECHO} "#include \"$$odes_h\"";                      \
+                 ${ECHO} "#include \"$$des_h\"";                       \
+               ) > $$bl_odes_h;                                        \
+               exit 0;                                                 \
+       else                                                            \
+               ${ECHO} "Unable to find headers for old DES API.";      \
+               exit 1;                                                 \
        fi
-.    endif
-.  endif # USE_OLD_DES_API == yes
-.endif # USE_BUILTIN.openssl == yes
+.  endif
+.endif # USE_OLD_DES_API == yes
 
 .if defined(PKG_SYSCONFDIR.openssl)
 SSLCERTS=      ${PKG_SYSCONFDIR.openssl}/certs



Home | Main Index | Thread Index | Old Index