From 34dea8e38f88007799629d0a56b12dec480b1d21 Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Sun, 20 Jun 2021 14:45:01 +0100 Subject: gentoo resync : 20.06.2021 --- dev-libs/openssl/Manifest | 4 +- dev-libs/openssl/metadata.xml | 1 + dev-libs/openssl/openssl-3.0.0_beta1.ebuild | 293 ++++++++++++++++++++++++++++ 3 files changed, 297 insertions(+), 1 deletion(-) create mode 100644 dev-libs/openssl/openssl-3.0.0_beta1.ebuild (limited to 'dev-libs/openssl') diff --git a/dev-libs/openssl/Manifest b/dev-libs/openssl/Manifest index 5796f172baa3..547dc2aab168 100644 --- a/dev-libs/openssl/Manifest +++ b/dev-libs/openssl/Manifest @@ -6,6 +6,8 @@ DIST openssl-1.0.2t-bindist-1.0.tar.xz 13872 BLAKE2B b2aade96a6e0ca6209a39e205b1 DIST openssl-1.0.2u.tar.gz 5355412 BLAKE2B b2ff2a10e5851af5aca4093422a9a072c794e87b997263826c1c35910c040f695fac63decac5856cb49399ed03d410f97701d9fd4e1ebfbcacd8f3a74ce8bf57 SHA512 c455bb309e20e2c2d47fdc5619c734d107d5c8c38c1409903ce979acc120b0d5fa0312917c0aa0d630e402d092a703d4249643f36078e8528a3cafc9dac6ab32 DIST openssl-1.1.1i-bindist-1.0.tar.xz 18124 BLAKE2B bcbce700676d1d61498ac98281b7ad06f9970d91afa6bfb2c259ab7462b2554be79a1c06759bc7aaeca9948c2f5276bac2c4f42dbc6822669f863444b9913ccd SHA512 1dbb81bcb4cf7e634bb363c7e2bb2590a1fe3fcb6c3b5e377cac3c5241abd116c2a89c516be8e5fd1799ab64375a58052a4df944eeadc87b0b7785da710906d8 DIST openssl-1.1.1k.tar.gz 9823400 BLAKE2B e9bd90f17bc819c4960d07bbee04346e8a7adb87a764a09d033ef76f1d638c67b180c4f2beb84ec25fbff54ccc9c14c13b9b16a27cac231a5dd22b02635d5cec SHA512 73cd042d4056585e5a9dd7ab68e7c7310a3a4c783eafa07ab0b560e7462b924e4376436a6d38a155c687f6942a881cfc0c1b9394afcde1d8c46bf396e7d51121 +DIST openssl-3.0.0-beta1.tar.gz 14878832 BLAKE2B a2c8d8cbb226803e78ff00fcbee355f41da90275830714e8c0aea532309ef0b98c27f6796119e2942387a9e92afd917d766faac7b5ea65a36326c368790b8055 SHA512 fbb650638a7ca406b0b5d1eafcef0ca431172c8b255adaf7575325d9c1545dfdacf8e9550b8bec4e1ec73759a02c9efbd729a07e9959932564ba81be61238d5d EBUILD openssl-1.0.2u.ebuild 9895 BLAKE2B e3120c9bacee4a6cf6e00f1fdc0e480df1e28ca38c9c901d14f679a4a6a5cab074f1bdefbd9e94a28399e2ce7f14fafcc7261146a3fd95bca92427fff46ab361 SHA512 ccb2f8c173cfac5adf5aef9d61a5894168f3092f626d6e6b09cc91e29592765975eef243cd1d42b4693abbd568bc836cc875242476ab6ec00df143cfd394a080 EBUILD openssl-1.1.1k.ebuild 10292 BLAKE2B 65992f0284bae36b470dae1c979ed0cd6794d147e9c5981f43822e32be87ac4cb51db517141d20b77c5fba104a068893b838f91cefbb24e57af22d1377534c3c SHA512 cb43106f639e268230e406bba3eb0e742c8daf6bc6584faf72a7138ef82213ac92d4400360957a444d981b09edae091081a84425feb76156095d11449f4a4962 -MISC metadata.xml 1273 BLAKE2B 8eb61c2bfd56f428fa4c262972c0b140662a68c95fdf5e3101624b307985f83dc6d757fc13565e467c99188de93d90ec2db6de3719e22495da67155cbaa91aa9 SHA512 3ffb56f8bc35d71c2c67b4cb97d350825260f9d78c97f4ba9462c2b08b8ef65d7f684139e99bb2f7f32698d3cb62404567b36ce849e7dc4e7f7c5b6367c723a7 +EBUILD openssl-3.0.0_beta1.ebuild 8184 BLAKE2B 3713e504271fcf5116eb6e789deca73b54d66751d692fdbe4b441cee1f79927844701a768d978c151e133fabb211c7a1a85a8709b46945c1e5f3042153b1c5b7 SHA512 497a284458f9bd5d71048208a4a66f01b07ff83b75fddb75ddb299d0693cd32a17d6a9211238cc855a25e1dfa98db946e399376595a5ec4be29e26770fc4e910 +MISC metadata.xml 1354 BLAKE2B d18c8fdbc725d1c3dc63d7431f739267e4932a42e5a6df706abc0e77e96fee79d4b18679e52ce6f8db3afe6c33bcbc88c43b866a3136856800510abe4b359050 SHA512 15846b4760a40d2e36759c09cc00329d1cebbbdf7f7ed779fe9e9d3e81e5a1641458566baac753ad99380024056c54611502f07c6b8335f51025131060857e70 diff --git a/dev-libs/openssl/metadata.xml b/dev-libs/openssl/metadata.xml index 5ca8d93d2f67..44e5433a4857 100644 --- a/dev-libs/openssl/metadata.xml +++ b/dev-libs/openssl/metadata.xml @@ -8,6 +8,7 @@ Support assembly hand optimized crypto functions (i.e. faster run time) Disable/Restrict EC algorithms (as they seem to be patented) -- note: changes the ABI + Enable support for Kernel implementation of TLS (kTLS) Enable support for RFC 3779 (X.509 Extensions for IP Addresses and AS Identifiers) Support for the old/insecure SSLv2 protocol -- note: not required for TLS/https Support for the old/insecure SSLv3 protocol -- note: not required for TLS/https diff --git a/dev-libs/openssl/openssl-3.0.0_beta1.ebuild b/dev-libs/openssl/openssl-3.0.0_beta1.ebuild new file mode 100644 index 000000000000..f5fac82dbecb --- /dev/null +++ b/dev-libs/openssl/openssl-3.0.0_beta1.ebuild @@ -0,0 +1,293 @@ +# Copyright 1999-2021 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI="7" + +inherit flag-o-matic linux-info toolchain-funcs multilib-minimal + +MY_P=${P/_/-} + +DESCRIPTION="Robust, full-featured Open Source Toolkit for the Transport Layer Security (TLS)" +HOMEPAGE="https://www.openssl.org/" + +if [[ ${PV} == "9999" ]] ; then + EGIT_REPO_URI="https://github.com/openssl/openssl.git" + + inherit git-r3 +else + SRC_URI="mirror://openssl/source/${MY_P}.tar.gz" + #KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~x86-linux" +fi + +LICENSE="Apache-2.0" +SLOT="0/3" # .so version of libssl/libcrypto + +IUSE="+asm cpu_flags_x86_sse2 elibc_musl ktls rfc3779 sctp static-libs test vanilla zlib" +RESTRICT="!test? ( test )" + +COMMON_DEPEND=" + >=app-misc/c_rehash-1.7-r1 + zlib? ( >=sys-libs/zlib-1.2.8-r1[static-libs(+)?,${MULTILIB_USEDEP}] ) +" + +BDEPEND=" + >=dev-lang/perl-5 + dev-perl/Text-Template + sctp? ( >=net-misc/lksctp-tools-1.0.12 ) + test? ( + sys-apps/diffutils + sys-devel/bc + sys-process/procps + )" + +DEPEND="${COMMON_DEPEND}" + +RDEPEND="${COMMON_DEPEND}" + +PDEPEND="app-misc/ca-certificates" + +S="${WORKDIR}/${MY_P}" + +MULTILIB_WRAPPED_HEADERS=( + /usr/include/openssl/configuration.h +) + +pkg_setup() { + if use ktls ; then + if kernel_is -lt 4 18 ; then + ewarn "Kernel implementation of TLS (USE=ktls) requires kernel >=4.18!" + else + CONFIG_CHECK="~TLS ~TLS_DEVICE" + ERROR_TLS="You will be unable to offload TLS to kernel because CONFIG_TLS is not set!" + ERROR_TLS_DEVICE="You will be unable to offload TLS to kernel because CONFIG_TLS_DEVICE is not set!" + + linux-info_pkg_setup + fi + fi + + [[ ${MERGE_TYPE} == binary ]] && return + + # must check in pkg_setup; sysctl don't work with userpriv! + if has test ${FEATURES} && use sctp ; then + # test_ssl_new will fail with "Ensure SCTP AUTH chunks are enabled in kernel" + # if sctp.auth_enable is not enabled. + local sctp_auth_status=$(sysctl -n net.sctp.auth_enable 2>/dev/null) + if [[ -z "${sctp_auth_status}" ]] || [[ ${sctp_auth_status} != 1 ]] ; then + die "FEATURES=test with USE=sctp requires net.sctp.auth_enable=1!" + fi + fi +} + +src_prepare() { + # allow openssl to be cross-compiled + cp "${FILESDIR}"/gentoo.config-1.0.2 gentoo.config || die + chmod a+rx gentoo.config || die + + # keep this in sync with app-misc/c_rehash + SSL_CNF_DIR="/etc/ssl" + + # Make sure we only ever touch Makefile.org and avoid patching a file + # that gets blown away anyways by the Configure script in src_configure + rm -f Makefile + + if ! use vanilla ; then + if [[ $(declare -p PATCHES 2>/dev/null) == "declare -a"* ]] ; then + [[ ${#PATCHES[@]} -gt 0 ]] && eapply "${PATCHES[@]}" + fi + fi + + eapply_user + + if has test ${FEATURES} && use sctp && has network-sandbox ${FEATURES} ; then + einfo "Disabling test '80-test_ssl_new.t' which is known to fail with FEATURES=network-sandbox ..." + rm test/recipes/80-test_ssl_new.t || die + fi + + # make sure the man pages are suffixed #302165 + # don't bother building man pages if they're disabled + # Make DOCDIR Gentoo compliant + sed -i \ + -e '/^MANSUFFIX/s:=.*:=ssl:' \ + -e '/^MAKEDEPPROG/s:=.*:=$(CC):' \ + -e $(has noman FEATURES \ + && echo '/^install:/s:install_docs::' \ + || echo '/^MANDIR=/s:=.*:='${EPREFIX}'/usr/share/man:') \ + -e "/^DOCDIR/s@\$(BASENAME)@&-${PVR}@" \ + Configurations/unix-Makefile.tmpl \ + || die + + # quiet out unknown driver argument warnings since openssl + # doesn't have well-split CFLAGS and we're making it even worse + # and 'make depend' uses -Werror for added fun (#417795 again) + [[ ${CC} == *clang* ]] && append-flags -Qunused-arguments + + append-flags -fno-strict-aliasing + append-flags $(test-flags-CC -Wa,--noexecstack) + + # Prefixify Configure shebang (#141906) + sed \ + -e "1s,/usr/bin/env,${EPREFIX}&," \ + -i Configure || die + + # Remove test target when FEATURES=test isn't set + if ! use test ; then + sed \ + -e '/^$config{dirs}/s@ "test",@@' \ + -i Configure || die + fi + + # The config script does stupid stuff to prompt the user. Kill it. + sed -i '/stty -icanon min 0 time 50; read waste/d' config || die + ./config --test-sanity || die "I AM NOT SANE" + + multilib_copy_sources +} + +multilib_src_configure() { + unset APPS #197996 + unset SCRIPTS #312551 + unset CROSS_COMPILE #311473 + + tc-export CC AR RANLIB RC + + use_ssl() { usex $1 "enable-${2:-$1}" "no-${2:-$1}" " ${*:3}" ; } + echoit() { echo "$@" ; "$@" ; } + + local krb5=$(has_version app-crypt/mit-krb5 && echo "MIT" || echo "Heimdal") + + local sslout=$(./gentoo.config) + einfo "Use configuration ${sslout:-(openssl knows best)}" + local config="Configure" + [[ -z ${sslout} ]] && config="config" + + local myeconfargs=( + ${sslout} + $(use cpu_flags_x86_sse2 || echo "no-sse2") + enable-camellia + enable-ec + enable-ec2m + enable-sm2 + enable-srp + $(use elibc_musl && echo "no-async") + enable-idea + enable-mdc2 + enable-rc5 + $(use_ssl asm) + $(use_ssl ktls) + $(use_ssl rfc3779) + $(use_ssl sctp) + $(use_ssl zlib) + --prefix="${EPREFIX}"/usr + --openssldir="${EPREFIX}"${SSL_CNF_DIR} + --libdir=$(get_libdir) + shared + threads + ) + + CFLAGS= LDFLAGS= echoit \ + ./${config} \ + "${myeconfargs[@]}" \ + || die + + # Clean out hardcoded flags that openssl uses + local DEFAULT_CFLAGS=$(grep ^CFLAGS= Makefile | LC_ALL=C sed \ + -e 's:^CFLAGS=::' \ + -e 's:\(^\| \)-fomit-frame-pointer::g' \ + -e 's:\(^\| \)-O[^ ]*::g' \ + -e 's:\(^\| \)-march=[^ ]*::g' \ + -e 's:\(^\| \)-mcpu=[^ ]*::g' \ + -e 's:\(^\| \)-m[^ ]*::g' \ + -e 's:^ *::' \ + -e 's: *$::' \ + -e 's: \+: :g' \ + -e 's:\\:\\\\:g' + ) + + # Now insert clean default flags with user flags + sed -i \ + -e "/^CFLAGS=/s|=.*|=${DEFAULT_CFLAGS} ${CFLAGS}|" \ + -e "/^LDFLAGS=/s|=[[:space:]]*$|=${LDFLAGS}|" \ + Makefile \ + || die +} + +multilib_src_compile() { + # depend is needed to use $confopts; it also doesn't matter + # that it's -j1 as the code itself serializes subdirs + emake -j1 depend + emake all +} + +multilib_src_test() { + emake -j1 test +} + +multilib_src_install() { + # We need to create $ED/usr on our own to avoid a race condition #665130 + if [[ ! -d "${ED}/usr" ]] ; then + # We can only create this directory once + mkdir "${ED}"/usr || die + fi + + emake DESTDIR="${D}" install + + # This is crappy in that the static archives are still built even + # when USE=static-libs. But this is due to a failing in the openssl + # build system: the static archives are built as PIC all the time. + # Only way around this would be to manually configure+compile openssl + # twice; once with shared lib support enabled and once without. + if ! use static-libs ; then + rm "${ED}"/usr/$(get_libdir)/lib{crypto,ssl}.a || die + fi +} + +multilib_src_install_all() { + # openssl installs perl version of c_rehash by default, but + # we provide a shell version via app-misc/c_rehash + rm "${ED}"/usr/bin/c_rehash || die + + dodoc {AUTHORS,CHANGES,NEWS,README,README-PROVIDERS}.md doc/*.txt doc/${PN}-c-indent.el + + # create the certs directory + keepdir ${SSL_CNF_DIR}/certs + + # Namespace openssl programs to prevent conflicts with other man pages + cd "${ED}"/usr/share/man || die + local m d s + for m in $(find . -type f | xargs grep -L '#include') ; do + d=${m%/*} ; d=${d#./} ; m=${m##*/} + + [[ ${m} == openssl.1* ]] && continue + + [[ -n $(find -L ${d} -type l) ]] && die "erp, broken links already!" + + mv ${d}/{,ssl-}${m} || die + + # fix up references to renamed man pages + sed -i '/^[.]SH "SEE ALSO"/,/^[.]/s:\([^(, ]*(1)\):ssl-\1:g' ${d}/ssl-${m} || die + ln -s ssl-${m} ${d}/openssl-${m} || die + + # locate any symlinks that point to this man page ... + # we assume that any broken links are due to the above renaming + for s in $(find -L ${d} -type l) ; do + s=${s##*/} + rm -f ${d}/${s} + # We don't want to "|| die" here + ln -s ssl-${m} ${d}/ssl-${s} + ln -s ssl-${s} ${d}/openssl-${s} + done + done + [[ -n $(find -L ${d} -type l) ]] && die "broken manpage links found :(" + + dodir /etc/sandbox.d #254521 + echo 'SANDBOX_PREDICT="/dev/crypto"' > "${ED}"/etc/sandbox.d/10openssl + + diropts -m0700 + keepdir ${SSL_CNF_DIR}/private +} + +pkg_postinst() { + ebegin "Running 'c_rehash ${EROOT}${SSL_CNF_DIR}/certs/' to rebuild hashes #333069" + c_rehash "${EROOT}${SSL_CNF_DIR}/certs" >/dev/null + eend $? +} -- cgit v1.2.3