Gentoo Archives: gentoo-commits

From: Mike Frysinger <vapier@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-libs/openssl/, dev-libs/openssl/files/
Date: Thu, 03 Dec 2015 17:10:46
Message-Id: 1449162600.3db5c05c662167d9b25fb6d7404663a9a5138fe7.vapier@gentoo
1 commit: 3db5c05c662167d9b25fb6d7404663a9a5138fe7
2 Author: Mike Frysinger <vapier <AT> gentoo <DOT> org>
3 AuthorDate: Thu Dec 3 17:09:57 2015 +0000
4 Commit: Mike Frysinger <vapier <AT> gentoo <DOT> org>
5 CommitDate: Thu Dec 3 17:10:00 2015 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=3db5c05c
7
8 dev-libs/openssl: version bump to 0.9.8zh & 1.0.2e #567476
9
10 dev-libs/openssl/Manifest | 2 +
11 .../openssl/files/openssl-1.0.2e-pod2man.patch | 63 +++++
12 dev-libs/openssl/openssl-0.9.8z_p8.ebuild | 162 +++++++++++++
13 dev-libs/openssl/openssl-1.0.2e.ebuild | 266 +++++++++++++++++++++
14 4 files changed, 493 insertions(+)
15
16 diff --git a/dev-libs/openssl/Manifest b/dev-libs/openssl/Manifest
17 index d78f82a..2625dc8 100644
18 --- a/dev-libs/openssl/Manifest
19 +++ b/dev-libs/openssl/Manifest
20 @@ -1,7 +1,9 @@
21 DIST openssl-0.9.8zg.tar.gz 3826891 SHA256 06500060639930e471050474f537fcd28ec934af92ee282d78b52460fbe8f580 SHA512 c757454de321d168ac6d89fe2859966a9f07a8b28305bf697af9018db13fc457e0883346b3d35977461ab058442375563554ecb2a8756a687ff9fc2fdd9103c9 WHIRLPOOL 55ecf50a264a2ddd9b5755b5d90b9b736d2f27e0ba2fd529ccff3b68bbd726d1f60460182a0d215ae6712dbc4d3ef2df11339fb2d8424e049f54c3e904fcfab0
22 +DIST openssl-0.9.8zh.tar.gz 3817665 SHA256 ea1a43a47900b90e014360572d752f85617fb119fa048800872c1b37db04fad3 SHA512 dba8e9093aa8f43c9b1c2be97c505a966a8bb89d897540cec82886831000c1ef0d4146cdadcc9a8b015fd7a9d79436b2edbb166ecd4610b39fcfc0781dc54272 WHIRLPOOL 6839260c184f0cd8560fda70e15c6e45d66bdbf1bc9227457b9e082d93700b6b48dabbef3b0e3f2605008e0264177fdfd5341f20e376de61dbe55304651931ac
23 DIST openssl-1.0.1p.tar.gz 4560208 SHA256 bd5ee6803165c0fb60bbecbacacf244f1f90d2aa0d71353af610c29121e9b2f1 SHA512 64e475c53a85b78de7c5aa71a22d4bb3a456142842373ebf8f22e9857cb0352b646e591b21af866933baecdbdb5ac4a22aeb64914440c53a0f30cd25914029e5 WHIRLPOOL 2a81f3b9274e3fef37a2a88e3084d8283159b3a61db08e7805879905c87a74faa85bc6e570d18525741bd5c27c34fe09eeb58b2bfe500545d0f304716e14f819
24 DIST openssl-1.0.2a.tar.gz 5262089 SHA256 15b6393c20030aab02c8e2fe0243cb1d1d18062f6c095d67bca91871dc7f324a SHA512 02d228578824add52b73433d64697706e6503c2334933fe8dd6b477f59c430977012c3c34da207096229a425e1dcb6f3ae806043894b5ac98c27bbcddb794dd4 WHIRLPOOL a590c71794f5d29b80afa28b18621b7535e96b714b3690d793c1422a90b09a89cbcb912841d400c5982a8197bb02c13051190e96ba0e4d530509b48b43067cd7
25 DIST openssl-1.0.2b.tar.gz 5281009 SHA256 d5d488cc9f0a07974195a7427094ea3cab9800a4e90178b989aa621fbc238e3f SHA512 563eb662113668bb9ccf17a6e36697ad6392321ac1a32aa2cada9d8f4047651c2fa4da61f508ee3e1834fea343dbba189e09c1d6cabe5d1de5e3e6d022c31f4f WHIRLPOOL d828dc76842d25f02f211031b3ab9a2a8fd44975e9aaf87d0fd5fca9935a27b61c3e4f896a2186194f1a7b4d668fc48cafc5be9f7c670017ba342ce40113935f
26 DIST openssl-1.0.2c.tar.gz 5280670 SHA256 0038ba37f35a6367c58f17a7a7f687953ef8ce4f9684bbdec63e62515ed36a83 SHA512 2a68e8b017d0d3e34e4f9d33b77abd960b3d04e418f106e852684a2ff247dc8ea390b7d6a42d130fd84d821a15e84e77b68b3677433433ef5c10d156333b9dae WHIRLPOOL c59878c3bd5e8904913b97d71a15ef1eaafcfb4eb58c691ba4fb38bf81752308d0ef4a902e53aec4c6e7585677f2404d29cdea0832d14206fabf28d744af2622
27 DIST openssl-1.0.2d.tar.gz 5295447 SHA256 671c36487785628a703374c652ad2cebea45fa920ae5681515df25d9f2c9a8c8 SHA512 68a051e92aaed0e7a8b218c185427c534c32f30f50c45f5d2c1f5b7a26d1416e83863d2953c77486acde3b636a148f39faf48246d28a207607ec069f62b13d75 WHIRLPOOL e3d8f0784903c8d6aa05ada7b8b410517c99157a3c2f4ac34c8a9d80c77408bd6ff9e820ded47f6223ccac4a77413174aa625303166ec28fdbf8374a7d4659ec
28 +DIST openssl-1.0.2e.tar.gz 5255719 SHA256 eee11def03647aa2267434a779608af6fca645023c9a194ddb82f14426835537 SHA512 0c674ab90395ca28d97493dc9b99b32785b04f1ef8ed8c12122d076270de1645412003a527a3dc757ac47a9217eeceddbfbaa3b0ccd0cfd4910d254a6ca6961b WHIRLPOOL e4c16fbdf8a40fd84eb8acfa3952d5af78bca623395114420cdc6fcc7bf3bb53d5fba125e30582e2b8fefab140fe509396d5c6802ea3eadbd8266715e5fe1c67
29 DIST openssl-c_rehash.sh.1.7 4167 SHA256 4999ee79892f52bd6a4a7baba9fac62262454d573bbffd72685d3aae9e48cee0 SHA512 55e8c2e827750a4f375cb83c86bfe2d166c01ffa5d7e9b16657b72b38b747c8985dd2c98f854c911dfbbee2ff3e92aff39fdf089d979b2e3534b7685ee8b80da WHIRLPOOL c88f06a3b8651f76b6289552cccceb64e13f6697c5f0ce3ff114c781ce1c218912b8ee308af9d087cd76a9600fdacda1953175bff07d7d3eb21b0c0b7f4f1ce1
30
31 diff --git a/dev-libs/openssl/files/openssl-1.0.2e-pod2man.patch b/dev-libs/openssl/files/openssl-1.0.2e-pod2man.patch
32 new file mode 100644
33 index 0000000..076842f
34 --- /dev/null
35 +++ b/dev-libs/openssl/files/openssl-1.0.2e-pod2man.patch
36 @@ -0,0 +1,63 @@
37 +upstream removed the local pod2man logic in master, but didn't in the 1.0.2e
38 +release. yet they also dropped the pod2mantest helper in the 1.0.2e release
39 +which makes it uninstallable. backport part of the master changes.
40 +
41 +note: this is based on top of other Gentoo parallel patches
42 +
43 +From a4a934119dd213e16c9d8b11150a4815604c13bb Mon Sep 17 00:00:00 2001
44 +From: Rich Salz <rsalz@×××××××.org>
45 +Date: Wed, 10 Dec 2014 17:10:59 -0500
46 +Subject: [PATCH] Remove old private pod2man
47 +
48 +Include Richard's point to remove the 'sh -c' wrapper
49 +
50 +Reviewed-by: Richard Levitte <levitte@×××××××.org>
51 +---
52 + Makefile.org | 9 +-
53 + util/pod2man.pl | 1184 --------------------------------------------------
54 + util/pod2mantest | 58 ---
55 + util/pod2mantest.pod | 15 -
56 + 4 files changed, 4 insertions(+), 1262 deletions(-)
57 + delete mode 100755 util/pod2man.pl
58 + delete mode 100755 util/pod2mantest
59 + delete mode 100644 util/pod2mantest.pod
60 +
61 +diff --git a/Makefile.org b/Makefile.org
62 +index 8bb7e01..7c802e8 100644
63 +--- a/Makefile.org
64 ++++ b/Makefile.org
65 +@@ -716,7 +716,6 @@ install_docs:
66 + done
67 +
68 + install_docs: install_dirs
69 +- @pod2man="`cd ./util; ./pod2mantest $(PERL)`"; \
70 + here="`pwd`"; \
71 + filecase=; \
72 + case "$(PLATFORM)" in DJGPP|Cygwin*|mingw*|darwin*-*-cc) \
73 +@@ -727,9 +726,9 @@ install_docs:
74 + sec=`$(PERL) util/extract-section.pl 1 < $$i`; \
75 + echo "installing man$$sec/$$fn.$${sec}$(MANSUFFIX)"; \
76 + (cd `$(PERL) util/dirname.pl $$i`; \
77 +- sh -c "$$pod2man \
78 ++ pod2man \
79 + --section=$$sec --center=OpenSSL \
80 +- --release=$(VERSION) `basename $$i`") \
81 ++ --release=$(VERSION) `basename $$i`) \
82 + > $(INSTALL_PREFIX)$(MANDIR)/man$$sec/$$fn.$${sec}$(MANSUFFIX); \
83 + $(PERL) util/extract-names.pl < $$i | \
84 + (grep -v $$filecase "^$$fn\$$"; true) | \
85 +@@ -744,9 +743,9 @@ install_docs:
86 + sec=`$(PERL) util/extract-section.pl 3 < $$i`; \
87 + echo "installing man$$sec/$$fn.$${sec}$(MANSUFFIX)"; \
88 + (cd `$(PERL) util/dirname.pl $$i`; \
89 +- sh -c "$$pod2man \
90 ++ pod2man \
91 + --section=$$sec --center=OpenSSL \
92 +- --release=$(VERSION) `basename $$i`") \
93 ++ --release=$(VERSION) `basename $$i`) \
94 + > $(INSTALL_PREFIX)$(MANDIR)/man$$sec/$$fn.$${sec}$(MANSUFFIX); \
95 + $(PERL) util/extract-names.pl < $$i | \
96 + (grep -v $$filecase "^$$fn\$$"; true) | \
97 +--
98 +2.6.2
99 +
100
101 diff --git a/dev-libs/openssl/openssl-0.9.8z_p8.ebuild b/dev-libs/openssl/openssl-0.9.8z_p8.ebuild
102 new file mode 100644
103 index 0000000..3897edd
104 --- /dev/null
105 +++ b/dev-libs/openssl/openssl-0.9.8z_p8.ebuild
106 @@ -0,0 +1,162 @@
107 +# Copyright 1999-2015 Gentoo Foundation
108 +# Distributed under the terms of the GNU General Public License v2
109 +# $Id$
110 +
111 +# this ebuild is only for the libcrypto.so.0.9.8 and libssl.so.0.9.8 SONAME for ABI compat
112 +
113 +EAPI="5"
114 +
115 +inherit eutils flag-o-matic toolchain-funcs multilib multilib-minimal
116 +
117 +PLEVEL=$(echo "${PV##*_p}" | tr '[1-9]' '[a-i]')
118 +MY_PV=${PV/_p*/${PLEVEL}}
119 +MY_P=${PN}-${MY_PV}
120 +S="${WORKDIR}/${MY_P}"
121 +DESCRIPTION="Toolkit for SSL v2/v3 and TLS v1"
122 +HOMEPAGE="http://www.openssl.org/"
123 +SRC_URI="mirror://openssl/source/${MY_P}.tar.gz"
124 +
125 +LICENSE="openssl"
126 +SLOT="0.9.8"
127 +KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~sparc-fbsd ~x86-fbsd"
128 +IUSE="bindist gmp kerberos cpu_flags_x86_sse2 test zlib"
129 +RESTRICT="!bindist? ( bindist )"
130 +
131 +RDEPEND="gmp? ( >=dev-libs/gmp-5.1.3-r1[${MULTILIB_USEDEP}] )
132 + zlib? ( >=sys-libs/zlib-1.2.8-r1[${MULTILIB_USEDEP}] )
133 + kerberos? ( >=app-crypt/mit-krb5-1.11.4[${MULTILIB_USEDEP}] )
134 + abi_x86_32? (
135 + !<=app-emulation/emul-linux-x86-baselibs-20140508-r4
136 + !app-emulation/emul-linux-x86-baselibs[-abi_x86_32(-)]
137 + )
138 + !=dev-libs/openssl-0.9.8*:0"
139 +DEPEND="${RDEPEND}
140 + >=dev-lang/perl-5
141 + test? (
142 + sys-apps/diffutils
143 + sys-devel/bc
144 + )"
145 +
146 +# Do not install any docs
147 +DOCS=()
148 +
149 +src_prepare() {
150 + epatch "${FILESDIR}"/${PN}-0.9.8e-bsd-sparc64.patch
151 + epatch "${FILESDIR}"/${PN}-0.9.8h-ldflags.patch #181438
152 + epatch "${FILESDIR}"/${PN}-0.9.8m-binutils.patch #289130
153 +
154 + # disable fips in the build
155 + # make sure the man pages are suffixed #302165
156 + # don't bother building man pages if they're disabled
157 + sed -i \
158 + -e '/DIRS/s: fips : :g' \
159 + -e '/^MANSUFFIX/s:=.*:=ssl:' \
160 + -e '/^MAKEDEPPROG/s:=.*:=$(CC):' \
161 + -e $(has noman FEATURES \
162 + && echo '/^install:/s:install_docs::' \
163 + || echo '/^MANDIR=/s:=.*:=/usr/share/man:') \
164 + Makefile{,.org} \
165 + || die
166 + # show the actual commands in the log
167 + sed -i '/^SET_X/s:=.*:=set -x:' Makefile.shared
168 + # update the enginedir path.
169 + # punt broken config we don't care about as it fails sanity check.
170 + sed -i \
171 + -e '/^"debug-ben-debug-64"/d' \
172 + -e "/foo.*engines/s|/lib/engines|/$(get_libdir)/engines|" \
173 + Configure || die
174 +
175 + # since we're forcing $(CC) as makedep anyway, just fix
176 + # the conditional as always-on
177 + # helps clang (#417795), and versioned gcc (#499818)
178 + sed -i 's/expr.*MAKEDEPEND.*;/true;/' util/domd || die
179 +
180 + # quiet out unknown driver argument warnings since openssl
181 + # doesn't have well-split CFLAGS and we're making it even worse
182 + # and 'make depend' uses -Werror for added fun (#417795 again)
183 + [[ ${CC} == *clang* ]] && append-flags -Qunused-arguments
184 +
185 + # allow openssl to be cross-compiled
186 + cp "${FILESDIR}"/gentoo.config-0.9.8 gentoo.config || die "cp cross-compile failed"
187 + chmod a+rx gentoo.config
188 +
189 + append-flags -fno-strict-aliasing
190 + append-flags -Wa,--noexecstack
191 +
192 + sed -i '1s,^:$,#!/usr/bin/perl,' Configure #141906
193 + sed -i '/^"debug-bodo/d' Configure # 0.9.8za shipped broken
194 + ./config --test-sanity || die "I AM NOT SANE"
195 +
196 + multilib_copy_sources
197 +}
198 +
199 +multilib_src_configure() {
200 + unset APPS #197996
201 + unset SCRIPTS #312551
202 +
203 + tc-export CC AR RANLIB
204 +
205 + # Clean out patent-or-otherwise-encumbered code
206 + # Camellia: Royalty Free http://en.wikipedia.org/wiki/Camellia_(cipher)
207 + # IDEA: Expired http://en.wikipedia.org/wiki/International_Data_Encryption_Algorithm
208 + # EC: ????????? ??/??/2015 http://en.wikipedia.org/wiki/Elliptic_Curve_Cryptography
209 + # MDC2: Expired http://en.wikipedia.org/wiki/MDC-2
210 + # RC5: 5,724,428 03/03/2015 http://en.wikipedia.org/wiki/RC5
211 +
212 + use_ssl() { use $1 && echo "enable-${2:-$1} ${*:3}" || echo "no-${2:-$1}" ; }
213 + echoit() { echo "$@" ; "$@" ; }
214 +
215 + local krb5=$(has_version app-crypt/mit-krb5 && echo "MIT" || echo "Heimdal")
216 +
217 + local sslout=$(./gentoo.config)
218 + einfo "Use configuration ${sslout:-(openssl knows best)}"
219 + local config="Configure"
220 + [[ -z ${sslout} ]] && config="config"
221 +
222 + echoit \
223 + ./${config} \
224 + ${sslout} \
225 + $(use cpu_flags_x86_sse2 || echo "no-sse2") \
226 + enable-camellia \
227 + $(use_ssl !bindist ec) \
228 + enable-idea \
229 + enable-mdc2 \
230 + $(use_ssl !bindist rc5) \
231 + enable-tlsext \
232 + $(use_ssl gmp gmp -lgmp) \
233 + $(use_ssl kerberos krb5 --with-krb5-flavor=${krb5}) \
234 + $(use_ssl zlib) \
235 + --prefix=/usr \
236 + --openssldir=/etc/ssl \
237 + shared threads \
238 + || die "Configure failed"
239 +
240 + # Clean out hardcoded flags that openssl uses
241 + local CFLAG=$(grep ^CFLAG= Makefile | LC_ALL=C sed \
242 + -e 's:^CFLAG=::' \
243 + -e 's:-fomit-frame-pointer ::g' \
244 + -e 's:-O[0-9] ::g' \
245 + -e 's:-march=[-a-z0-9]* ::g' \
246 + -e 's:-mcpu=[-a-z0-9]* ::g' \
247 + -e 's:-m[a-z0-9]* ::g' \
248 + )
249 + sed -i \
250 + -e "/^LIBDIR=/s|=.*|=$(get_libdir)|" \
251 + -e "/^CFLAG/s|=.*|=${CFLAG} ${CFLAGS}|" \
252 + -e "/^SHARED_LDFLAGS=/s|$| ${LDFLAGS}|" \
253 + Makefile || die
254 +}
255 +
256 +multilib_src_compile() {
257 + # depend is needed to use $confopts
258 + emake -j1 depend
259 + emake -j1 build_libs
260 +}
261 +
262 +multilib_src_test() {
263 + emake -j1 test
264 +}
265 +
266 +multilib_src_install() {
267 + dolib.so lib{crypto,ssl}.so.0.9.8
268 +}
269
270 diff --git a/dev-libs/openssl/openssl-1.0.2e.ebuild b/dev-libs/openssl/openssl-1.0.2e.ebuild
271 new file mode 100644
272 index 0000000..1249476
273 --- /dev/null
274 +++ b/dev-libs/openssl/openssl-1.0.2e.ebuild
275 @@ -0,0 +1,266 @@
276 +# Copyright 1999-2015 Gentoo Foundation
277 +# Distributed under the terms of the GNU General Public License v2
278 +# $Id$
279 +
280 +EAPI="4"
281 +
282 +inherit eutils flag-o-matic toolchain-funcs multilib multilib-minimal
283 +
284 +MY_P=${P/_/-}
285 +DESCRIPTION="full-strength general purpose cryptography library (including SSL and TLS)"
286 +HOMEPAGE="http://www.openssl.org/"
287 +SRC_URI="mirror://openssl/source/${MY_P}.tar.gz"
288 +
289 +LICENSE="openssl"
290 +SLOT="0"
291 +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~arm-linux ~x86-linux"
292 +IUSE="+asm bindist gmp kerberos rfc3779 sctp cpu_flags_x86_sse2 static-libs test +tls-heartbeat vanilla zlib"
293 +RESTRICT="!bindist? ( bindist )"
294 +
295 +# The blocks are temporary just to make sure people upgrade to a
296 +# version that lack runtime version checking. We'll drop them in
297 +# the future.
298 +RDEPEND=">=app-misc/c_rehash-1.7-r1
299 + gmp? ( >=dev-libs/gmp-5.1.3-r1[static-libs(+)?,${MULTILIB_USEDEP}] )
300 + zlib? ( >=sys-libs/zlib-1.2.8-r1[static-libs(+)?,${MULTILIB_USEDEP}] )
301 + kerberos? ( >=app-crypt/mit-krb5-1.11.4[${MULTILIB_USEDEP}] )
302 + abi_x86_32? (
303 + !<=app-emulation/emul-linux-x86-baselibs-20140508
304 + !app-emulation/emul-linux-x86-baselibs[-abi_x86_32(-)]
305 + )
306 + !<net-misc/openssh-5.9_p1-r4
307 + !<net-libs/neon-0.29.6-r1"
308 +DEPEND="${RDEPEND}
309 + >=dev-lang/perl-5
310 + sctp? ( >=net-misc/lksctp-tools-1.0.12 )
311 + test? (
312 + sys-apps/diffutils
313 + sys-devel/bc
314 + )"
315 +PDEPEND="app-misc/ca-certificates"
316 +
317 +S="${WORKDIR}/${MY_P}"
318 +
319 +MULTILIB_WRAPPED_HEADERS=(
320 + usr/include/openssl/opensslconf.h
321 +)
322 +
323 +src_prepare() {
324 + # keep this in sync with app-misc/c_rehash
325 + SSL_CNF_DIR="/etc/ssl"
326 +
327 + # Make sure we only ever touch Makefile.org and avoid patching a file
328 + # that gets blown away anyways by the Configure script in src_configure
329 + rm -f Makefile
330 +
331 + if ! use vanilla ; then
332 + epatch "${FILESDIR}"/${PN}-1.0.0a-ldflags.patch #327421
333 + epatch "${FILESDIR}"/${PN}-1.0.0d-windres.patch #373743
334 + epatch "${FILESDIR}"/${PN}-1.0.2d-parallel-build.patch
335 + epatch "${FILESDIR}"/${PN}-1.0.2a-parallel-obj-headers.patch
336 + epatch "${FILESDIR}"/${PN}-1.0.2a-parallel-install-dirs.patch
337 + epatch "${FILESDIR}"/${PN}-1.0.2a-parallel-symlinking.patch #545028
338 + epatch "${FILESDIR}"/${PN}-1.0.2-ipv6.patch
339 + epatch "${FILESDIR}"/${PN}-1.0.2a-x32-asm.patch #542618
340 + epatch "${FILESDIR}"/${PN}-1.0.1p-default-source.patch #554338
341 + epatch "${FILESDIR}"/${PN}-1.0.2e-pod2man.patch
342 +
343 + epatch_user #332661
344 + fi
345 +
346 + # disable fips in the build
347 + # make sure the man pages are suffixed #302165
348 + # don't bother building man pages if they're disabled
349 + sed -i \
350 + -e '/DIRS/s: fips : :g' \
351 + -e '/^MANSUFFIX/s:=.*:=ssl:' \
352 + -e '/^MAKEDEPPROG/s:=.*:=$(CC):' \
353 + -e $(has noman FEATURES \
354 + && echo '/^install:/s:install_docs::' \
355 + || echo '/^MANDIR=/s:=.*:='${EPREFIX}'/usr/share/man:') \
356 + Makefile.org \
357 + || die
358 + # show the actual commands in the log
359 + sed -i '/^SET_X/s:=.*:=set -x:' Makefile.shared
360 +
361 + # since we're forcing $(CC) as makedep anyway, just fix
362 + # the conditional as always-on
363 + # helps clang (#417795), and versioned gcc (#499818)
364 + sed -i 's/expr.*MAKEDEPEND.*;/true;/' util/domd || die
365 +
366 + # quiet out unknown driver argument warnings since openssl
367 + # doesn't have well-split CFLAGS and we're making it even worse
368 + # and 'make depend' uses -Werror for added fun (#417795 again)
369 + [[ ${CC} == *clang* ]] && append-flags -Qunused-arguments
370 +
371 + # allow openssl to be cross-compiled
372 + cp "${FILESDIR}"/gentoo.config-1.0.2 gentoo.config || die
373 + chmod a+rx gentoo.config
374 +
375 + append-flags -fno-strict-aliasing
376 + append-flags $(test-flags-CC -Wa,--noexecstack)
377 + append-cppflags -DOPENSSL_NO_BUF_FREELISTS
378 +
379 + sed -i '1s,^:$,#!'${EPREFIX}'/usr/bin/perl,' Configure #141906
380 + # The config script does stupid stuff to prompt the user. Kill it.
381 + sed -i '/stty -icanon min 0 time 50; read waste/d' config || die
382 + ./config --test-sanity || die "I AM NOT SANE"
383 +
384 + multilib_copy_sources
385 +}
386 +
387 +multilib_src_configure() {
388 + unset APPS #197996
389 + unset SCRIPTS #312551
390 + unset CROSS_COMPILE #311473
391 +
392 + tc-export CC AR RANLIB RC
393 +
394 + # Clean out patent-or-otherwise-encumbered code
395 + # Camellia: Royalty Free http://en.wikipedia.org/wiki/Camellia_(cipher)
396 + # IDEA: Expired http://en.wikipedia.org/wiki/International_Data_Encryption_Algorithm
397 + # EC: ????????? ??/??/2015 http://en.wikipedia.org/wiki/Elliptic_Curve_Cryptography
398 + # MDC2: Expired http://en.wikipedia.org/wiki/MDC-2
399 + # RC5: Expired http://en.wikipedia.org/wiki/RC5
400 +
401 + use_ssl() { usex $1 "enable-${2:-$1}" "no-${2:-$1}" " ${*:3}" ; }
402 + echoit() { echo "$@" ; "$@" ; }
403 +
404 + local krb5=$(has_version app-crypt/mit-krb5 && echo "MIT" || echo "Heimdal")
405 +
406 + # See if our toolchain supports __uint128_t. If so, it's 64bit
407 + # friendly and can use the nicely optimized code paths. #460790
408 + local ec_nistp_64_gcc_128
409 + # Disable it for now though #469976
410 + #if ! use bindist ; then
411 + # echo "__uint128_t i;" > "${T}"/128.c
412 + # if ${CC} ${CFLAGS} -c "${T}"/128.c -o /dev/null >&/dev/null ; then
413 + # ec_nistp_64_gcc_128="enable-ec_nistp_64_gcc_128"
414 + # fi
415 + #fi
416 +
417 + local sslout=$(./gentoo.config)
418 + einfo "Use configuration ${sslout:-(openssl knows best)}"
419 + local config="Configure"
420 + [[ -z ${sslout} ]] && config="config"
421 +
422 + echoit \
423 + ./${config} \
424 + ${sslout} \
425 + $(use cpu_flags_x86_sse2 || echo "no-sse2") \
426 + enable-camellia \
427 + $(use_ssl !bindist ec) \
428 + ${ec_nistp_64_gcc_128} \
429 + enable-idea \
430 + enable-mdc2 \
431 + enable-rc5 \
432 + enable-tlsext \
433 + $(use_ssl asm) \
434 + $(use_ssl gmp gmp -lgmp) \
435 + $(use_ssl kerberos krb5 --with-krb5-flavor=${krb5}) \
436 + $(use_ssl rfc3779) \
437 + $(use_ssl sctp) \
438 + $(use_ssl tls-heartbeat heartbeats) \
439 + $(use_ssl zlib) \
440 + --prefix="${EPREFIX}"/usr \
441 + --openssldir="${EPREFIX}"${SSL_CNF_DIR} \
442 + --libdir=$(get_libdir) \
443 + shared threads \
444 + || die
445 +
446 + # Clean out hardcoded flags that openssl uses
447 + local CFLAG=$(grep ^CFLAG= Makefile | LC_ALL=C sed \
448 + -e 's:^CFLAG=::' \
449 + -e 's:-fomit-frame-pointer ::g' \
450 + -e 's:-O[0-9] ::g' \
451 + -e 's:-march=[-a-z0-9]* ::g' \
452 + -e 's:-mcpu=[-a-z0-9]* ::g' \
453 + -e 's:-m[a-z0-9]* ::g' \
454 + )
455 + sed -i \
456 + -e "/^CFLAG/s|=.*|=${CFLAG} ${CFLAGS}|" \
457 + -e "/^SHARED_LDFLAGS=/s|$| ${LDFLAGS}|" \
458 + Makefile || die
459 +}
460 +
461 +multilib_src_compile() {
462 + # depend is needed to use $confopts; it also doesn't matter
463 + # that it's -j1 as the code itself serializes subdirs
464 + emake -j1 depend
465 + emake all
466 + # rehash is needed to prep the certs/ dir; do this
467 + # separately to avoid parallel build issues.
468 + emake rehash
469 +}
470 +
471 +multilib_src_test() {
472 + emake -j1 test
473 +}
474 +
475 +multilib_src_install() {
476 + emake INSTALL_PREFIX="${D}" install
477 +}
478 +
479 +multilib_src_install_all() {
480 + # openssl installs perl version of c_rehash by default, but
481 + # we provide a shell version via app-misc/c_rehash
482 + rm "${ED}"/usr/bin/c_rehash || die
483 +
484 + dodoc CHANGES* FAQ NEWS README doc/*.txt doc/c-indentation.el
485 + dohtml -r doc/*
486 + use rfc3779 && dodoc engines/ccgost/README.gost
487 +
488 + # This is crappy in that the static archives are still built even
489 + # when USE=static-libs. But this is due to a failing in the openssl
490 + # build system: the static archives are built as PIC all the time.
491 + # Only way around this would be to manually configure+compile openssl
492 + # twice; once with shared lib support enabled and once without.
493 + use static-libs || rm -f "${ED}"/usr/lib*/lib*.a
494 +
495 + # create the certs directory
496 + dodir ${SSL_CNF_DIR}/certs
497 + cp -RP certs/* "${ED}"${SSL_CNF_DIR}/certs/ || die
498 + rm -r "${ED}"${SSL_CNF_DIR}/certs/{demo,expired}
499 +
500 + # Namespace openssl programs to prevent conflicts with other man pages
501 + cd "${ED}"/usr/share/man
502 + local m d s
503 + for m in $(find . -type f | xargs grep -L '#include') ; do
504 + d=${m%/*} ; d=${d#./} ; m=${m##*/}
505 + [[ ${m} == openssl.1* ]] && continue
506 + [[ -n $(find -L ${d} -type l) ]] && die "erp, broken links already!"
507 + mv ${d}/{,ssl-}${m}
508 + # fix up references to renamed man pages
509 + sed -i '/^[.]SH "SEE ALSO"/,/^[.]/s:\([^(, ]*(1)\):ssl-\1:g' ${d}/ssl-${m}
510 + ln -s ssl-${m} ${d}/openssl-${m}
511 + # locate any symlinks that point to this man page ... we assume
512 + # that any broken links are due to the above renaming
513 + for s in $(find -L ${d} -type l) ; do
514 + s=${s##*/}
515 + rm -f ${d}/${s}
516 + ln -s ssl-${m} ${d}/ssl-${s}
517 + ln -s ssl-${s} ${d}/openssl-${s}
518 + done
519 + done
520 + [[ -n $(find -L ${d} -type l) ]] && die "broken manpage links found :("
521 +
522 + dodir /etc/sandbox.d #254521
523 + echo 'SANDBOX_PREDICT="/dev/crypto"' > "${ED}"/etc/sandbox.d/10openssl
524 +
525 + diropts -m0700
526 + keepdir ${SSL_CNF_DIR}/private
527 +}
528 +
529 +pkg_preinst() {
530 + has_version ${CATEGORY}/${PN}:0.9.8 && return 0
531 + preserve_old_lib /usr/$(get_libdir)/lib{crypto,ssl}.so.0.9.8
532 +}
533 +
534 +pkg_postinst() {
535 + ebegin "Running 'c_rehash ${EROOT%/}${SSL_CNF_DIR}/certs/' to rebuild hashes #333069"
536 + c_rehash "${EROOT%/}${SSL_CNF_DIR}/certs" >/dev/null
537 + eend $?
538 +
539 + has_version ${CATEGORY}/${PN}:0.9.8 && return 0
540 + preserve_old_lib_notify /usr/$(get_libdir)/lib{crypto,ssl}.so.0.9.8
541 +}