Skip to content

Commit

Permalink
openssl3: add package for version 3 of openssl
Browse files Browse the repository at this point in the history
  • Loading branch information
0-wiz-0 committed Jul 12, 2022
1 parent b45491b commit 8f3089f
Show file tree
Hide file tree
Showing 8 changed files with 6,810 additions and 0 deletions.
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2741,6 +2741,7 @@ SUBDIR+= openshot-qt
SUBDIR+= opensips
SUBDIR+= opensmtpd
SUBDIR+= openssl110
SUBDIR+= openssl3
SUBDIR+= opensubdiv
SUBDIR+= opensurge
SUBDIR+= opentomb
Expand Down
10 changes: 10 additions & 0 deletions openssl3/DESCR
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
The OpenSSL Project is a collaborative effort to develop a
robust, commercial-grade, full-featured, and Open Source
toolkit implementing the Secure Sockets Layer (SSL v2/v3)
and Transport Layer Security (TLS v1) protocols as well as
a full-strength general purpose cryptography library. The
project is managed by a worldwide community of volunteers
that use the Internet to communicate, plan, and develop the
OpenSSL toolkit and its related documentation.

This package contains major version 3 of OpenSSL.
111 changes: 111 additions & 0 deletions openssl3/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
# $NetBSD: Makefile,v 1.283 2022/07/11 23:03:51 wiz Exp $

# Remember to upload-distfiles when updating OpenSSL -- otherwise it
# is not possible for users who have bootstrapped without OpenSSL
# to install it and enable HTTPS fetching.
DISTNAME= openssl-3.0.5
CATEGORIES= security
MASTER_SITES= https://www.openssl.org/source/

MAINTAINER= [email protected]
HOMEPAGE= https://www.openssl.org/
COMMENT= Secure Socket Layer and cryptographic library
LICENSE= openssl

USE_GCC_RUNTIME= yes

USE_TOOLS+= fgrep gmake perl
USE_TOOLS.SunOS+= gm4
BUILD_TARGET= depend all
TEST_TARGET= test

HAS_CONFIGURE= yes
CONFIGURE_SCRIPT= ./config
CONFIGURE_ARGS+= --prefix=${PREFIX}
CONFIGURE_ARGS+= --libdir=${PREFIX}/lib
CONFIGURE_ARGS+= --openssldir=${PKG_SYSCONFDIR}
CONFIGURE_ARGS+= shared
MAKE_FLAGS+= MANSUFFIX=
MAKE_FLAGS+= MANDIR=${PREFIX}/${PKGMANDIR}

.include "../../mk/bsd.prefs.mk"

.if !empty(MACHINE_PLATFORM:MDarwin-[0-8].*-powerpc)
# No {get,make,set}context support before Darwin 9
CONFIGURE_ARGS+= no-async
.endif

# Fix 64-bit build on at least Mac OS X Snow Leopard
.if ${OPSYS} == "Darwin" && ${MACHINE_ARCH} == "x86_64"
CONFIGURE_ENV+= KERNEL_BITS=${ABI}
.endif

.include "options.mk"

CONFIGURE_ENV+= PERL=${PERL5:Q}

# If the config script cannot guess the host system correctly then we need to
# specify it manually and call the Configure script directly.
OPENSSL_HOST.SunOS-i386= solaris-x86-gcc
.if ${PKGSRC_COMPILER:Msunpro}
OPENSSL_HOST.SunOS-x86_64= solaris64-x86_64-cc
.else
OPENSSL_HOST.SunOS-x86_64= solaris64-x86_64-gcc
.endif
OPENSSL_HOST.Darwin-aarch64= darwin64-arm64-cc

LDFLAGS.SunOS+= -lrt
CPPFLAGS.OpenBSD+= -D__STDC_NO_ATOMICS__

.if defined(OPENSSL_HOST.${OPSYS}-${MACHINE_ARCH})
CONFIG_SHELL= ${PERL5}
CONFIGURE_SCRIPT= ./Configure
CONFIGURE_ARGS+= ${OPENSSL_HOST.${OPSYS}-${MACHINE_ARCH}}
.endif

PKGCONFIG_OVERRIDE+= libcrypto.pc libssl.pc openssl.pc
PKGCONFIG_OVERRIDE_STAGE= post-build

PKG_SYSCONFSUBDIR= openssl
CONF_FILES= ${PREFIX}/share/examples/openssl/openssl.cnf \
${PKG_SYSCONFDIR}/openssl.cnf
OWN_DIRS= ${PKG_SYSCONFDIR}/certs ${PKG_SYSCONFDIR}/private

INSTALLATION_DIRS+= share/examples/openssl

#
# Note that this package cannot be updated solely from Darwin, it relies on
# shlib-dylib.awk to convert the normal .so entries to dylib, which doesn't
# work the other way around. The lib/engines-1.1 plugins also need special
# handling.
#
OPSYSVARS+= SOEXT
SOEXT.Darwin= dylib
SOEXT.*= so
PLIST_SUBST+= SOEXT=${SOEXT}

PRINT_PLIST_AWK+= /^lib\/engines/ { gsub(/\.${SOEXT}$$/, ".$${SOEXT}"); }

# Remove CC from the environment, to fix GCC version handling on HP-UX,
# SunOS and Linux/sparc.
#
# See https://github.com/openssl/openssl/issues/11060.
do-configure:
${RUN} cd ${WRKSRC} && ${SETENV} ${_CONFIGURE_SCRIPT_ENV:NCC=*} \
${CONFIG_SHELL} ${CONFIGURE_SCRIPT} ${CONFIGURE_ARGS}

#
# Get rid of ridiculous namespace collisions like passwd.1 and just leave the
# openssl-*.1 style variants. On a more practical note this avoids creating
# a conflict with moreutils (ts.1).
#
post-install:
cd ${DESTDIR}${PREFIX}/${PKGMANDIR}/man1; \
for f in openssl-*; do \
${RM} -f $${f}; \
${MV} `${ECHO} $${f} | ${SED} -e 's/openssl-//'` $${f}; \
done
${MV} ${DESTDIR}${PREFIX}/etc/openssl/* ${DESTDIR}${PREFIX}/share/examples/openssl

.include "../../mk/dlopen.buildlink3.mk"
.include "../../mk/bsd.pkg.mk"
Loading

0 comments on commit 8f3089f

Please sign in to comment.