| @@ -1,145 +1,151 @@ | | | @@ -1,145 +1,151 @@ |
1 | # $NetBSD: Makefile,v 1.293 2023/10/27 18:30:12 jperkin Exp $ | | 1 | # $NetBSD: Makefile,v 1.294 2023/11/05 19:37:19 nia Exp $ |
2 | | | 2 | |
3 | # Remember to upload-distfiles when updating OpenSSL -- otherwise it | | 3 | # Remember to upload-distfiles when updating OpenSSL -- otherwise it |
4 | # is not possible for users who have bootstrapped without OpenSSL | | 4 | # is not possible for users who have bootstrapped without OpenSSL |
5 | # to install it and enable HTTPS fetching. | | 5 | # to install it and enable HTTPS fetching. |
6 | DISTNAME= openssl-3.1.4 | | 6 | DISTNAME= openssl-3.1.4 |
7 | CATEGORIES= security | | 7 | CATEGORIES= security |
8 | MASTER_SITES= https://www.openssl.org/source/ | | 8 | MASTER_SITES= https://www.openssl.org/source/ |
9 | | | 9 | |
10 | MAINTAINER= pkgsrc-users@NetBSD.org | | 10 | MAINTAINER= pkgsrc-users@NetBSD.org |
11 | HOMEPAGE= https://www.openssl.org/ | | 11 | HOMEPAGE= https://www.openssl.org/ |
12 | COMMENT= Secure Socket Layer and cryptographic library | | 12 | COMMENT= Secure Socket Layer and cryptographic library |
13 | LICENSE= openssl | | 13 | LICENSE= openssl |
14 | | | 14 | |
15 | USE_GCC_RUNTIME= yes | | 15 | USE_GCC_RUNTIME= yes |
16 | | | 16 | |
17 | USE_TOOLS+= fgrep gmake perl | | 17 | USE_TOOLS+= fgrep gmake perl |
18 | USE_TOOLS.SunOS+= gm4 | | 18 | USE_TOOLS.SunOS+= gm4 |
19 | BUILD_TARGET= depend all | | 19 | BUILD_TARGET= depend all |
20 | TEST_TARGET= test | | 20 | TEST_TARGET= test |
21 | | | 21 | |
22 | HAS_CONFIGURE= yes | | 22 | HAS_CONFIGURE= yes |
23 | CONFIGURE_SCRIPT= ./config | | 23 | CONFIGURE_SCRIPT= ./config |
24 | CONFIGURE_ARGS+= --prefix=${PREFIX} | | 24 | CONFIGURE_ARGS+= --prefix=${PREFIX} |
25 | CONFIGURE_ARGS+= --libdir=${PREFIX}/lib | | 25 | CONFIGURE_ARGS+= --libdir=${PREFIX}/lib |
26 | CONFIGURE_ARGS+= --openssldir=${PKG_SYSCONFDIR} | | 26 | CONFIGURE_ARGS+= --openssldir=${PKG_SYSCONFDIR} |
27 | CONFIGURE_ARGS+= shared | | 27 | CONFIGURE_ARGS+= shared |
28 | MAKE_FLAGS+= MANSUFFIX= | | 28 | MAKE_FLAGS+= MANSUFFIX= |
29 | MAKE_FLAGS+= MANDIR=${PREFIX}/${PKGMANDIR} | | 29 | MAKE_FLAGS+= MANDIR=${PREFIX}/${PKGMANDIR} |
30 | | | 30 | |
31 | .include "../../mk/bsd.prefs.mk" | | 31 | .include "../../mk/bsd.prefs.mk" |
32 | | | 32 | |
33 | .if ${MACHINE_PLATFORM:MDarwin-[0-8].*-powerpc} | | 33 | .if ${MACHINE_PLATFORM:MDarwin-[0-8].*-powerpc} |
34 | # No {get,make,set}context support before Darwin 9 | | 34 | # No {get,make,set}context support before Darwin 9 |
35 | CONFIGURE_ARGS+= no-async | | 35 | CONFIGURE_ARGS+= no-async |
36 | .endif | | 36 | .endif |
37 | | | 37 | |
| | | 38 | .if ${OPSYS} == "Darwin" && ${OPSYS_VERSION} < 101200 |
| | | 39 | # While it does check for this, it does so using a header that is only |
| | | 40 | # available in OS X versions starting with Leopard. |
| | | 41 | CFLAGS+= -DOPENSSL_NO_APPLE_CRYPTO_RANDOM=1 |
| | | 42 | .endif |
| | | 43 | |
38 | PLIST_VARS+= devcrypto afalg | | 44 | PLIST_VARS+= devcrypto afalg |
39 | # the AF_ALG engine is supported only on Linux, where it | | 45 | # the AF_ALG engine is supported only on Linux, where it |
40 | # is used instead of the BSD /dev/crypto engine. | | 46 | # is used instead of the BSD /dev/crypto engine. |
41 | .if ${OPSYS} == "Linux" | | 47 | .if ${OPSYS} == "Linux" |
42 | PLIST.afalg= yes | | 48 | PLIST.afalg= yes |
43 | .endif | | 49 | .endif |
44 | .if exists(/dev/crypto) && ${OPSYS} != "SunOS" | | 50 | .if exists(/dev/crypto) && ${OPSYS} != "SunOS" |
45 | PLIST.devcrypto= yes | | 51 | PLIST.devcrypto= yes |
46 | .else | | 52 | .else |
47 | CONFIGURE_ARGS+= no-devcryptoeng | | 53 | CONFIGURE_ARGS+= no-devcryptoeng |
48 | .endif | | 54 | .endif |
49 | | | 55 | |
50 | # Fix 64-bit build on at least Mac OS X Snow Leopard | | 56 | # Fix 64-bit build on at least Mac OS X Snow Leopard |
51 | .if ${OPSYS} == "Darwin" && ${MACHINE_ARCH} == "x86_64" | | 57 | .if ${OPSYS} == "Darwin" && ${MACHINE_ARCH} == "x86_64" |
52 | CONFIGURE_ENV+= KERNEL_BITS=${ABI} | | 58 | CONFIGURE_ENV+= KERNEL_BITS=${ABI} |
53 | .endif | | 59 | .endif |
54 | | | 60 | |
55 | .if ${USE_CROSS_COMPILE:tl} == "yes" | | 61 | .if ${USE_CROSS_COMPILE:tl} == "yes" |
56 | | | 62 | |
57 | OPENSSL_ARCH.aarch64= arm64 | | 63 | OPENSSL_ARCH.aarch64= arm64 |
58 | OPENSSL_ARCH.x86_64= amd64 | | 64 | OPENSSL_ARCH.x86_64= amd64 |
59 | CONFIGURE_ENV+= MACHINE=${OPENSSL_ARCH.${MACHINE_ARCH}:U${MACHINE_GNU_ARCH}:Q} | | 65 | CONFIGURE_ENV+= MACHINE=${OPENSSL_ARCH.${MACHINE_ARCH}:U${MACHINE_GNU_ARCH}:Q} |
60 | CONFIGURE_ENV+= RELEASE=${OS_VERSION:Q} | | 66 | CONFIGURE_ENV+= RELEASE=${OS_VERSION:Q} |
61 | CONFIGURE_ENV+= SYSTEM=${OPSYS:Q} | | 67 | CONFIGURE_ENV+= SYSTEM=${OPSYS:Q} |
62 | CONFIGURE_ENV+= BUILD=${OPSYS:Q}\ ${OS_VERSION:Q} | | 68 | CONFIGURE_ENV+= BUILD=${OPSYS:Q}\ ${OS_VERSION:Q} |
63 | | | 69 | |
64 | # We don't carry a runtime dependency on Perl, but OpenSSL does provide | | 70 | # We don't carry a runtime dependency on Perl, but OpenSSL does provide |
65 | # a Perl script that you can use if you do install Perl. | | 71 | # a Perl script that you can use if you do install Perl. |
66 | SUBST_CLASSES+= perlcross | | 72 | SUBST_CLASSES+= perlcross |
67 | SUBST_MESSAGE.perlcross= Fixing Perl interpreter path for cross-build | | 73 | SUBST_MESSAGE.perlcross= Fixing Perl interpreter path for cross-build |
68 | SUBST_STAGE.perlcross= pre-install | | 74 | SUBST_STAGE.perlcross= pre-install |
69 | SUBST_FILES.perlcross+= tools/c_rehash | | 75 | SUBST_FILES.perlcross+= tools/c_rehash |
70 | SUBST_FILES.perlcross+= apps/CA.pl | | 76 | SUBST_FILES.perlcross+= apps/CA.pl |
71 | SUBST_FILES.perlcross+= apps/tsget.pl | | 77 | SUBST_FILES.perlcross+= apps/tsget.pl |
72 | SUBST_SED.perlcross= -e s,${PERL5:Q},${LOCALBASE:Q}/bin/perl5,g | | 78 | SUBST_SED.perlcross= -e s,${PERL5:Q},${LOCALBASE:Q}/bin/perl5,g |
73 | CHECK_INTERPRETER_SKIP+= bin/c_rehash | | 79 | CHECK_INTERPRETER_SKIP+= bin/c_rehash |
74 | | | 80 | |
75 | .endif # USE_CROSS_COMPILE | | 81 | .endif # USE_CROSS_COMPILE |
76 | | | 82 | |
77 | .include "options.mk" | | 83 | .include "options.mk" |
78 | | | 84 | |
79 | CONFIGURE_ENV+= PERL=${PERL5:Q} | | 85 | CONFIGURE_ENV+= PERL=${PERL5:Q} |
80 | | | 86 | |
81 | # If the config script cannot guess the host system correctly then we need to | | 87 | # If the config script cannot guess the host system correctly then we need to |
82 | # specify it manually and call the Configure script directly. | | 88 | # specify it manually and call the Configure script directly. |
83 | OPENSSL_HOST.SunOS-i386= solaris-x86-gcc | | 89 | OPENSSL_HOST.SunOS-i386= solaris-x86-gcc |
84 | .if ${PKGSRC_COMPILER:Msunpro} | | 90 | .if ${PKGSRC_COMPILER:Msunpro} |
85 | OPENSSL_HOST.SunOS-x86_64= solaris64-x86_64-cc | | 91 | OPENSSL_HOST.SunOS-x86_64= solaris64-x86_64-cc |
86 | .else | | 92 | .else |
87 | OPENSSL_HOST.SunOS-x86_64= solaris64-x86_64-gcc | | 93 | OPENSSL_HOST.SunOS-x86_64= solaris64-x86_64-gcc |
88 | .endif | | 94 | .endif |
89 | OPENSSL_HOST.Darwin-aarch64= darwin64-arm64-cc | | 95 | OPENSSL_HOST.Darwin-aarch64= darwin64-arm64-cc |
90 | | | 96 | |
91 | LDFLAGS.SunOS+= -lrt | | 97 | LDFLAGS.SunOS+= -lrt |
92 | CPPFLAGS.OpenBSD+= -D__STDC_NO_ATOMICS__ | | 98 | CPPFLAGS.OpenBSD+= -D__STDC_NO_ATOMICS__ |
93 | | | 99 | |
94 | .if defined(OPENSSL_HOST.${OPSYS}-${MACHINE_ARCH}) | | 100 | .if defined(OPENSSL_HOST.${OPSYS}-${MACHINE_ARCH}) |
95 | CONFIG_SHELL= ${PERL5} | | 101 | CONFIG_SHELL= ${PERL5} |
96 | CONFIGURE_SCRIPT= ./Configure | | 102 | CONFIGURE_SCRIPT= ./Configure |
97 | CONFIGURE_ARGS+= ${OPENSSL_HOST.${OPSYS}-${MACHINE_ARCH}} | | 103 | CONFIGURE_ARGS+= ${OPENSSL_HOST.${OPSYS}-${MACHINE_ARCH}} |
98 | .endif | | 104 | .endif |
99 | | | 105 | |
100 | PKGCONFIG_OVERRIDE+= libcrypto.pc libssl.pc openssl.pc | | 106 | PKGCONFIG_OVERRIDE+= libcrypto.pc libssl.pc openssl.pc |
101 | PKGCONFIG_OVERRIDE_STAGE= post-build | | 107 | PKGCONFIG_OVERRIDE_STAGE= post-build |
102 | | | 108 | |
103 | PKG_SYSCONFSUBDIR= openssl | | 109 | PKG_SYSCONFSUBDIR= openssl |
104 | CONF_FILES= ${PREFIX}/share/examples/openssl/openssl.cnf \ | | 110 | CONF_FILES= ${PREFIX}/share/examples/openssl/openssl.cnf \ |
105 | ${PKG_SYSCONFDIR}/openssl.cnf | | 111 | ${PKG_SYSCONFDIR}/openssl.cnf |
106 | OWN_DIRS= ${PKG_SYSCONFDIR}/certs ${PKG_SYSCONFDIR}/private | | 112 | OWN_DIRS= ${PKG_SYSCONFDIR}/certs ${PKG_SYSCONFDIR}/private |
107 | | | 113 | |
108 | INSTALLATION_DIRS+= share/examples/openssl | | 114 | INSTALLATION_DIRS+= share/examples/openssl |
109 | | | 115 | |
110 | # | | 116 | # |
111 | # Note that this package cannot be updated solely from Darwin, it relies on | | 117 | # Note that this package cannot be updated solely from Darwin, it relies on |
112 | # shlib-dylib.awk to convert the normal .so entries to dylib, which doesn't | | 118 | # shlib-dylib.awk to convert the normal .so entries to dylib, which doesn't |
113 | # work the other way around. The lib/engines-1.1 plugins also need special | | 119 | # work the other way around. The lib/engines-1.1 plugins also need special |
114 | # handling. | | 120 | # handling. |
115 | # | | 121 | # |
116 | OPSYSVARS+= SOEXT | | 122 | OPSYSVARS+= SOEXT |
117 | SOEXT.Darwin= dylib | | 123 | SOEXT.Darwin= dylib |
118 | SOEXT.*= so | | 124 | SOEXT.*= so |
119 | PLIST_SUBST+= SOEXT=${SOEXT} | | 125 | PLIST_SUBST+= SOEXT=${SOEXT} |
120 | | | 126 | |
121 | PRINT_PLIST_AWK+= /^lib\/engines/ { gsub(/\.${SOEXT}$$/, ".$${SOEXT}"); } | | 127 | PRINT_PLIST_AWK+= /^lib\/engines/ { gsub(/\.${SOEXT}$$/, ".$${SOEXT}"); } |
122 | | | 128 | |
123 | # Remove CC from the environment, to fix GCC version handling on HP-UX, | | 129 | # Remove CC from the environment, to fix GCC version handling on HP-UX, |
124 | # SunOS and Linux/sparc. | | 130 | # SunOS and Linux/sparc. |
125 | # | | 131 | # |
126 | # See https://github.com/openssl/openssl/issues/11060. | | 132 | # See https://github.com/openssl/openssl/issues/11060. |
127 | do-configure: | | 133 | do-configure: |
128 | ${RUN} cd ${WRKSRC} && ${SETENV} ${_CONFIGURE_SCRIPT_ENV:NCC=*} \ | | 134 | ${RUN} cd ${WRKSRC} && ${SETENV} ${_CONFIGURE_SCRIPT_ENV:NCC=*} \ |
129 | ${CONFIG_SHELL} ${CONFIGURE_SCRIPT} ${CONFIGURE_ARGS} | | 135 | ${CONFIG_SHELL} ${CONFIGURE_SCRIPT} ${CONFIGURE_ARGS} |
130 | | | 136 | |
131 | # | | 137 | # |
132 | # Get rid of ridiculous namespace collisions like passwd.1 and just leave the | | 138 | # Get rid of ridiculous namespace collisions like passwd.1 and just leave the |
133 | # openssl-*.1 style variants. On a more practical note this avoids creating | | 139 | # openssl-*.1 style variants. On a more practical note this avoids creating |
134 | # a conflict with moreutils (ts.1). | | 140 | # a conflict with moreutils (ts.1). |
135 | # | | 141 | # |
136 | post-install: | | 142 | post-install: |
137 | cd ${DESTDIR}${PREFIX}/${PKGMANDIR}/man1; \ | | 143 | cd ${DESTDIR}${PREFIX}/${PKGMANDIR}/man1; \ |
138 | for f in openssl-*; do \ | | 144 | for f in openssl-*; do \ |
139 | ${RM} -f `${ECHO} $${f} | ${SED} -e 's/openssl-//'`; \ | | 145 | ${RM} -f `${ECHO} $${f} | ${SED} -e 's/openssl-//'`; \ |
140 | done | | 146 | done |
141 | ${MV} ${DESTDIR}${PKG_SYSCONFDIR}/* \ | | 147 | ${MV} ${DESTDIR}${PKG_SYSCONFDIR}/* \ |
142 | ${DESTDIR}${PREFIX}/share/examples/openssl | | 148 | ${DESTDIR}${PREFIX}/share/examples/openssl |
143 | | | 149 | |
144 | .include "../../mk/dlopen.buildlink3.mk" | | 150 | .include "../../mk/dlopen.buildlink3.mk" |
145 | .include "../../mk/bsd.pkg.mk" | | 151 | .include "../../mk/bsd.pkg.mk" |