Gentoo Archives: gentoo-commits

From: Mikle Kolyada <zlogene@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-libs/openssl/
Date: Sun, 09 Sep 2018 11:56:37
Message-Id: 1536494169.d9fd788b33ff7e760b2ed4762a94cf587f0c5701.zlogene@gentoo
1 commit: d9fd788b33ff7e760b2ed4762a94cf587f0c5701
2 Author: Mikle Kolyada <zlogene <AT> gentoo <DOT> org>
3 AuthorDate: Sun Sep 9 11:56:09 2018 +0000
4 Commit: Mikle Kolyada <zlogene <AT> gentoo <DOT> org>
5 CommitDate: Sun Sep 9 11:56:09 2018 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d9fd788b
7
8 dev-libs/openssl: Drop old
9
10 Package-Manager: Portage-2.3.40, Repoman-2.3.9
11
12 dev-libs/openssl/Manifest | 5 -
13 dev-libs/openssl/openssl-1.0.2o-r3.ebuild | 252 -------------------------
14 dev-libs/openssl/openssl-1.0.2o-r6.ebuild | 297 ------------------------------
15 3 files changed, 554 deletions(-)
16
17 diff --git a/dev-libs/openssl/Manifest b/dev-libs/openssl/Manifest
18 index 6486f149bc2..ba5fdcfbf60 100644
19 --- a/dev-libs/openssl/Manifest
20 +++ b/dev-libs/openssl/Manifest
21 @@ -1,10 +1,5 @@
22 DIST openssl-0.9.8zh.tar.gz 3818524 BLAKE2B 610bb4858900983cf4519fa8b63f1e03b3845e39e68884fd8bebd738cd5cd6c2c75513643af49bf9e2294adc446a6516480fe9b62de55d9b6379bf9e7c5cd364 SHA512 b97fa2468211f86c0719c68ad1781eff84f772c479ed5193d6da14bac086b4ca706e7d851209d9df3f0962943b5e5333ab0def00110fb2e517caa73c0c6674c6
23 -DIST openssl-1.0.2-patches-1.4.tar.xz 12864 BLAKE2B ace6a782ef97b61af44988f978d089adffb06894617f9d66d3fce664c04d360b2774e1dd38c2171151fa93fe92428d405674bc2d452d520f10da426f95d09aee SHA512 d152af2841f1bf11c7f2a5ebba9a2b903fb4bcdef0468c56af0f9cc8c020adbf4490ac1a62f5bae8cbe18e379934fa997bfda1c2d49ec62365c07a0c0515a72d
24 DIST openssl-1.0.2-patches-1.5.tar.xz 12404 BLAKE2B 6c1b8c28f339f539b2ab8643379502a24cf62bffde00041dce54d5dd9e8d2620b181362ee5464b0ab32ba4948e209697bfabadbea2944a409a1009100d298f24 SHA512 5725e2d9d1ee8cc074bcef3bed61c71bdab2ff1c114362110c3fb8da11ad5bc8f2ff28e90a293f5f3a5cf96ecda54dffdb7ab3fb3f8b23ef6472250dc3037659
25 -DIST openssl-1.0.2o.tar.gz 5329472 BLAKE2B 30226db49be04317da3a76cce68d5aa401decd198f92505bddb0c72a7ef6a79f3c9c06d4a816db734e2a0991ebcab8b207feced26d83639e50c821d9e76ddc45 SHA512 8a2c93657c85143e76785bb32ee836908c31a6f5f8db993fa9777acba6079e630cdddd03edbad65d1587199fc13a1507789eacf038b56eb99139c2091d9df7fd
26 -DIST openssl-1.0.2o_ec_curve.c 17254 BLAKE2B d40d8d6e770443f07abe70e2c4ddda6aec1cc8e37dc1f226a3fdd9ed5d228f09c6d372e8956b1948b55ee1d57d1429493e7288d0f54d9466a37fec805c85aacb SHA512 8e92fb100bcf4bd918c82b9a6cbd75a55abe1a2c08230a007e441c51577f974f8cc336e9ac8a672b32641480428ca8cead5380da1fe81bacb088145a1b754a15
27 -DIST openssl-1.0.2o_ectest.c 30735 BLAKE2B 95333a27f1cf0a4305a3cee7f6d46b9d4673582ca9acfcf5ba2a0d9d317ab6219cd0d2ff0ba3a55a317c8f5819342f05cc17ba80ec2c92b2b4cab9a3552382e1 SHA512 f2e4d34327b490bc8371f0845c69df3f9fc51ea16f0ea0de0411a0c1fa9d49bb2b6fafc363eb3b3cd919dc7c24e4a0d075c6ff878c01d70dae918f2540874c19
28 -DIST openssl-1.0.2o_hobble-openssl 1302 BLAKE2B 647caa6a0f4c53a2e77baa3b8e5961eaef3bb0ff38e7d5475eab8deef3439f7fe49028ec9ed0406f3453870b62cac67c496b3a048ee4c9ff4c6866d520235960 SHA512 3d757a4708e74a03dd5cb9b8114dfe442ed9520739a6eca693be4c4265771696f1449ea06d1c9bcfc6e94fc9b0dd0c10e153f1c3b0334831c0550b36cd63326e
29 DIST openssl-1.0.2p.tar.gz 5338192 BLAKE2B fe4c0e2bf75d47a76e7377c7977be7bcaaa532061ab89ee989786eeb6495295711a29a88bf026c85d9ed55c97e71b0e9c8cf4c29b6e58a3dc56bcff518666823 SHA512 958c5a7c3324bbdc8f07dfb13e11329d9a1b4452c07cf41fbd2d42b5fe29c95679332a3476d24c2dc2b88be16e4a24744aba675a05a388c0905756c77a8a2f16
30 DIST openssl-1.0.2p_ec_curve.c 17254 BLAKE2B d40d8d6e770443f07abe70e2c4ddda6aec1cc8e37dc1f226a3fdd9ed5d228f09c6d372e8956b1948b55ee1d57d1429493e7288d0f54d9466a37fec805c85aacb SHA512 8e92fb100bcf4bd918c82b9a6cbd75a55abe1a2c08230a007e441c51577f974f8cc336e9ac8a672b32641480428ca8cead5380da1fe81bacb088145a1b754a15
31 DIST openssl-1.0.2p_ectest.c 30735 BLAKE2B 95333a27f1cf0a4305a3cee7f6d46b9d4673582ca9acfcf5ba2a0d9d317ab6219cd0d2ff0ba3a55a317c8f5819342f05cc17ba80ec2c92b2b4cab9a3552382e1 SHA512 f2e4d34327b490bc8371f0845c69df3f9fc51ea16f0ea0de0411a0c1fa9d49bb2b6fafc363eb3b3cd919dc7c24e4a0d075c6ff878c01d70dae918f2540874c19
32
33 diff --git a/dev-libs/openssl/openssl-1.0.2o-r3.ebuild b/dev-libs/openssl/openssl-1.0.2o-r3.ebuild
34 deleted file mode 100644
35 index f372f86e99c..00000000000
36 --- a/dev-libs/openssl/openssl-1.0.2o-r3.ebuild
37 +++ /dev/null
38 @@ -1,252 +0,0 @@
39 -# Copyright 1999-2018 Gentoo Foundation
40 -# Distributed under the terms of the GNU General Public License v2
41 -
42 -EAPI="6"
43 -
44 -inherit eutils flag-o-matic toolchain-funcs multilib multilib-minimal
45 -
46 -PATCH_SET="openssl-1.0.2-patches-1.4"
47 -MY_P=${P/_/-}
48 -DESCRIPTION="full-strength general purpose cryptography library (including SSL and TLS)"
49 -HOMEPAGE="https://www.openssl.org/"
50 -SRC_URI="mirror://openssl/source/${MY_P}.tar.gz
51 - mirror://gentoo/${PATCH_SET}.tar.xz
52 - https://dev.gentoo.org/~whissi/dist/${PN}/${PATCH_SET}.tar.xz
53 - https://dev.gentoo.org/~polynomial-c/dist/${PATCH_SET}.tar.xz"
54 -
55 -LICENSE="openssl"
56 -SLOT="0"
57 -KEYWORDS="alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~amd64-fbsd ~x86-fbsd ~x86-linux"
58 -IUSE="+asm bindist gmp kerberos rfc3779 sctp cpu_flags_x86_sse2 sslv2 +sslv3 static-libs test +tls-heartbeat vanilla zlib"
59 -RESTRICT="!bindist? ( bindist )"
60 -
61 -RDEPEND=">=app-misc/c_rehash-1.7-r1
62 - gmp? ( >=dev-libs/gmp-5.1.3-r1[static-libs(+)?,${MULTILIB_USEDEP}] )
63 - zlib? ( >=sys-libs/zlib-1.2.8-r1[static-libs(+)?,${MULTILIB_USEDEP}] )
64 - kerberos? ( >=app-crypt/mit-krb5-1.11.4[${MULTILIB_USEDEP}] )"
65 -DEPEND="${RDEPEND}
66 - >=dev-lang/perl-5
67 - sctp? ( >=net-misc/lksctp-tools-1.0.12 )
68 - test? (
69 - sys-apps/diffutils
70 - sys-devel/bc
71 - )"
72 -PDEPEND="app-misc/ca-certificates"
73 -
74 -S="${WORKDIR}/${MY_P}"
75 -
76 -MULTILIB_WRAPPED_HEADERS=(
77 - usr/include/openssl/opensslconf.h
78 -)
79 -
80 -src_prepare() {
81 - # keep this in sync with app-misc/c_rehash
82 - SSL_CNF_DIR="/etc/ssl"
83 -
84 - # Make sure we only ever touch Makefile.org and avoid patching a file
85 - # that gets blown away anyways by the Configure script in src_configure
86 - rm -f Makefile
87 -
88 - if ! use vanilla ; then
89 - eapply "${WORKDIR}"/patch/*.patch
90 - fi
91 -
92 - eapply_user
93 -
94 - # disable fips in the build
95 - # make sure the man pages are suffixed #302165
96 - # don't bother building man pages if they're disabled
97 - sed -i \
98 - -e '/DIRS/s: fips : :g' \
99 - -e '/^MANSUFFIX/s:=.*:=ssl:' \
100 - -e '/^MAKEDEPPROG/s:=.*:=$(CC):' \
101 - -e $(has noman FEATURES \
102 - && echo '/^install:/s:install_docs::' \
103 - || echo '/^MANDIR=/s:=.*:='${EPREFIX}'/usr/share/man:') \
104 - Makefile.org \
105 - || die
106 - # show the actual commands in the log
107 - sed -i '/^SET_X/s:=.*:=set -x:' Makefile.shared
108 -
109 - # since we're forcing $(CC) as makedep anyway, just fix
110 - # the conditional as always-on
111 - # helps clang (#417795), and versioned gcc (#499818)
112 - sed -i 's/expr.*MAKEDEPEND.*;/true;/' util/domd || die
113 -
114 - # quiet out unknown driver argument warnings since openssl
115 - # doesn't have well-split CFLAGS and we're making it even worse
116 - # and 'make depend' uses -Werror for added fun (#417795 again)
117 - [[ ${CC} == *clang* ]] && append-flags -Qunused-arguments
118 -
119 - # allow openssl to be cross-compiled
120 - cp "${FILESDIR}"/gentoo.config-1.0.2 gentoo.config || die
121 - chmod a+rx gentoo.config || die
122 -
123 - append-flags -fno-strict-aliasing
124 - append-flags $(test-flags-CC -Wa,--noexecstack)
125 - append-cppflags -DOPENSSL_NO_BUF_FREELISTS
126 -
127 - sed -i '1s,^:$,#!'${EPREFIX}'/usr/bin/perl,' Configure #141906
128 - # The config script does stupid stuff to prompt the user. Kill it.
129 - sed -i '/stty -icanon min 0 time 50; read waste/d' config || die
130 - ./config --test-sanity || die "I AM NOT SANE"
131 -
132 - multilib_copy_sources
133 -}
134 -
135 -multilib_src_configure() {
136 - unset APPS #197996
137 - unset SCRIPTS #312551
138 - unset CROSS_COMPILE #311473
139 -
140 - tc-export CC AR RANLIB RC
141 -
142 - # Clean out patent-or-otherwise-encumbered code
143 - # Camellia: Royalty Free https://en.wikipedia.org/wiki/Camellia_(cipher)
144 - # IDEA: Expired https://en.wikipedia.org/wiki/International_Data_Encryption_Algorithm
145 - # EC: ????????? ??/??/2015 https://en.wikipedia.org/wiki/Elliptic_Curve_Cryptography
146 - # MDC2: Expired https://en.wikipedia.org/wiki/MDC-2
147 - # RC5: Expired https://en.wikipedia.org/wiki/RC5
148 -
149 - use_ssl() { usex $1 "enable-${2:-$1}" "no-${2:-$1}" " ${*:3}" ; }
150 - echoit() { echo "$@" ; "$@" ; }
151 -
152 - local krb5=$(has_version app-crypt/mit-krb5 && echo "MIT" || echo "Heimdal")
153 -
154 - # See if our toolchain supports __uint128_t. If so, it's 64bit
155 - # friendly and can use the nicely optimized code paths. #460790
156 - local ec_nistp_64_gcc_128
157 - # Disable it for now though #469976
158 - #if ! use bindist ; then
159 - # echo "__uint128_t i;" > "${T}"/128.c
160 - # if ${CC} ${CFLAGS} -c "${T}"/128.c -o /dev/null >&/dev/null ; then
161 - # ec_nistp_64_gcc_128="enable-ec_nistp_64_gcc_128"
162 - # fi
163 - #fi
164 -
165 - # https://github.com/openssl/openssl/issues/2286
166 - if use ia64 ; then
167 - replace-flags -g3 -g2
168 - replace-flags -ggdb3 -ggdb2
169 - fi
170 -
171 - local sslout=$(./gentoo.config)
172 - einfo "Use configuration ${sslout:-(openssl knows best)}"
173 - local config="Configure"
174 - [[ -z ${sslout} ]] && config="config"
175 -
176 - echoit \
177 - ./${config} \
178 - ${sslout} \
179 - $(use cpu_flags_x86_sse2 || echo "no-sse2") \
180 - enable-camellia \
181 - $(use_ssl !bindist ec) \
182 - ${ec_nistp_64_gcc_128} \
183 - enable-idea \
184 - enable-mdc2 \
185 - enable-rc5 \
186 - enable-tlsext \
187 - $(use_ssl asm) \
188 - $(use_ssl gmp gmp -lgmp) \
189 - $(use_ssl kerberos krb5 --with-krb5-flavor=${krb5}) \
190 - $(use_ssl rfc3779) \
191 - $(use_ssl sctp) \
192 - $(use_ssl sslv2 ssl2) \
193 - $(use_ssl sslv3 ssl3) \
194 - $(use_ssl tls-heartbeat heartbeats) \
195 - $(use_ssl zlib) \
196 - --prefix="${EPREFIX}"/usr \
197 - --openssldir="${EPREFIX}"${SSL_CNF_DIR} \
198 - --libdir=$(get_libdir) \
199 - shared threads \
200 - || die
201 -
202 - # Clean out hardcoded flags that openssl uses
203 - local CFLAG=$(grep ^CFLAG= Makefile | LC_ALL=C sed \
204 - -e 's:^CFLAG=::' \
205 - -e 's:-fomit-frame-pointer ::g' \
206 - -e 's:-O[0-9] ::g' \
207 - -e 's:-march=[-a-z0-9]* ::g' \
208 - -e 's:-mcpu=[-a-z0-9]* ::g' \
209 - -e 's:-m[a-z0-9]* ::g' \
210 - )
211 - sed -i \
212 - -e "/^CFLAG/s|=.*|=${CFLAG} ${CFLAGS}|" \
213 - -e "/^SHARED_LDFLAGS=/s|$| ${LDFLAGS}|" \
214 - Makefile || die
215 -}
216 -
217 -multilib_src_compile() {
218 - # depend is needed to use $confopts; it also doesn't matter
219 - # that it's -j1 as the code itself serializes subdirs
220 - emake -j1 depend
221 - emake all
222 - # rehash is needed to prep the certs/ dir; do this
223 - # separately to avoid parallel build issues.
224 - emake rehash
225 -}
226 -
227 -multilib_src_test() {
228 - emake -j1 test
229 -}
230 -
231 -multilib_src_install() {
232 - emake INSTALL_PREFIX="${D}" install
233 -}
234 -
235 -multilib_src_install_all() {
236 - # openssl installs perl version of c_rehash by default, but
237 - # we provide a shell version via app-misc/c_rehash
238 - rm "${ED}"/usr/bin/c_rehash || die
239 -
240 - local -a DOCS=( CHANGES* FAQ NEWS README doc/*.txt doc/c-indentation.el )
241 - einstalldocs
242 -
243 - use rfc3779 && dodoc engines/ccgost/README.gost
244 -
245 - # This is crappy in that the static archives are still built even
246 - # when USE=static-libs. But this is due to a failing in the openssl
247 - # build system: the static archives are built as PIC all the time.
248 - # Only way around this would be to manually configure+compile openssl
249 - # twice; once with shared lib support enabled and once without.
250 - use static-libs || rm -f "${ED}"/usr/lib*/lib*.a
251 -
252 - # create the certs directory
253 - dodir ${SSL_CNF_DIR}/certs
254 - cp -RP certs/* "${ED}"${SSL_CNF_DIR}/certs/ || die
255 - rm -r "${ED}"${SSL_CNF_DIR}/certs/{demo,expired}
256 -
257 - # Namespace openssl programs to prevent conflicts with other man pages
258 - cd "${ED}"/usr/share/man
259 - local m d s
260 - for m in $(find . -type f | xargs grep -L '#include') ; do
261 - d=${m%/*} ; d=${d#./} ; m=${m##*/}
262 - [[ ${m} == openssl.1* ]] && continue
263 - [[ -n $(find -L ${d} -type l) ]] && die "erp, broken links already!"
264 - mv ${d}/{,ssl-}${m}
265 - # fix up references to renamed man pages
266 - sed -i '/^[.]SH "SEE ALSO"/,/^[.]/s:\([^(, ]*(1)\):ssl-\1:g' ${d}/ssl-${m}
267 - ln -s ssl-${m} ${d}/openssl-${m}
268 - # locate any symlinks that point to this man page ... we assume
269 - # that any broken links are due to the above renaming
270 - for s in $(find -L ${d} -type l) ; do
271 - s=${s##*/}
272 - rm -f ${d}/${s}
273 - ln -s ssl-${m} ${d}/ssl-${s}
274 - ln -s ssl-${s} ${d}/openssl-${s}
275 - done
276 - done
277 - [[ -n $(find -L ${d} -type l) ]] && die "broken manpage links found :("
278 -
279 - dodir /etc/sandbox.d #254521
280 - echo 'SANDBOX_PREDICT="/dev/crypto"' > "${ED}"/etc/sandbox.d/10openssl
281 -
282 - diropts -m0700
283 - keepdir ${SSL_CNF_DIR}/private
284 -}
285 -
286 -pkg_postinst() {
287 - ebegin "Running 'c_rehash ${EROOT%/}${SSL_CNF_DIR}/certs/' to rebuild hashes #333069"
288 - c_rehash "${EROOT%/}${SSL_CNF_DIR}/certs" >/dev/null
289 - eend $?
290 -}
291
292 diff --git a/dev-libs/openssl/openssl-1.0.2o-r6.ebuild b/dev-libs/openssl/openssl-1.0.2o-r6.ebuild
293 deleted file mode 100644
294 index 675a09eea9d..00000000000
295 --- a/dev-libs/openssl/openssl-1.0.2o-r6.ebuild
296 +++ /dev/null
297 @@ -1,297 +0,0 @@
298 -# Copyright 1999-2018 Gentoo Foundation
299 -# Distributed under the terms of the GNU General Public License v2
300 -
301 -EAPI="6"
302 -
303 -inherit eutils flag-o-matic toolchain-funcs multilib multilib-minimal
304 -
305 -PATCH_SET="openssl-1.0.2-patches-1.4"
306 -MY_P=${P/_/-}
307 -DESCRIPTION="full-strength general purpose cryptography library (including SSL and TLS)"
308 -HOMEPAGE="https://www.openssl.org/"
309 -SRC_URI="mirror://openssl/source/${MY_P}.tar.gz
310 - mirror://gentoo/${PATCH_SET}.tar.xz
311 - https://dev.gentoo.org/~whissi/dist/${PN}/${PATCH_SET}.tar.xz
312 - https://dev.gentoo.org/~polynomial-c/dist/${PATCH_SET}.tar.xz"
313 -
314 -LICENSE="openssl"
315 -SLOT="0"
316 -KEYWORDS="~alpha amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~x86-fbsd ~x86-linux"
317 -IUSE="+asm bindist gmp kerberos rfc3779 sctp cpu_flags_x86_sse2 sslv2 +sslv3 static-libs test +tls-heartbeat vanilla zlib"
318 -RESTRICT="!bindist? ( bindist )"
319 -
320 -RDEPEND=">=app-misc/c_rehash-1.7-r1
321 - gmp? ( >=dev-libs/gmp-5.1.3-r1[static-libs(+)?,${MULTILIB_USEDEP}] )
322 - zlib? ( >=sys-libs/zlib-1.2.8-r1[static-libs(+)?,${MULTILIB_USEDEP}] )
323 - kerberos? ( >=app-crypt/mit-krb5-1.11.4[${MULTILIB_USEDEP}] )"
324 -DEPEND="${RDEPEND}
325 - >=dev-lang/perl-5
326 - sctp? ( >=net-misc/lksctp-tools-1.0.12 )
327 - test? (
328 - sys-apps/diffutils
329 - sys-devel/bc
330 - )"
331 -PDEPEND="app-misc/ca-certificates"
332 -
333 -# This does not copy the entire Fedora patchset, but JUST the parts that
334 -# are needed to make it safe to use EC with RESTRICT=bindist.
335 -# See openssl.spec for the matching numbering of SourceNNN, PatchNNN
336 -SOURCE1=hobble-openssl
337 -SOURCE12=ec_curve.c
338 -SOURCE13=ectest.c
339 -# These are ported instead
340 -#PATCH1=openssl-1.1.0-build.patch # Fixes EVP testcase for EC
341 -#PATCH37=openssl-1.1.0-ec-curves.patch
342 -FEDORA_GIT_BASE='https://src.fedoraproject.org/cgit/rpms/openssl.git/plain/'
343 -FEDORA_GIT_BRANCH='f25'
344 -FEDORA_SRC_URI=()
345 -FEDORA_SOURCE=( $SOURCE1 $SOURCE12 $SOURCE13 )
346 -FEDORA_PATCH=( $PATCH1 $PATCH37 )
347 -for i in "${FEDORA_SOURCE[@]}" ; do
348 - FEDORA_SRC_URI+=( "${FEDORA_GIT_BASE}/${i}?h=${FEDORA_GIT_BRANCH} -> ${P}_${i}" )
349 -done
350 -for i in "${FEDORA_PATCH[@]}" ; do # Already have a version prefix
351 - FEDORA_SRC_URI+=( "${FEDORA_GIT_BASE}/${i}?h=${FEDORA_GIT_BRANCH} -> ${i}" )
352 -done
353 -SRC_URI+=" bindist? ( ${FEDORA_SRC_URI[@]} )"
354 -
355 -S="${WORKDIR}/${MY_P}"
356 -
357 -MULTILIB_WRAPPED_HEADERS=(
358 - usr/include/openssl/opensslconf.h
359 -)
360 -
361 -src_prepare() {
362 - if use bindist; then
363 - # This just removes the prefix, and puts it into WORKDIR like the RPM.
364 - for i in "${FEDORA_SOURCE[@]}" ; do
365 - cp -f "${DISTDIR}"/"${P}_${i}" "${WORKDIR}"/"${i}" || die
366 - done
367 - # .spec %prep
368 - bash "${WORKDIR}"/"${SOURCE1}" || die
369 - cp -f "${WORKDIR}"/"${SOURCE12}" "${S}"/crypto/ec/ || die
370 - cp -f "${WORKDIR}"/"${SOURCE13}" "${S}"/crypto/ec/ || die # Moves to test/ in OpenSSL-1.1
371 - for i in "${FEDORA_PATCH[@]}" ; do
372 - eapply "${DISTDIR}"/"${i}"
373 - done
374 - eapply "${FILESDIR}"/openssl-1.0.2o-hobble-ecc.patch
375 - # Also see the configure parts below:
376 - # enable-ec \
377 - # $(use_ssl !bindist ec2m) \
378 - # $(use_ssl !bindist srp) \
379 - fi
380 -
381 - # keep this in sync with app-misc/c_rehash
382 - SSL_CNF_DIR="/etc/ssl"
383 -
384 - # Make sure we only ever touch Makefile.org and avoid patching a file
385 - # that gets blown away anyways by the Configure script in src_configure
386 - rm -f Makefile
387 -
388 - if ! use vanilla ; then
389 - eapply "${WORKDIR}"/patch/*.patch
390 - eapply "${FILESDIR}"/${P}-CVE-2018-0732.patch
391 - fi
392 -
393 - eapply_user
394 -
395 - # disable fips in the build
396 - # make sure the man pages are suffixed #302165
397 - # don't bother building man pages if they're disabled
398 - sed -i \
399 - -e '/DIRS/s: fips : :g' \
400 - -e '/^MANSUFFIX/s:=.*:=ssl:' \
401 - -e '/^MAKEDEPPROG/s:=.*:=$(CC):' \
402 - -e $(has noman FEATURES \
403 - && echo '/^install:/s:install_docs::' \
404 - || echo '/^MANDIR=/s:=.*:='${EPREFIX}'/usr/share/man:') \
405 - Makefile.org \
406 - || die
407 - # show the actual commands in the log
408 - sed -i '/^SET_X/s:=.*:=set -x:' Makefile.shared
409 -
410 - # since we're forcing $(CC) as makedep anyway, just fix
411 - # the conditional as always-on
412 - # helps clang (#417795), and versioned gcc (#499818)
413 - sed -i 's/expr.*MAKEDEPEND.*;/true;/' util/domd || die
414 -
415 - # quiet out unknown driver argument warnings since openssl
416 - # doesn't have well-split CFLAGS and we're making it even worse
417 - # and 'make depend' uses -Werror for added fun (#417795 again)
418 - [[ ${CC} == *clang* ]] && append-flags -Qunused-arguments
419 -
420 - # allow openssl to be cross-compiled
421 - cp "${FILESDIR}"/gentoo.config-1.0.2 gentoo.config || die
422 - chmod a+rx gentoo.config || die
423 -
424 - append-flags -fno-strict-aliasing
425 - append-flags $(test-flags-CC -Wa,--noexecstack)
426 - append-cppflags -DOPENSSL_NO_BUF_FREELISTS
427 -
428 - sed -i '1s,^:$,#!'${EPREFIX}'/usr/bin/perl,' Configure #141906
429 - # The config script does stupid stuff to prompt the user. Kill it.
430 - sed -i '/stty -icanon min 0 time 50; read waste/d' config || die
431 - ./config --test-sanity || die "I AM NOT SANE"
432 -
433 - multilib_copy_sources
434 -}
435 -
436 -multilib_src_configure() {
437 - unset APPS #197996
438 - unset SCRIPTS #312551
439 - unset CROSS_COMPILE #311473
440 -
441 - tc-export CC AR RANLIB RC
442 -
443 - # Clean out patent-or-otherwise-encumbered code
444 - # Camellia: Royalty Free https://en.wikipedia.org/wiki/Camellia_(cipher)
445 - # IDEA: Expired https://en.wikipedia.org/wiki/International_Data_Encryption_Algorithm
446 - # EC: ????????? ??/??/2015 https://en.wikipedia.org/wiki/Elliptic_Curve_Cryptography
447 - # MDC2: Expired https://en.wikipedia.org/wiki/MDC-2
448 - # RC5: Expired https://en.wikipedia.org/wiki/RC5
449 -
450 - use_ssl() { usex $1 "enable-${2:-$1}" "no-${2:-$1}" " ${*:3}" ; }
451 - echoit() { echo "$@" ; "$@" ; }
452 -
453 - local krb5=$(has_version app-crypt/mit-krb5 && echo "MIT" || echo "Heimdal")
454 -
455 - # See if our toolchain supports __uint128_t. If so, it's 64bit
456 - # friendly and can use the nicely optimized code paths. #460790
457 - local ec_nistp_64_gcc_128
458 - # Disable it for now though #469976
459 - #if ! use bindist ; then
460 - # echo "__uint128_t i;" > "${T}"/128.c
461 - # if ${CC} ${CFLAGS} -c "${T}"/128.c -o /dev/null >&/dev/null ; then
462 - # ec_nistp_64_gcc_128="enable-ec_nistp_64_gcc_128"
463 - # fi
464 - #fi
465 -
466 - # https://github.com/openssl/openssl/issues/2286
467 - if use ia64 ; then
468 - replace-flags -g3 -g2
469 - replace-flags -ggdb3 -ggdb2
470 - fi
471 -
472 - local sslout=$(./gentoo.config)
473 - einfo "Use configuration ${sslout:-(openssl knows best)}"
474 - local config="Configure"
475 - [[ -z ${sslout} ]] && config="config"
476 -
477 - # Fedora hobbled-EC needs 'no-ec2m', 'no-srp'
478 - echoit \
479 - ./${config} \
480 - ${sslout} \
481 - $(use cpu_flags_x86_sse2 || echo "no-sse2") \
482 - enable-camellia \
483 - enable-ec \
484 - $(use_ssl !bindist ec2m) \
485 - $(use_ssl !bindist srp) \
486 - ${ec_nistp_64_gcc_128} \
487 - enable-idea \
488 - enable-mdc2 \
489 - enable-rc5 \
490 - enable-tlsext \
491 - $(use_ssl asm) \
492 - $(use_ssl gmp gmp -lgmp) \
493 - $(use_ssl kerberos krb5 --with-krb5-flavor=${krb5}) \
494 - $(use_ssl rfc3779) \
495 - $(use_ssl sctp) \
496 - $(use_ssl sslv2 ssl2) \
497 - $(use_ssl sslv3 ssl3) \
498 - $(use_ssl tls-heartbeat heartbeats) \
499 - $(use_ssl zlib) \
500 - --prefix="${EPREFIX}"/usr \
501 - --openssldir="${EPREFIX}"${SSL_CNF_DIR} \
502 - --libdir=$(get_libdir) \
503 - shared threads \
504 - || die
505 -
506 - # Clean out hardcoded flags that openssl uses
507 - local CFLAG=$(grep ^CFLAG= Makefile | LC_ALL=C sed \
508 - -e 's:^CFLAG=::' \
509 - -e 's:-fomit-frame-pointer ::g' \
510 - -e 's:-O[0-9] ::g' \
511 - -e 's:-march=[-a-z0-9]* ::g' \
512 - -e 's:-mcpu=[-a-z0-9]* ::g' \
513 - -e 's:-m[a-z0-9]* ::g' \
514 - )
515 - sed -i \
516 - -e "/^CFLAG/s|=.*|=${CFLAG} ${CFLAGS}|" \
517 - -e "/^SHARED_LDFLAGS=/s|$| ${LDFLAGS}|" \
518 - Makefile || die
519 -}
520 -
521 -multilib_src_compile() {
522 - # depend is needed to use $confopts; it also doesn't matter
523 - # that it's -j1 as the code itself serializes subdirs
524 - emake -j1 depend
525 - emake all
526 - # rehash is needed to prep the certs/ dir; do this
527 - # separately to avoid parallel build issues.
528 - emake rehash
529 -}
530 -
531 -multilib_src_test() {
532 - emake -j1 test
533 -}
534 -
535 -multilib_src_install() {
536 - emake INSTALL_PREFIX="${D}" install
537 -}
538 -
539 -multilib_src_install_all() {
540 - # openssl installs perl version of c_rehash by default, but
541 - # we provide a shell version via app-misc/c_rehash
542 - rm "${ED}"/usr/bin/c_rehash || die
543 -
544 - local -a DOCS=( CHANGES* FAQ NEWS README doc/*.txt doc/c-indentation.el )
545 - einstalldocs
546 -
547 - use rfc3779 && dodoc engines/ccgost/README.gost
548 -
549 - # This is crappy in that the static archives are still built even
550 - # when USE=static-libs. But this is due to a failing in the openssl
551 - # build system: the static archives are built as PIC all the time.
552 - # Only way around this would be to manually configure+compile openssl
553 - # twice; once with shared lib support enabled and once without.
554 - use static-libs || rm -f "${ED}"/usr/lib*/lib*.a
555 -
556 - # create the certs directory
557 - dodir ${SSL_CNF_DIR}/certs
558 - cp -RP certs/* "${ED}"${SSL_CNF_DIR}/certs/ || die
559 - rm -r "${ED}"${SSL_CNF_DIR}/certs/{demo,expired}
560 -
561 - # Namespace openssl programs to prevent conflicts with other man pages
562 - cd "${ED}"/usr/share/man
563 - local m d s
564 - for m in $(find . -type f | xargs grep -L '#include') ; do
565 - d=${m%/*} ; d=${d#./} ; m=${m##*/}
566 - [[ ${m} == openssl.1* ]] && continue
567 - [[ -n $(find -L ${d} -type l) ]] && die "erp, broken links already!"
568 - mv ${d}/{,ssl-}${m}
569 - # fix up references to renamed man pages
570 - sed -i '/^[.]SH "SEE ALSO"/,/^[.]/s:\([^(, ]*(1)\):ssl-\1:g' ${d}/ssl-${m}
571 - ln -s ssl-${m} ${d}/openssl-${m}
572 - # locate any symlinks that point to this man page ... we assume
573 - # that any broken links are due to the above renaming
574 - for s in $(find -L ${d} -type l) ; do
575 - s=${s##*/}
576 - rm -f ${d}/${s}
577 - ln -s ssl-${m} ${d}/ssl-${s}
578 - ln -s ssl-${s} ${d}/openssl-${s}
579 - done
580 - done
581 - [[ -n $(find -L ${d} -type l) ]] && die "broken manpage links found :("
582 -
583 - dodir /etc/sandbox.d #254521
584 - echo 'SANDBOX_PREDICT="/dev/crypto"' > "${ED}"/etc/sandbox.d/10openssl
585 -
586 - diropts -m0700
587 - keepdir ${SSL_CNF_DIR}/private
588 -}
589 -
590 -pkg_postinst() {
591 - ebegin "Running 'c_rehash ${EROOT%/}${SSL_CNF_DIR}/certs/' to rebuild hashes #333069"
592 - c_rehash "${EROOT%/}${SSL_CNF_DIR}/certs" >/dev/null
593 - eend $?
594 -}