|
| 1 | +# $NetBSD: Makefile,v 1.283 2022/07/11 23:03:51 wiz Exp $ |
| 2 | + |
| 3 | +# Remember to upload-distfiles when updating OpenSSL -- otherwise it |
| 4 | +# is not possible for users who have bootstrapped without OpenSSL |
| 5 | +# to install it and enable HTTPS fetching. |
| 6 | +DISTNAME= openssl-3.0.5 |
| 7 | +CATEGORIES= security |
| 8 | +MASTER_SITES= https://www.openssl.org/source/ |
| 9 | + |
| 10 | +MAINTAINER= pkgsrc-users@NetBSD.org |
| 11 | +HOMEPAGE= https://www.openssl.org/ |
| 12 | +COMMENT= Secure Socket Layer and cryptographic library |
| 13 | +LICENSE= openssl |
| 14 | + |
| 15 | +USE_GCC_RUNTIME= yes |
| 16 | + |
| 17 | +USE_TOOLS+= fgrep gmake perl |
| 18 | +USE_TOOLS.SunOS+= gm4 |
| 19 | +BUILD_TARGET= depend all |
| 20 | +TEST_TARGET= test |
| 21 | + |
| 22 | +HAS_CONFIGURE= yes |
| 23 | +CONFIGURE_SCRIPT= ./config |
| 24 | +CONFIGURE_ARGS+= --prefix=${PREFIX} |
| 25 | +CONFIGURE_ARGS+= --libdir=${PREFIX}/lib |
| 26 | +CONFIGURE_ARGS+= --openssldir=${PKG_SYSCONFDIR} |
| 27 | +CONFIGURE_ARGS+= shared |
| 28 | +MAKE_FLAGS+= MANSUFFIX= |
| 29 | +MAKE_FLAGS+= MANDIR=${PREFIX}/${PKGMANDIR} |
| 30 | + |
| 31 | +.include "../../mk/bsd.prefs.mk" |
| 32 | + |
| 33 | +.if !empty(MACHINE_PLATFORM:MDarwin-[0-8].*-powerpc) |
| 34 | +# No {get,make,set}context support before Darwin 9 |
| 35 | +CONFIGURE_ARGS+= no-async |
| 36 | +.endif |
| 37 | + |
| 38 | +# Fix 64-bit build on at least Mac OS X Snow Leopard |
| 39 | +.if ${OPSYS} == "Darwin" && ${MACHINE_ARCH} == "x86_64" |
| 40 | +CONFIGURE_ENV+= KERNEL_BITS=${ABI} |
| 41 | +.endif |
| 42 | + |
| 43 | +.include "options.mk" |
| 44 | + |
| 45 | +CONFIGURE_ENV+= PERL=${PERL5:Q} |
| 46 | + |
| 47 | +# If the config script cannot guess the host system correctly then we need to |
| 48 | +# specify it manually and call the Configure script directly. |
| 49 | +OPENSSL_HOST.SunOS-i386= solaris-x86-gcc |
| 50 | +.if ${PKGSRC_COMPILER:Msunpro} |
| 51 | +OPENSSL_HOST.SunOS-x86_64= solaris64-x86_64-cc |
| 52 | +.else |
| 53 | +OPENSSL_HOST.SunOS-x86_64= solaris64-x86_64-gcc |
| 54 | +.endif |
| 55 | +OPENSSL_HOST.Darwin-aarch64= darwin64-arm64-cc |
| 56 | + |
| 57 | +LDFLAGS.SunOS+= -lrt |
| 58 | +CPPFLAGS.OpenBSD+= -D__STDC_NO_ATOMICS__ |
| 59 | + |
| 60 | +.if defined(OPENSSL_HOST.${OPSYS}-${MACHINE_ARCH}) |
| 61 | +CONFIG_SHELL= ${PERL5} |
| 62 | +CONFIGURE_SCRIPT= ./Configure |
| 63 | +CONFIGURE_ARGS+= ${OPENSSL_HOST.${OPSYS}-${MACHINE_ARCH}} |
| 64 | +.endif |
| 65 | + |
| 66 | +PKGCONFIG_OVERRIDE+= libcrypto.pc libssl.pc openssl.pc |
| 67 | +PKGCONFIG_OVERRIDE_STAGE= post-build |
| 68 | + |
| 69 | +PKG_SYSCONFSUBDIR= openssl |
| 70 | +CONF_FILES= ${PREFIX}/share/examples/openssl/openssl.cnf \ |
| 71 | + ${PKG_SYSCONFDIR}/openssl.cnf |
| 72 | +OWN_DIRS= ${PKG_SYSCONFDIR}/certs ${PKG_SYSCONFDIR}/private |
| 73 | + |
| 74 | +INSTALLATION_DIRS+= share/examples/openssl |
| 75 | + |
| 76 | +# |
| 77 | +# Note that this package cannot be updated solely from Darwin, it relies on |
| 78 | +# shlib-dylib.awk to convert the normal .so entries to dylib, which doesn't |
| 79 | +# work the other way around. The lib/engines-1.1 plugins also need special |
| 80 | +# handling. |
| 81 | +# |
| 82 | +OPSYSVARS+= SOEXT |
| 83 | +SOEXT.Darwin= dylib |
| 84 | +SOEXT.*= so |
| 85 | +PLIST_SUBST+= SOEXT=${SOEXT} |
| 86 | + |
| 87 | +PRINT_PLIST_AWK+= /^lib\/engines/ { gsub(/\.${SOEXT}$$/, ".$${SOEXT}"); } |
| 88 | + |
| 89 | +# Remove CC from the environment, to fix GCC version handling on HP-UX, |
| 90 | +# SunOS and Linux/sparc. |
| 91 | +# |
| 92 | +# See https://github.com/openssl/openssl/issues/11060. |
| 93 | +do-configure: |
| 94 | + ${RUN} cd ${WRKSRC} && ${SETENV} ${_CONFIGURE_SCRIPT_ENV:NCC=*} \ |
| 95 | + ${CONFIG_SHELL} ${CONFIGURE_SCRIPT} ${CONFIGURE_ARGS} |
| 96 | + |
| 97 | +# |
| 98 | +# Get rid of ridiculous namespace collisions like passwd.1 and just leave the |
| 99 | +# openssl-*.1 style variants. On a more practical note this avoids creating |
| 100 | +# a conflict with moreutils (ts.1). |
| 101 | +# |
| 102 | +post-install: |
| 103 | + cd ${DESTDIR}${PREFIX}/${PKGMANDIR}/man1; \ |
| 104 | + for f in openssl-*; do \ |
| 105 | + ${RM} -f $${f}; \ |
| 106 | + ${MV} `${ECHO} $${f} | ${SED} -e 's/openssl-//'` $${f}; \ |
| 107 | + done |
| 108 | + ${MV} ${DESTDIR}${PREFIX}/etc/openssl/* ${DESTDIR}${PREFIX}/share/examples/openssl |
| 109 | + |
| 110 | +.include "../../mk/dlopen.buildlink3.mk" |
| 111 | +.include "../../mk/bsd.pkg.mk" |
0 commit comments