1 |
commit: 3d99ea55293be1ceee8e535de7db09265b7c85ec |
2 |
Author: Thomas Deutschmann <whissi <AT> gentoo <DOT> org> |
3 |
AuthorDate: Tue Oct 1 19:38:36 2019 +0000 |
4 |
Commit: Thomas Deutschmann <whissi <AT> gentoo <DOT> org> |
5 |
CommitDate: Tue Oct 1 19:38:36 2019 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=3d99ea55 |
7 |
|
8 |
dev-libs/openssl: security cleanup (#694162) |
9 |
|
10 |
Bug: https://bugs.gentoo.org/694162 |
11 |
Package-Manager: Portage-2.3.76, Repoman-2.3.17 |
12 |
Signed-off-by: Thomas Deutschmann <whissi <AT> gentoo.org> |
13 |
|
14 |
dev-libs/openssl/Manifest | 12 -- |
15 |
dev-libs/openssl/openssl-1.0.2r.ebuild | 309 ----------------------------- |
16 |
dev-libs/openssl/openssl-1.0.2s-r2.ebuild | 318 ------------------------------ |
17 |
dev-libs/openssl/openssl-1.1.0k-r1.ebuild | 300 ---------------------------- |
18 |
dev-libs/openssl/openssl-1.1.1c-r1.ebuild | 296 --------------------------- |
19 |
5 files changed, 1235 deletions(-) |
20 |
|
21 |
diff --git a/dev-libs/openssl/Manifest b/dev-libs/openssl/Manifest |
22 |
index 14c6ce61047..e24a37051ac 100644 |
23 |
--- a/dev-libs/openssl/Manifest |
24 |
+++ b/dev-libs/openssl/Manifest |
25 |
@@ -1,19 +1,7 @@ |
26 |
DIST openssl-1.0.2-patches-1.5.tar.xz 12404 BLAKE2B 6c1b8c28f339f539b2ab8643379502a24cf62bffde00041dce54d5dd9e8d2620b181362ee5464b0ab32ba4948e209697bfabadbea2944a409a1009100d298f24 SHA512 5725e2d9d1ee8cc074bcef3bed61c71bdab2ff1c114362110c3fb8da11ad5bc8f2ff28e90a293f5f3a5cf96ecda54dffdb7ab3fb3f8b23ef6472250dc3037659 |
27 |
-DIST openssl-1.0.2r.tar.gz 5348369 BLAKE2B 9f9c2d2fe6eaf9acacab29b394a318f30c38e831a5f9c193b2da660f9d04acbf407d8b752274783765416c0f5ba557c24ee293ad7fb7d727771db289e6acc901 SHA512 6eb2211f3ad56d7573ac26f388338592c37e5faaf5e2d44c0fa9062c12186e56a324f135d1c956a89b55fcce047e6428bec2756658d103e7275e08b46f741235 |
28 |
-DIST openssl-1.0.2r_ec_curve.c 17254 BLAKE2B d40d8d6e770443f07abe70e2c4ddda6aec1cc8e37dc1f226a3fdd9ed5d228f09c6d372e8956b1948b55ee1d57d1429493e7288d0f54d9466a37fec805c85aacb SHA512 8e92fb100bcf4bd918c82b9a6cbd75a55abe1a2c08230a007e441c51577f974f8cc336e9ac8a672b32641480428ca8cead5380da1fe81bacb088145a1b754a15 |
29 |
-DIST openssl-1.0.2r_ectest.c 30735 BLAKE2B 95333a27f1cf0a4305a3cee7f6d46b9d4673582ca9acfcf5ba2a0d9d317ab6219cd0d2ff0ba3a55a317c8f5819342f05cc17ba80ec2c92b2b4cab9a3552382e1 SHA512 f2e4d34327b490bc8371f0845c69df3f9fc51ea16f0ea0de0411a0c1fa9d49bb2b6fafc363eb3b3cd919dc7c24e4a0d075c6ff878c01d70dae918f2540874c19 |
30 |
-DIST openssl-1.0.2r_hobble-openssl 1302 BLAKE2B 647caa6a0f4c53a2e77baa3b8e5961eaef3bb0ff38e7d5475eab8deef3439f7fe49028ec9ed0406f3453870b62cac67c496b3a048ee4c9ff4c6866d520235960 SHA512 3d757a4708e74a03dd5cb9b8114dfe442ed9520739a6eca693be4c4265771696f1449ea06d1c9bcfc6e94fc9b0dd0c10e153f1c3b0334831c0550b36cd63326e |
31 |
-DIST openssl-1.0.2s.tar.gz 5349149 BLAKE2B 46c72dcceb5b473b129be0a895f3d6c25a24ee852a31dc369ccf0e44319259d8694d3571b8cb698efb8bce89dbe31f4fc9f82753cacb24cbd3d50fa2ab9b6e83 SHA512 9f745452c4f777df694158e95003cde78a2cf8199bc481a563ec36644664c3c1415a774779b9791dd18f2aeb57fa1721cb52b3db12d025955e970071d5b66d2a |
32 |
-DIST openssl-1.0.2s_ec_curve.c 17254 BLAKE2B d40d8d6e770443f07abe70e2c4ddda6aec1cc8e37dc1f226a3fdd9ed5d228f09c6d372e8956b1948b55ee1d57d1429493e7288d0f54d9466a37fec805c85aacb SHA512 8e92fb100bcf4bd918c82b9a6cbd75a55abe1a2c08230a007e441c51577f974f8cc336e9ac8a672b32641480428ca8cead5380da1fe81bacb088145a1b754a15 |
33 |
-DIST openssl-1.0.2s_ectest.c 30735 BLAKE2B 95333a27f1cf0a4305a3cee7f6d46b9d4673582ca9acfcf5ba2a0d9d317ab6219cd0d2ff0ba3a55a317c8f5819342f05cc17ba80ec2c92b2b4cab9a3552382e1 SHA512 f2e4d34327b490bc8371f0845c69df3f9fc51ea16f0ea0de0411a0c1fa9d49bb2b6fafc363eb3b3cd919dc7c24e4a0d075c6ff878c01d70dae918f2540874c19 |
34 |
-DIST openssl-1.0.2s_hobble-openssl 1302 BLAKE2B 647caa6a0f4c53a2e77baa3b8e5961eaef3bb0ff38e7d5475eab8deef3439f7fe49028ec9ed0406f3453870b62cac67c496b3a048ee4c9ff4c6866d520235960 SHA512 3d757a4708e74a03dd5cb9b8114dfe442ed9520739a6eca693be4c4265771696f1449ea06d1c9bcfc6e94fc9b0dd0c10e153f1c3b0334831c0550b36cd63326e |
35 |
DIST openssl-1.0.2t-bindist-1.0.tar.xz 13872 BLAKE2B b2aade96a6e0ca6209a39e205b1c838de945903fcf959c62cc29ddcd1a0cb360fc5db234df86860a6a4c096f5ecc237611e4c2946b986a5500c24ba93c208ef4 SHA512 a48a7efb9b973b865bcc5009d450b428ed6b4b95e4cefe70c51056e47392c8a7bec58215168d8b07712419dc74646c2bd2fd23bcfbba2031376e292249a6b1b6 |
36 |
DIST openssl-1.0.2t.tar.gz 5355422 BLAKE2B dcbc883151ff6c5b60f5849d8789c2e76a384cb3d5eb5f08a6109776d0edf134580dc33fa8b946ae2344542560f04ecef17f218406952dd8d31e4200c4882022 SHA512 0b88868933f42fab87e8b22449435a1091cc6e75f986aad6c173e01ad123161fcae8c226759073701bc65c9f2f0b6ce6a63a61203008ed873cfb6e484f32bc71 |
37 |
-DIST openssl-1.1.0k-bindist-1.0.tar.xz 11716 BLAKE2B c491ba0899c44dbcc63f85b255548c439c965a20a04ac2a6324a4122c4691b7c95ec18e62be6d708a7ea62ea197d32e5091987cb5043969878f89e5bc26243d4 SHA512 1d5bc9d7b24cf55d32d996e2421d43a1218b605720293f00d07814afb481387856f0dc000ad3c3e4cba2361055668cfe79a945be44ab85a249555f37e683a909 |
38 |
-DIST openssl-1.1.0k.tar.gz 5287321 BLAKE2B fce40a399f5a08d5fe183dfcaab11b211d982885fb9888b25fa41bdd9919ecd203fca6f573363cfb42c9a0776ae69ea50b0f144227a3f28ca0dbadf878d396bc SHA512 65f41a240a97d79504c0e1391fde8ac8692f0993437cdc35e4bc964ecc36e5ef75a62499c4c6cb4ce63f892135e06dba2d3594c8869d935554296fa3c6ccd822 |
39 |
DIST openssl-1.1.0l-bindist-1.0.tar.xz 13184 BLAKE2B c09e023458faff17b10d6f20c28462c0851757a20d59b4b751220ab307324d5778252df112ad74fd319407cc75fdd1cd507d48058dd0234dc8c03020c882ed42 SHA512 39720ecee3ec6080c1416f2fb7c9246b89ee55b21be2baabad51eb6823dbe1559450b1ae92fa61ac1cf5ba04ac8c02438aa469bc65eae6905cf1ea486f270793 |
40 |
DIST openssl-1.1.0l.tar.gz 5294857 BLAKE2B 0e4f30f9e8a22414325bd780dc4e875e962487fbe72967f0392ace959955429192541881a98d097d7bb75ed7238b1817b0c3c2c4da04421512bd538f2b07cdd7 SHA512 81b74149f40ea7d9f7e235820a4f977844653ad1e2b302e65e712c12193f47542fe7e3385fd1e25e3dd074e4e6d04199836cbc492656f5a7692edab5e234f4ad |
41 |
-DIST openssl-1.1.1c-bindist-1.0.tar.xz 11964 BLAKE2B 8c5190846d13984589a150089d329bb3ecc613788b9462c6f6a1833a040e21cb9bf940140449f09fd797c0e396b0aea073237be374bd16097795b8974c3e7ce5 SHA512 249c6d8c455130b98e3be635f12f323e0cc349f1770648bad591e5de15483917185a473c162ed871a2fa05b47056931e6f12e5fdd9cecee7e6d1c246b862923b |
42 |
-DIST openssl-1.1.1c.tar.gz 8864262 BLAKE2B bd157b244bedcefb8e646a743732945119b267236789ac69c38856570318aca09299bdaaea3f20294863b633e6fd4dfe124820597185b3b7461cfdf094daadb0 SHA512 8e2c5cc11c120efbb7d7850980cb6eaa782d29b4996b3f3378d37613c1679f852d7cc08a90d62e78fcec3439f06bdbee70064579a8c2adaffd91532a97f646ff |
43 |
DIST openssl-1.1.1d-bindist-1.0.tar.xz 13180 BLAKE2B 680bd7400d3dd3930067ee7efa9718b74b30afa9be2397ad80f88031920806b6603b6469beede02b6e7a742abf5f82ebdd7c9b8e69c1ffe223e4860dc9581128 SHA512 9e4296326852010d5cebc204d1a34a34198d8d65460bc91a2bd37c80be892a5ae519513e4b0109e6b51b6faab0e171ef6cdae868868c158711558d147083c06f |
44 |
DIST openssl-1.1.1d.tar.gz 8845861 BLAKE2B d3155f07b487ebd8dd4fe25396c874f9af18b5cfd7e622298d29c4f2c8ce14ad4534609d321314a4bcd0d44414e1306190340daaacd3c8fca061c04498446244 SHA512 2bc9f528c27fe644308eb7603c992bac8740e9f0c3601a130af30c9ffebbf7e0f5c28b76a00bbb478bad40fbe89b4223a58d604001e1713da71ff4b7fe6a08a7 |
45 |
|
46 |
diff --git a/dev-libs/openssl/openssl-1.0.2r.ebuild b/dev-libs/openssl/openssl-1.0.2r.ebuild |
47 |
deleted file mode 100644 |
48 |
index c14fecb318d..00000000000 |
49 |
--- a/dev-libs/openssl/openssl-1.0.2r.ebuild |
50 |
+++ /dev/null |
51 |
@@ -1,309 +0,0 @@ |
52 |
-# Copyright 1999-2019 Gentoo Authors |
53 |
-# Distributed under the terms of the GNU General Public License v2 |
54 |
- |
55 |
-EAPI="6" |
56 |
- |
57 |
-inherit eutils flag-o-matic toolchain-funcs multilib multilib-minimal |
58 |
- |
59 |
-# openssl-1.0.2-patches-1.6 contain additional CVE patches |
60 |
-# which got fixed with this release. |
61 |
-# Please use 1.7 version number when rolling a new tarball! |
62 |
-PATCH_SET="openssl-1.0.2-patches-1.5" |
63 |
-MY_P=${P/_/-} |
64 |
-DESCRIPTION="full-strength general purpose cryptography library (including SSL and TLS)" |
65 |
-HOMEPAGE="https://www.openssl.org/" |
66 |
-SRC_URI="mirror://openssl/source/${MY_P}.tar.gz |
67 |
- !vanilla? ( |
68 |
- mirror://gentoo/${PATCH_SET}.tar.xz |
69 |
- https://dev.gentoo.org/~chutzpah/dist/${PN}/${PATCH_SET}.tar.xz |
70 |
- https://dev.gentoo.org/~whissi/dist/${PN}/${PATCH_SET}.tar.xz |
71 |
- https://dev.gentoo.org/~polynomial-c/dist/${PATCH_SET}.tar.xz |
72 |
- )" |
73 |
- |
74 |
-LICENSE="openssl" |
75 |
-SLOT="0" |
76 |
-KEYWORDS="alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 ~riscv s390 sh sparc x86 ~amd64-fbsd ~x86-fbsd ~x86-linux" |
77 |
-IUSE="+asm bindist gmp kerberos rfc3779 sctp cpu_flags_x86_sse2 sslv2 +sslv3 static-libs test +tls-heartbeat vanilla zlib" |
78 |
-RESTRICT="!bindist? ( bindist )" |
79 |
- |
80 |
-RDEPEND=">=app-misc/c_rehash-1.7-r1 |
81 |
- gmp? ( >=dev-libs/gmp-5.1.3-r1[static-libs(+)?,${MULTILIB_USEDEP}] ) |
82 |
- zlib? ( >=sys-libs/zlib-1.2.8-r1[static-libs(+)?,${MULTILIB_USEDEP}] ) |
83 |
- kerberos? ( >=app-crypt/mit-krb5-1.11.4[${MULTILIB_USEDEP}] )" |
84 |
-DEPEND="${RDEPEND} |
85 |
- >=dev-lang/perl-5 |
86 |
- sctp? ( >=net-misc/lksctp-tools-1.0.12 ) |
87 |
- test? ( |
88 |
- sys-apps/diffutils |
89 |
- sys-devel/bc |
90 |
- )" |
91 |
-PDEPEND="app-misc/ca-certificates" |
92 |
- |
93 |
-# This does not copy the entire Fedora patchset, but JUST the parts that |
94 |
-# are needed to make it safe to use EC with RESTRICT=bindist. |
95 |
-# See openssl.spec for the matching numbering of SourceNNN, PatchNNN |
96 |
-SOURCE1=hobble-openssl |
97 |
-SOURCE12=ec_curve.c |
98 |
-SOURCE13=ectest.c |
99 |
-# These are ported instead |
100 |
-#PATCH1=openssl-1.1.0-build.patch # Fixes EVP testcase for EC |
101 |
-#PATCH37=openssl-1.1.0-ec-curves.patch |
102 |
-FEDORA_GIT_BASE='https://src.fedoraproject.org/cgit/rpms/openssl.git/plain/' |
103 |
-FEDORA_GIT_BRANCH='f25' |
104 |
-FEDORA_SRC_URI=() |
105 |
-FEDORA_SOURCE=( $SOURCE1 $SOURCE12 $SOURCE13 ) |
106 |
-FEDORA_PATCH=( $PATCH1 $PATCH37 ) |
107 |
-for i in "${FEDORA_SOURCE[@]}" ; do |
108 |
- FEDORA_SRC_URI+=( "${FEDORA_GIT_BASE}/${i}?h=${FEDORA_GIT_BRANCH} -> ${P}_${i}" ) |
109 |
-done |
110 |
-for i in "${FEDORA_PATCH[@]}" ; do # Already have a version prefix |
111 |
- FEDORA_SRC_URI+=( "${FEDORA_GIT_BASE}/${i}?h=${FEDORA_GIT_BRANCH} -> ${i}" ) |
112 |
-done |
113 |
-SRC_URI+=" bindist? ( ${FEDORA_SRC_URI[@]} )" |
114 |
- |
115 |
-S="${WORKDIR}/${MY_P}" |
116 |
- |
117 |
-MULTILIB_WRAPPED_HEADERS=( |
118 |
- usr/include/openssl/opensslconf.h |
119 |
-) |
120 |
- |
121 |
-src_prepare() { |
122 |
- if use bindist; then |
123 |
- # This just removes the prefix, and puts it into WORKDIR like the RPM. |
124 |
- for i in "${FEDORA_SOURCE[@]}" ; do |
125 |
- cp -f "${DISTDIR}"/"${P}_${i}" "${WORKDIR}"/"${i}" || die |
126 |
- done |
127 |
- # .spec %prep |
128 |
- bash "${WORKDIR}"/"${SOURCE1}" || die |
129 |
- cp -f "${WORKDIR}"/"${SOURCE12}" "${S}"/crypto/ec/ || die |
130 |
- cp -f "${WORKDIR}"/"${SOURCE13}" "${S}"/crypto/ec/ || die # Moves to test/ in OpenSSL-1.1 |
131 |
- for i in "${FEDORA_PATCH[@]}" ; do |
132 |
- eapply "${DISTDIR}"/"${i}" |
133 |
- done |
134 |
- eapply "${FILESDIR}"/openssl-1.0.2p-hobble-ecc.patch |
135 |
- # Also see the configure parts below: |
136 |
- # enable-ec \ |
137 |
- # $(use_ssl !bindist ec2m) \ |
138 |
- # $(use_ssl !bindist srp) \ |
139 |
- fi |
140 |
- |
141 |
- # keep this in sync with app-misc/c_rehash |
142 |
- SSL_CNF_DIR="/etc/ssl" |
143 |
- |
144 |
- # Make sure we only ever touch Makefile.org and avoid patching a file |
145 |
- # that gets blown away anyways by the Configure script in src_configure |
146 |
- rm -f Makefile |
147 |
- |
148 |
- if ! use vanilla ; then |
149 |
- eapply "${WORKDIR}"/patch/*.patch |
150 |
- fi |
151 |
- |
152 |
- eapply_user |
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:=.*:='${EPREFIX%/}'/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 |
- |
169 |
- # since we're forcing $(CC) as makedep anyway, just fix |
170 |
- # the conditional as always-on |
171 |
- # helps clang (#417795), and versioned gcc (#499818) |
172 |
- # this breaks build with 1.0.2p, not sure if it is needed anymore |
173 |
- #sed -i 's/expr.*MAKEDEPEND.*;/true;/' util/domd || die |
174 |
- |
175 |
- # quiet out unknown driver argument warnings since openssl |
176 |
- # doesn't have well-split CFLAGS and we're making it even worse |
177 |
- # and 'make depend' uses -Werror for added fun (#417795 again) |
178 |
- [[ ${CC} == *clang* ]] && append-flags -Qunused-arguments |
179 |
- |
180 |
- # allow openssl to be cross-compiled |
181 |
- cp "${FILESDIR}"/gentoo.config-1.0.2 gentoo.config || die |
182 |
- chmod a+rx gentoo.config || die |
183 |
- |
184 |
- append-flags -fno-strict-aliasing |
185 |
- append-flags $(test-flags-CC -Wa,--noexecstack) |
186 |
- append-cppflags -DOPENSSL_NO_BUF_FREELISTS |
187 |
- |
188 |
- sed -i '1s,^:$,#!'${EPREFIX%/}'/usr/bin/perl,' Configure #141906 |
189 |
- # The config script does stupid stuff to prompt the user. Kill it. |
190 |
- sed -i '/stty -icanon min 0 time 50; read waste/d' config || die |
191 |
- ./config --test-sanity || die "I AM NOT SANE" |
192 |
- |
193 |
- multilib_copy_sources |
194 |
-} |
195 |
- |
196 |
-multilib_src_configure() { |
197 |
- unset APPS #197996 |
198 |
- unset SCRIPTS #312551 |
199 |
- unset CROSS_COMPILE #311473 |
200 |
- |
201 |
- tc-export CC AR RANLIB RC |
202 |
- |
203 |
- # Clean out patent-or-otherwise-encumbered code |
204 |
- # Camellia: Royalty Free https://en.wikipedia.org/wiki/Camellia_(cipher) |
205 |
- # IDEA: Expired https://en.wikipedia.org/wiki/International_Data_Encryption_Algorithm |
206 |
- # EC: ????????? ??/??/2015 https://en.wikipedia.org/wiki/Elliptic_Curve_Cryptography |
207 |
- # MDC2: Expired https://en.wikipedia.org/wiki/MDC-2 |
208 |
- # RC5: Expired https://en.wikipedia.org/wiki/RC5 |
209 |
- |
210 |
- use_ssl() { usex $1 "enable-${2:-$1}" "no-${2:-$1}" " ${*:3}" ; } |
211 |
- echoit() { echo "$@" ; "$@" ; } |
212 |
- |
213 |
- local krb5=$(has_version app-crypt/mit-krb5 && echo "MIT" || echo "Heimdal") |
214 |
- |
215 |
- # See if our toolchain supports __uint128_t. If so, it's 64bit |
216 |
- # friendly and can use the nicely optimized code paths. #460790 |
217 |
- local ec_nistp_64_gcc_128 |
218 |
- # Disable it for now though #469976 |
219 |
- #if ! use bindist ; then |
220 |
- # echo "__uint128_t i;" > "${T}"/128.c |
221 |
- # if ${CC} ${CFLAGS} -c "${T}"/128.c -o /dev/null >&/dev/null ; then |
222 |
- # ec_nistp_64_gcc_128="enable-ec_nistp_64_gcc_128" |
223 |
- # fi |
224 |
- #fi |
225 |
- |
226 |
- # https://github.com/openssl/openssl/issues/2286 |
227 |
- if use ia64 ; then |
228 |
- replace-flags -g3 -g2 |
229 |
- replace-flags -ggdb3 -ggdb2 |
230 |
- fi |
231 |
- |
232 |
- local sslout=$(./gentoo.config) |
233 |
- einfo "Use configuration ${sslout:-(openssl knows best)}" |
234 |
- local config="Configure" |
235 |
- [[ -z ${sslout} ]] && config="config" |
236 |
- |
237 |
- # Fedora hobbled-EC needs 'no-ec2m', 'no-srp' |
238 |
- echoit \ |
239 |
- ./${config} \ |
240 |
- ${sslout} \ |
241 |
- $(use cpu_flags_x86_sse2 || echo "no-sse2") \ |
242 |
- enable-camellia \ |
243 |
- enable-ec \ |
244 |
- $(use_ssl !bindist ec2m) \ |
245 |
- $(use_ssl !bindist srp) \ |
246 |
- ${ec_nistp_64_gcc_128} \ |
247 |
- enable-idea \ |
248 |
- enable-mdc2 \ |
249 |
- enable-rc5 \ |
250 |
- enable-tlsext \ |
251 |
- $(use_ssl asm) \ |
252 |
- $(use_ssl gmp gmp -lgmp) \ |
253 |
- $(use_ssl kerberos krb5 --with-krb5-flavor=${krb5}) \ |
254 |
- $(use_ssl rfc3779) \ |
255 |
- $(use_ssl sctp) \ |
256 |
- $(use_ssl sslv2 ssl2) \ |
257 |
- $(use_ssl sslv3 ssl3) \ |
258 |
- $(use_ssl tls-heartbeat heartbeats) \ |
259 |
- $(use_ssl zlib) \ |
260 |
- --prefix="${EPREFIX%/}"/usr \ |
261 |
- --openssldir="${EPREFIX%/}"${SSL_CNF_DIR} \ |
262 |
- --libdir=$(get_libdir) \ |
263 |
- shared threads \ |
264 |
- || die |
265 |
- |
266 |
- # Clean out hardcoded flags that openssl uses |
267 |
- local CFLAG=$(grep ^CFLAG= Makefile | LC_ALL=C sed \ |
268 |
- -e 's:^CFLAG=::' \ |
269 |
- -e 's:-fomit-frame-pointer ::g' \ |
270 |
- -e 's:-O[0-9] ::g' \ |
271 |
- -e 's:-march=[-a-z0-9]* ::g' \ |
272 |
- -e 's:-mcpu=[-a-z0-9]* ::g' \ |
273 |
- -e 's:-m[a-z0-9]* ::g' \ |
274 |
- ) |
275 |
- sed -i \ |
276 |
- -e "/^CFLAG/s|=.*|=${CFLAG} ${CFLAGS}|" \ |
277 |
- -e "/^SHARED_LDFLAGS=/s|$| ${LDFLAGS}|" \ |
278 |
- Makefile || die |
279 |
-} |
280 |
- |
281 |
-multilib_src_compile() { |
282 |
- # depend is needed to use $confopts; it also doesn't matter |
283 |
- # that it's -j1 as the code itself serializes subdirs |
284 |
- emake -j1 V=1 depend |
285 |
- emake all |
286 |
- # rehash is needed to prep the certs/ dir; do this |
287 |
- # separately to avoid parallel build issues. |
288 |
- emake rehash |
289 |
-} |
290 |
- |
291 |
-multilib_src_test() { |
292 |
- emake -j1 test |
293 |
-} |
294 |
- |
295 |
-multilib_src_install() { |
296 |
- # We need to create $ED/usr on our own to avoid a race condition #665130 |
297 |
- if [[ ! -d "${ED%/}/usr" ]]; then |
298 |
- # We can only create this directory once |
299 |
- mkdir "${ED%/}"/usr || die |
300 |
- fi |
301 |
- |
302 |
- emake INSTALL_PREFIX="${D%/}" install |
303 |
-} |
304 |
- |
305 |
-multilib_src_install_all() { |
306 |
- # openssl installs perl version of c_rehash by default, but |
307 |
- # we provide a shell version via app-misc/c_rehash |
308 |
- rm "${ED%/}"/usr/bin/c_rehash || die |
309 |
- |
310 |
- local -a DOCS=( CHANGES* FAQ NEWS README doc/*.txt doc/c-indentation.el ) |
311 |
- einstalldocs |
312 |
- |
313 |
- use rfc3779 && dodoc engines/ccgost/README.gost |
314 |
- |
315 |
- # This is crappy in that the static archives are still built even |
316 |
- # when USE=static-libs. But this is due to a failing in the openssl |
317 |
- # build system: the static archives are built as PIC all the time. |
318 |
- # Only way around this would be to manually configure+compile openssl |
319 |
- # twice; once with shared lib support enabled and once without. |
320 |
- use static-libs || rm -f "${ED}"/usr/lib*/lib*.a |
321 |
- |
322 |
- # create the certs directory |
323 |
- dodir ${SSL_CNF_DIR}/certs |
324 |
- cp -RP certs/* "${ED}"${SSL_CNF_DIR}/certs/ || die |
325 |
- rm -r "${ED}"${SSL_CNF_DIR}/certs/{demo,expired} |
326 |
- |
327 |
- # Namespace openssl programs to prevent conflicts with other man pages |
328 |
- cd "${ED}"/usr/share/man |
329 |
- local m d s |
330 |
- for m in $(find . -type f | xargs grep -L '#include') ; do |
331 |
- d=${m%/*} ; d=${d#./} ; m=${m##*/} |
332 |
- [[ ${m} == openssl.1* ]] && continue |
333 |
- [[ -n $(find -L ${d} -type l) ]] && die "erp, broken links already!" |
334 |
- mv ${d}/{,ssl-}${m} |
335 |
- # fix up references to renamed man pages |
336 |
- sed -i '/^[.]SH "SEE ALSO"/,/^[.]/s:\([^(, ]*(1)\):ssl-\1:g' ${d}/ssl-${m} |
337 |
- ln -s ssl-${m} ${d}/openssl-${m} |
338 |
- # locate any symlinks that point to this man page ... we assume |
339 |
- # that any broken links are due to the above renaming |
340 |
- for s in $(find -L ${d} -type l) ; do |
341 |
- s=${s##*/} |
342 |
- rm -f ${d}/${s} |
343 |
- ln -s ssl-${m} ${d}/ssl-${s} |
344 |
- ln -s ssl-${s} ${d}/openssl-${s} |
345 |
- done |
346 |
- done |
347 |
- [[ -n $(find -L ${d} -type l) ]] && die "broken manpage links found :(" |
348 |
- |
349 |
- dodir /etc/sandbox.d #254521 |
350 |
- echo 'SANDBOX_PREDICT="/dev/crypto"' > "${ED}"/etc/sandbox.d/10openssl |
351 |
- |
352 |
- diropts -m0700 |
353 |
- keepdir ${SSL_CNF_DIR}/private |
354 |
-} |
355 |
- |
356 |
-pkg_postinst() { |
357 |
- ebegin "Running 'c_rehash ${EROOT%/}${SSL_CNF_DIR}/certs/' to rebuild hashes #333069" |
358 |
- c_rehash "${EROOT%/}${SSL_CNF_DIR}/certs" >/dev/null |
359 |
- eend $? |
360 |
-} |
361 |
|
362 |
diff --git a/dev-libs/openssl/openssl-1.0.2s-r2.ebuild b/dev-libs/openssl/openssl-1.0.2s-r2.ebuild |
363 |
deleted file mode 100644 |
364 |
index fbf3c919b91..00000000000 |
365 |
--- a/dev-libs/openssl/openssl-1.0.2s-r2.ebuild |
366 |
+++ /dev/null |
367 |
@@ -1,318 +0,0 @@ |
368 |
-# Copyright 1999-2019 Gentoo Authors |
369 |
-# Distributed under the terms of the GNU General Public License v2 |
370 |
- |
371 |
-EAPI="7" |
372 |
- |
373 |
-inherit flag-o-matic toolchain-funcs multilib multilib-minimal |
374 |
- |
375 |
-# openssl-1.0.2-patches-1.6 contain additional CVE patches |
376 |
-# which got fixed with this release. |
377 |
-# Please use 1.7 version number when rolling a new tarball! |
378 |
-PATCH_SET="openssl-1.0.2-patches-1.5" |
379 |
-MY_P=${P/_/-} |
380 |
-DESCRIPTION="full-strength general purpose cryptography library (including SSL and TLS)" |
381 |
-HOMEPAGE="https://www.openssl.org/" |
382 |
-SRC_URI="mirror://openssl/source/${MY_P}.tar.gz |
383 |
- !vanilla? ( |
384 |
- mirror://gentoo/${PATCH_SET}.tar.xz |
385 |
- https://dev.gentoo.org/~chutzpah/dist/${PN}/${PATCH_SET}.tar.xz |
386 |
- https://dev.gentoo.org/~whissi/dist/${PN}/${PATCH_SET}.tar.xz |
387 |
- https://dev.gentoo.org/~polynomial-c/dist/${PATCH_SET}.tar.xz |
388 |
- )" |
389 |
- |
390 |
-LICENSE="openssl" |
391 |
-SLOT="0" |
392 |
-KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~x86-fbsd ~x86-linux" |
393 |
-IUSE="+asm bindist gmp kerberos rfc3779 sctp cpu_flags_x86_sse2 sslv2 +sslv3 static-libs test +tls-heartbeat vanilla zlib" |
394 |
-RESTRICT="!bindist? ( bindist )" |
395 |
- |
396 |
-RDEPEND=">=app-misc/c_rehash-1.7-r1 |
397 |
- gmp? ( >=dev-libs/gmp-5.1.3-r1[static-libs(+)?,${MULTILIB_USEDEP}] ) |
398 |
- kerberos? ( >=app-crypt/mit-krb5-1.11.4[${MULTILIB_USEDEP}] ) |
399 |
- zlib? ( >=sys-libs/zlib-1.2.8-r1[static-libs(+)?,${MULTILIB_USEDEP}] )" |
400 |
-DEPEND="${RDEPEND}" |
401 |
-BDEPEND=" |
402 |
- >=dev-lang/perl-5 |
403 |
- sctp? ( >=net-misc/lksctp-tools-1.0.12 ) |
404 |
- test? ( |
405 |
- sys-apps/diffutils |
406 |
- sys-devel/bc |
407 |
- )" |
408 |
-PDEPEND="app-misc/ca-certificates" |
409 |
- |
410 |
-# This does not copy the entire Fedora patchset, but JUST the parts that |
411 |
-# are needed to make it safe to use EC with RESTRICT=bindist. |
412 |
-# See openssl.spec for the matching numbering of SourceNNN, PatchNNN |
413 |
-SOURCE1=hobble-openssl |
414 |
-SOURCE12=ec_curve.c |
415 |
-SOURCE13=ectest.c |
416 |
-# These are ported instead |
417 |
-#PATCH1=openssl-1.1.0-build.patch # Fixes EVP testcase for EC |
418 |
-#PATCH37=openssl-1.1.0-ec-curves.patch |
419 |
-FEDORA_GIT_BASE='https://src.fedoraproject.org/cgit/rpms/openssl.git/plain/' |
420 |
-FEDORA_GIT_BRANCH='f25' |
421 |
-FEDORA_SRC_URI=() |
422 |
-FEDORA_SOURCE=( $SOURCE1 $SOURCE12 $SOURCE13 ) |
423 |
-FEDORA_PATCH=( $PATCH1 $PATCH37 ) |
424 |
-for i in "${FEDORA_SOURCE[@]}" ; do |
425 |
- FEDORA_SRC_URI+=( "${FEDORA_GIT_BASE}/${i}?h=${FEDORA_GIT_BRANCH} -> ${P}_${i}" ) |
426 |
-done |
427 |
-for i in "${FEDORA_PATCH[@]}" ; do # Already have a version prefix |
428 |
- FEDORA_SRC_URI+=( "${FEDORA_GIT_BASE}/${i}?h=${FEDORA_GIT_BRANCH} -> ${i}" ) |
429 |
-done |
430 |
-SRC_URI+=" bindist? ( ${FEDORA_SRC_URI[@]} )" |
431 |
- |
432 |
-S="${WORKDIR}/${MY_P}" |
433 |
- |
434 |
-MULTILIB_WRAPPED_HEADERS=( |
435 |
- usr/include/openssl/opensslconf.h |
436 |
-) |
437 |
- |
438 |
-src_prepare() { |
439 |
- if use bindist; then |
440 |
- # This just removes the prefix, and puts it into WORKDIR like the RPM. |
441 |
- for i in "${FEDORA_SOURCE[@]}" ; do |
442 |
- cp -f "${DISTDIR}"/"${P}_${i}" "${WORKDIR}"/"${i}" || die |
443 |
- done |
444 |
- # .spec %prep |
445 |
- bash "${WORKDIR}"/"${SOURCE1}" || die |
446 |
- cp -f "${WORKDIR}"/"${SOURCE12}" "${S}"/crypto/ec/ || die |
447 |
- cp -f "${WORKDIR}"/"${SOURCE13}" "${S}"/crypto/ec/ || die # Moves to test/ in OpenSSL-1.1 |
448 |
- for i in "${FEDORA_PATCH[@]}" ; do |
449 |
- eapply "${DISTDIR}"/"${i}" |
450 |
- done |
451 |
- eapply "${FILESDIR}"/openssl-1.0.2p-hobble-ecc.patch |
452 |
- # Also see the configure parts below: |
453 |
- # enable-ec \ |
454 |
- # $(use_ssl !bindist ec2m) \ |
455 |
- # $(use_ssl !bindist srp) \ |
456 |
- fi |
457 |
- |
458 |
- # keep this in sync with app-misc/c_rehash |
459 |
- SSL_CNF_DIR="/etc/ssl" |
460 |
- |
461 |
- # Make sure we only ever touch Makefile.org and avoid patching a file |
462 |
- # that gets blown away anyways by the Configure script in src_configure |
463 |
- rm -f Makefile |
464 |
- |
465 |
- if ! use vanilla ; then |
466 |
- eapply "${WORKDIR}"/patch/*.patch |
467 |
- fi |
468 |
- |
469 |
- eapply_user |
470 |
- |
471 |
- # disable fips in the build |
472 |
- # make sure the man pages are suffixed #302165 |
473 |
- # don't bother building man pages if they're disabled |
474 |
- sed -i \ |
475 |
- -e '/DIRS/s: fips : :g' \ |
476 |
- -e '/^MANSUFFIX/s:=.*:=ssl:' \ |
477 |
- -e '/^MAKEDEPPROG/s:=.*:=$(CC):' \ |
478 |
- -e $(has noman FEATURES \ |
479 |
- && echo '/^install:/s:install_docs::' \ |
480 |
- || echo '/^MANDIR=/s:=.*:='${EPREFIX}'/usr/share/man:') \ |
481 |
- Makefile.org \ |
482 |
- || die |
483 |
- # show the actual commands in the log |
484 |
- sed -i '/^SET_X/s:=.*:=set -x:' Makefile.shared |
485 |
- |
486 |
- # since we're forcing $(CC) as makedep anyway, just fix |
487 |
- # the conditional as always-on |
488 |
- # helps clang (#417795), and versioned gcc (#499818) |
489 |
- # this breaks build with 1.0.2p, not sure if it is needed anymore |
490 |
- #sed -i 's/expr.*MAKEDEPEND.*;/true;/' util/domd || die |
491 |
- |
492 |
- # quiet out unknown driver argument warnings since openssl |
493 |
- # doesn't have well-split CFLAGS and we're making it even worse |
494 |
- # and 'make depend' uses -Werror for added fun (#417795 again) |
495 |
- [[ ${CC} == *clang* ]] && append-flags -Qunused-arguments |
496 |
- |
497 |
- # allow openssl to be cross-compiled |
498 |
- cp "${FILESDIR}"/gentoo.config-1.0.2 gentoo.config || die |
499 |
- chmod a+rx gentoo.config || die |
500 |
- |
501 |
- append-flags -fno-strict-aliasing |
502 |
- append-flags $(test-flags-CC -Wa,--noexecstack) |
503 |
- append-cppflags -DOPENSSL_NO_BUF_FREELISTS |
504 |
- |
505 |
- sed -i '1s,^:$,#!'${EPREFIX}'/usr/bin/perl,' Configure #141906 |
506 |
- # The config script does stupid stuff to prompt the user. Kill it. |
507 |
- sed -i '/stty -icanon min 0 time 50; read waste/d' config || die |
508 |
- ./config --test-sanity || die "I AM NOT SANE" |
509 |
- |
510 |
- multilib_copy_sources |
511 |
-} |
512 |
- |
513 |
-multilib_src_configure() { |
514 |
- unset APPS #197996 |
515 |
- unset SCRIPTS #312551 |
516 |
- unset CROSS_COMPILE #311473 |
517 |
- |
518 |
- tc-export CC AR RANLIB RC |
519 |
- |
520 |
- # Clean out patent-or-otherwise-encumbered code |
521 |
- # Camellia: Royalty Free https://en.wikipedia.org/wiki/Camellia_(cipher) |
522 |
- # IDEA: Expired https://en.wikipedia.org/wiki/International_Data_Encryption_Algorithm |
523 |
- # EC: ????????? ??/??/2015 https://en.wikipedia.org/wiki/Elliptic_Curve_Cryptography |
524 |
- # MDC2: Expired https://en.wikipedia.org/wiki/MDC-2 |
525 |
- # RC5: Expired https://en.wikipedia.org/wiki/RC5 |
526 |
- |
527 |
- use_ssl() { usex $1 "enable-${2:-$1}" "no-${2:-$1}" " ${*:3}" ; } |
528 |
- echoit() { echo "$@" ; "$@" ; } |
529 |
- |
530 |
- local krb5=$(has_version app-crypt/mit-krb5 && echo "MIT" || echo "Heimdal") |
531 |
- |
532 |
- # See if our toolchain supports __uint128_t. If so, it's 64bit |
533 |
- # friendly and can use the nicely optimized code paths. #460790 |
534 |
- local ec_nistp_64_gcc_128 |
535 |
- # Disable it for now though #469976 |
536 |
- #if ! use bindist ; then |
537 |
- # echo "__uint128_t i;" > "${T}"/128.c |
538 |
- # if ${CC} ${CFLAGS} -c "${T}"/128.c -o /dev/null >&/dev/null ; then |
539 |
- # ec_nistp_64_gcc_128="enable-ec_nistp_64_gcc_128" |
540 |
- # fi |
541 |
- #fi |
542 |
- |
543 |
- # https://github.com/openssl/openssl/issues/2286 |
544 |
- if use ia64 ; then |
545 |
- replace-flags -g3 -g2 |
546 |
- replace-flags -ggdb3 -ggdb2 |
547 |
- fi |
548 |
- |
549 |
- local sslout=$(./gentoo.config) |
550 |
- einfo "Use configuration ${sslout:-(openssl knows best)}" |
551 |
- local config="Configure" |
552 |
- [[ -z ${sslout} ]] && config="config" |
553 |
- |
554 |
- # Fedora hobbled-EC needs 'no-ec2m', 'no-srp' |
555 |
- # Make sure user flags don't get added *yet* to avoid duplicated |
556 |
- # flags. |
557 |
- CFLAGS= LDFLAGS= echoit \ |
558 |
- ./${config} \ |
559 |
- ${sslout} \ |
560 |
- $(use cpu_flags_x86_sse2 || echo "no-sse2") \ |
561 |
- enable-camellia \ |
562 |
- enable-ec \ |
563 |
- $(use_ssl !bindist ec2m) \ |
564 |
- $(use_ssl !bindist srp) \ |
565 |
- ${ec_nistp_64_gcc_128} \ |
566 |
- enable-idea \ |
567 |
- enable-mdc2 \ |
568 |
- enable-rc5 \ |
569 |
- enable-tlsext \ |
570 |
- $(use_ssl asm) \ |
571 |
- $(use_ssl gmp gmp -lgmp) \ |
572 |
- $(use_ssl kerberos krb5 --with-krb5-flavor=${krb5}) \ |
573 |
- $(use_ssl rfc3779) \ |
574 |
- $(use_ssl sctp) \ |
575 |
- $(use_ssl sslv2 ssl2) \ |
576 |
- $(use_ssl sslv3 ssl3) \ |
577 |
- $(use_ssl tls-heartbeat heartbeats) \ |
578 |
- $(use_ssl zlib) \ |
579 |
- --prefix="${EPREFIX}"/usr \ |
580 |
- --openssldir="${EPREFIX}"${SSL_CNF_DIR} \ |
581 |
- --libdir=$(get_libdir) \ |
582 |
- shared threads \ |
583 |
- || die |
584 |
- |
585 |
- # Clean out hardcoded flags that openssl uses |
586 |
- local DEFAULT_CFLAGS=$(grep ^CFLAG= Makefile | LC_ALL=C sed \ |
587 |
- -e 's:^CFLAG=::' \ |
588 |
- -e 's:\(^\| \)-fomit-frame-pointer::g' \ |
589 |
- -e 's:\(^\| \)-O[^ ]*::g' \ |
590 |
- -e 's:\(^\| \)-march=[^ ]*::g' \ |
591 |
- -e 's:\(^\| \)-mcpu=[^ ]*::g' \ |
592 |
- -e 's:\(^\| \)-m[^ ]*::g' \ |
593 |
- -e 's:^ *::' \ |
594 |
- -e 's: *$::' \ |
595 |
- -e 's: \+: :g' \ |
596 |
- -e 's:\\:\\\\:g' |
597 |
- ) |
598 |
- |
599 |
- # Now insert clean default flags with user flags |
600 |
- sed -i \ |
601 |
- -e "/^CFLAG/s|=.*|=${DEFAULT_CFLAGS} ${CFLAGS}|" \ |
602 |
- -e "/^LDFLAGS=/s|=[[:space:]]*$|=${LDFLAGS}|" \ |
603 |
- Makefile || die |
604 |
-} |
605 |
- |
606 |
-multilib_src_compile() { |
607 |
- # depend is needed to use $confopts; it also doesn't matter |
608 |
- # that it's -j1 as the code itself serializes subdirs |
609 |
- emake -j1 V=1 depend |
610 |
- emake all |
611 |
- # rehash is needed to prep the certs/ dir; do this |
612 |
- # separately to avoid parallel build issues. |
613 |
- emake rehash |
614 |
-} |
615 |
- |
616 |
-multilib_src_test() { |
617 |
- emake -j1 test |
618 |
-} |
619 |
- |
620 |
-multilib_src_install() { |
621 |
- # We need to create $ED/usr on our own to avoid a race condition #665130 |
622 |
- if [[ ! -d "${ED}/usr" ]]; then |
623 |
- # We can only create this directory once |
624 |
- mkdir "${ED}"/usr || die |
625 |
- fi |
626 |
- |
627 |
- emake INSTALL_PREFIX="${D}" install |
628 |
-} |
629 |
- |
630 |
-multilib_src_install_all() { |
631 |
- # openssl installs perl version of c_rehash by default, but |
632 |
- # we provide a shell version via app-misc/c_rehash |
633 |
- rm "${ED}"/usr/bin/c_rehash || die |
634 |
- |
635 |
- local -a DOCS=( CHANGES* FAQ NEWS README doc/*.txt doc/c-indentation.el ) |
636 |
- einstalldocs |
637 |
- |
638 |
- use rfc3779 && dodoc engines/ccgost/README.gost |
639 |
- |
640 |
- # This is crappy in that the static archives are still built even |
641 |
- # when USE=static-libs. But this is due to a failing in the openssl |
642 |
- # build system: the static archives are built as PIC all the time. |
643 |
- # Only way around this would be to manually configure+compile openssl |
644 |
- # twice; once with shared lib support enabled and once without. |
645 |
- use static-libs || rm -f "${ED}"/usr/lib*/lib*.a |
646 |
- |
647 |
- # create the certs directory |
648 |
- dodir ${SSL_CNF_DIR}/certs |
649 |
- cp -RP certs/* "${ED}"${SSL_CNF_DIR}/certs/ || die |
650 |
- rm -r "${ED}"${SSL_CNF_DIR}/certs/{demo,expired} |
651 |
- |
652 |
- # Namespace openssl programs to prevent conflicts with other man pages |
653 |
- cd "${ED}"/usr/share/man |
654 |
- local m d s |
655 |
- for m in $(find . -type f | xargs grep -L '#include') ; do |
656 |
- d=${m%/*} ; d=${d#./} ; m=${m##*/} |
657 |
- [[ ${m} == openssl.1* ]] && continue |
658 |
- [[ -n $(find -L ${d} -type l) ]] && die "erp, broken links already!" |
659 |
- mv ${d}/{,ssl-}${m} |
660 |
- # fix up references to renamed man pages |
661 |
- sed -i '/^[.]SH "SEE ALSO"/,/^[.]/s:\([^(, ]*(1)\):ssl-\1:g' ${d}/ssl-${m} |
662 |
- ln -s ssl-${m} ${d}/openssl-${m} |
663 |
- # locate any symlinks that point to this man page ... we assume |
664 |
- # that any broken links are due to the above renaming |
665 |
- for s in $(find -L ${d} -type l) ; do |
666 |
- s=${s##*/} |
667 |
- rm -f ${d}/${s} |
668 |
- ln -s ssl-${m} ${d}/ssl-${s} |
669 |
- ln -s ssl-${s} ${d}/openssl-${s} |
670 |
- done |
671 |
- done |
672 |
- [[ -n $(find -L ${d} -type l) ]] && die "broken manpage links found :(" |
673 |
- |
674 |
- dodir /etc/sandbox.d #254521 |
675 |
- echo 'SANDBOX_PREDICT="/dev/crypto"' > "${ED}"/etc/sandbox.d/10openssl |
676 |
- |
677 |
- diropts -m0700 |
678 |
- keepdir ${SSL_CNF_DIR}/private |
679 |
-} |
680 |
- |
681 |
-pkg_postinst() { |
682 |
- ebegin "Running 'c_rehash ${EROOT}${SSL_CNF_DIR}/certs/' to rebuild hashes #333069" |
683 |
- c_rehash "${EROOT}${SSL_CNF_DIR}/certs" >/dev/null |
684 |
- eend $? |
685 |
-} |
686 |
|
687 |
diff --git a/dev-libs/openssl/openssl-1.1.0k-r1.ebuild b/dev-libs/openssl/openssl-1.1.0k-r1.ebuild |
688 |
deleted file mode 100644 |
689 |
index 7bcd5d03e7e..00000000000 |
690 |
--- a/dev-libs/openssl/openssl-1.1.0k-r1.ebuild |
691 |
+++ /dev/null |
692 |
@@ -1,300 +0,0 @@ |
693 |
-# Copyright 1999-2019 Gentoo Authors |
694 |
-# Distributed under the terms of the GNU General Public License v2 |
695 |
- |
696 |
-EAPI="7" |
697 |
- |
698 |
-inherit flag-o-matic toolchain-funcs multilib multilib-minimal |
699 |
- |
700 |
-MY_P=${P/_/-} |
701 |
- |
702 |
-# This patch set is based on the following files from Fedora 31, |
703 |
-# see https://src.fedoraproject.org/rpms/openssl/blob/f28/f/openssl.spec |
704 |
-# for more details: |
705 |
-# - hobble-openssl (SOURCE1) |
706 |
-# - ec_curve.c (SOURCE12) |
707 |
-# - ectest.c (SOURCE13) |
708 |
-# - openssl-1.1.0-ec-curves.patch (PATCH37) -- MODIFIED |
709 |
-BINDIST_PATCH_SET="openssl-1.1.0k-bindist-1.0.tar.xz" |
710 |
- |
711 |
-DESCRIPTION="full-strength general purpose cryptography library (including SSL and TLS)" |
712 |
-HOMEPAGE="https://www.openssl.org/" |
713 |
-SRC_URI="mirror://openssl/source/${MY_P}.tar.gz |
714 |
- bindist? ( https://dev.gentoo.org/~whissi/dist/openssl/${BINDIST_PATCH_SET} )" |
715 |
- |
716 |
-LICENSE="openssl" |
717 |
-SLOT="0/1.1" # .so version of libssl/libcrypto |
718 |
-KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~x86-fbsd ~x86-linux" |
719 |
-IUSE="+asm bindist elibc_musl rfc3779 sctp cpu_flags_x86_sse2 sslv3 static-libs test tls-heartbeat vanilla zlib" |
720 |
-RESTRICT="!bindist? ( bindist )" |
721 |
- |
722 |
-RDEPEND=">=app-misc/c_rehash-1.7-r1 |
723 |
- zlib? ( >=sys-libs/zlib-1.2.8-r1[static-libs(+)?,${MULTILIB_USEDEP}] )" |
724 |
-DEPEND="${RDEPEND}" |
725 |
-BDEPEND=" |
726 |
- >=dev-lang/perl-5 |
727 |
- sctp? ( >=net-misc/lksctp-tools-1.0.12 ) |
728 |
- test? ( |
729 |
- sys-apps/diffutils |
730 |
- sys-devel/bc |
731 |
- )" |
732 |
-PDEPEND="app-misc/ca-certificates" |
733 |
- |
734 |
-PATCHES=( |
735 |
- "${FILESDIR}"/${PN}-1.0.2a-x32-asm.patch #542618 |
736 |
- "${FILESDIR}"/${PN}-1.1.0j-parallel_install_fix.patch #671602 |
737 |
- "${FILESDIR}"/${PN}-1.1.0k-fix-test_fuzz.patch |
738 |
-) |
739 |
- |
740 |
-S="${WORKDIR}/${MY_P}" |
741 |
- |
742 |
-MULTILIB_WRAPPED_HEADERS=( |
743 |
- usr/include/openssl/opensslconf.h |
744 |
-) |
745 |
- |
746 |
-src_prepare() { |
747 |
- if use bindist; then |
748 |
- mv "${WORKDIR}"/bindist-patches/hobble-openssl "${WORKDIR}" || die |
749 |
- bash "${WORKDIR}"/hobble-openssl || die |
750 |
- |
751 |
- cp -f "${WORKDIR}"/bindist-patches/ec_curve.c "${S}"/crypto/ec/ || die |
752 |
- cp -f "${WORKDIR}"/bindist-patches/ectest.c "${S}"/test/ || die |
753 |
- |
754 |
- eapply "${WORKDIR}"/bindist-patches/ec-curves.patch |
755 |
- |
756 |
- local known_failing_test |
757 |
- for known_failing_test in \ |
758 |
- 30-test_evp_extra.t \ |
759 |
- 80-test_ssl_new.t \ |
760 |
- ; do |
761 |
- ebegin "Disabling test '${known_failing_test}' which is known to fail with USE=bindist" |
762 |
- rm test/recipes/${known_failing_test} || die |
763 |
- eend $? |
764 |
- done |
765 |
- |
766 |
- # Also see the configure parts below: |
767 |
- # enable-ec \ |
768 |
- # $(use_ssl !bindist ec2m) \ |
769 |
- fi |
770 |
- |
771 |
- # keep this in sync with app-misc/c_rehash |
772 |
- SSL_CNF_DIR="/etc/ssl" |
773 |
- |
774 |
- # Make sure we only ever touch Makefile.org and avoid patching a file |
775 |
- # that gets blown away anyways by the Configure script in src_configure |
776 |
- rm -f Makefile |
777 |
- |
778 |
- if ! use vanilla ; then |
779 |
- if [[ $(declare -p PATCHES 2>/dev/null) == "declare -a"* ]] ; then |
780 |
- [[ ${#PATCHES[@]} -gt 0 ]] && eapply "${PATCHES[@]}" |
781 |
- fi |
782 |
- fi |
783 |
- |
784 |
- eapply_user #332661 |
785 |
- |
786 |
- # make sure the man pages are suffixed #302165 |
787 |
- # don't bother building man pages if they're disabled |
788 |
- # Make DOCDIR Gentoo compliant |
789 |
- sed -i \ |
790 |
- -e '/^MANSUFFIX/s:=.*:=ssl:' \ |
791 |
- -e '/^MAKEDEPPROG/s:=.*:=$(CC):' \ |
792 |
- -e $(has noman FEATURES \ |
793 |
- && echo '/^install:/s:install_docs::' \ |
794 |
- || echo '/^MANDIR=/s:=.*:='${EPREFIX}'/usr/share/man:') \ |
795 |
- -e "/^DOCDIR/s@\$(BASENAME)@&-${PVR}@" \ |
796 |
- Configurations/unix-Makefile.tmpl \ |
797 |
- || die |
798 |
- |
799 |
- # show the actual commands in the log |
800 |
- sed -i '/^SET_X/s@=.*@=set -x@' Makefile.shared || die |
801 |
- |
802 |
- # quiet out unknown driver argument warnings since openssl |
803 |
- # doesn't have well-split CFLAGS and we're making it even worse |
804 |
- # and 'make depend' uses -Werror for added fun (#417795 again) |
805 |
- [[ ${CC} == *clang* ]] && append-flags -Qunused-arguments |
806 |
- |
807 |
- # allow openssl to be cross-compiled |
808 |
- cp "${FILESDIR}"/gentoo.config-1.0.2 gentoo.config || die |
809 |
- chmod a+rx gentoo.config || die |
810 |
- |
811 |
- append-flags -fno-strict-aliasing |
812 |
- append-flags $(test-flags-CC -Wa,--noexecstack) |
813 |
- append-cppflags -DOPENSSL_NO_BUF_FREELISTS |
814 |
- |
815 |
- # Prefixify Configure shebang (#141906) |
816 |
- sed \ |
817 |
- -e "1s,/usr/bin/env,${EPREFIX}&," \ |
818 |
- -i Configure || die |
819 |
- # Remove test target when FEATURES=test isn't set |
820 |
- if ! use test ; then |
821 |
- sed \ |
822 |
- -e '/^$config{dirs}/s@ "test",@@' \ |
823 |
- -i Configure || die |
824 |
- fi |
825 |
- # The config script does stupid stuff to prompt the user. Kill it. |
826 |
- sed -i '/stty -icanon min 0 time 50; read waste/d' config || die |
827 |
- ./config --test-sanity || die "I AM NOT SANE" |
828 |
- |
829 |
- multilib_copy_sources |
830 |
-} |
831 |
- |
832 |
-multilib_src_configure() { |
833 |
- unset APPS #197996 |
834 |
- unset SCRIPTS #312551 |
835 |
- unset CROSS_COMPILE #311473 |
836 |
- |
837 |
- tc-export CC AR RANLIB RC |
838 |
- |
839 |
- # Clean out patent-or-otherwise-encumbered code |
840 |
- # Camellia: Royalty Free https://en.wikipedia.org/wiki/Camellia_(cipher) |
841 |
- # IDEA: Expired https://en.wikipedia.org/wiki/International_Data_Encryption_Algorithm |
842 |
- # EC: ????????? ??/??/2015 https://en.wikipedia.org/wiki/Elliptic_Curve_Cryptography |
843 |
- # MDC2: Expired https://en.wikipedia.org/wiki/MDC-2 |
844 |
- # RC5: Expired https://en.wikipedia.org/wiki/RC5 |
845 |
- |
846 |
- use_ssl() { usex $1 "enable-${2:-$1}" "no-${2:-$1}" " ${*:3}" ; } |
847 |
- echoit() { echo "$@" ; "$@" ; } |
848 |
- |
849 |
- local krb5=$(has_version app-crypt/mit-krb5 && echo "MIT" || echo "Heimdal") |
850 |
- |
851 |
- # See if our toolchain supports __uint128_t. If so, it's 64bit |
852 |
- # friendly and can use the nicely optimized code paths. #460790 |
853 |
- local ec_nistp_64_gcc_128 |
854 |
- # Disable it for now though #469976 |
855 |
- #if ! use bindist ; then |
856 |
- # echo "__uint128_t i;" > "${T}"/128.c |
857 |
- # if ${CC} ${CFLAGS} -c "${T}"/128.c -o /dev/null >&/dev/null ; then |
858 |
- # ec_nistp_64_gcc_128="enable-ec_nistp_64_gcc_128" |
859 |
- # fi |
860 |
- #fi |
861 |
- |
862 |
- local sslout=$(./gentoo.config) |
863 |
- einfo "Use configuration ${sslout:-(openssl knows best)}" |
864 |
- local config="Configure" |
865 |
- [[ -z ${sslout} ]] && config="config" |
866 |
- |
867 |
- # Fedora hobbled-EC needs 'no-ec2m' |
868 |
- # 'srp' was restricted until early 2017 as well. |
869 |
- # "disable-deprecated" option breaks too many consumers. |
870 |
- # Don't set it without thorough revdeps testing. |
871 |
- # Make sure user flags don't get added *yet* to avoid duplicated |
872 |
- # flags. |
873 |
- CFLAGS= LDFLAGS= echoit \ |
874 |
- ./${config} \ |
875 |
- ${sslout} \ |
876 |
- $(use cpu_flags_x86_sse2 || echo "no-sse2") \ |
877 |
- enable-camellia \ |
878 |
- enable-ec \ |
879 |
- $(use_ssl !bindist ec2m) \ |
880 |
- enable-srp \ |
881 |
- $(use elibc_musl && echo "no-async") \ |
882 |
- ${ec_nistp_64_gcc_128} \ |
883 |
- enable-idea \ |
884 |
- enable-mdc2 \ |
885 |
- enable-rc5 \ |
886 |
- $(use_ssl sslv3 ssl3) \ |
887 |
- $(use_ssl sslv3 ssl3-method) \ |
888 |
- $(use_ssl asm) \ |
889 |
- $(use_ssl rfc3779) \ |
890 |
- $(use_ssl sctp) \ |
891 |
- $(use_ssl tls-heartbeat heartbeats) \ |
892 |
- $(use_ssl zlib) \ |
893 |
- --prefix="${EPREFIX}"/usr \ |
894 |
- --openssldir="${EPREFIX}"${SSL_CNF_DIR} \ |
895 |
- --libdir=$(get_libdir) \ |
896 |
- shared threads \ |
897 |
- || die |
898 |
- |
899 |
- # Clean out hardcoded flags that openssl uses |
900 |
- local DEFAULT_CFLAGS=$(grep ^CFLAGS= Makefile | LC_ALL=C sed \ |
901 |
- -e 's:^CFLAGS=::' \ |
902 |
- -e 's:\(^\| \)-fomit-frame-pointer::g' \ |
903 |
- -e 's:\(^\| \)-O[^ ]*::g' \ |
904 |
- -e 's:\(^\| \)-march=[^ ]*::g' \ |
905 |
- -e 's:\(^\| \)-mcpu=[^ ]*::g' \ |
906 |
- -e 's:\(^\| \)-m[^ ]*::g' \ |
907 |
- -e 's:^ *::' \ |
908 |
- -e 's: *$::' \ |
909 |
- -e 's: \+: :g' \ |
910 |
- -e 's:\\:\\\\:g' |
911 |
- ) |
912 |
- |
913 |
- # Now insert clean default flags with user flags |
914 |
- sed -i \ |
915 |
- -e "/^CFLAGS=/s|=.*|=${DEFAULT_CFLAGS} ${CFLAGS}|" \ |
916 |
- -e "/^LDFLAGS=/s|=[[:space:]]*$|=${LDFLAGS}|" \ |
917 |
- Makefile || die |
918 |
-} |
919 |
- |
920 |
-multilib_src_compile() { |
921 |
- # depend is needed to use $confopts; it also doesn't matter |
922 |
- # that it's -j1 as the code itself serializes subdirs |
923 |
- emake -j1 depend |
924 |
- emake all |
925 |
-} |
926 |
- |
927 |
-multilib_src_test() { |
928 |
- emake -j1 test |
929 |
-} |
930 |
- |
931 |
-multilib_src_install() { |
932 |
- # We need to create $ED/usr on our own to avoid a race condition #665130 |
933 |
- if [[ ! -d "${ED}/usr" ]]; then |
934 |
- # We can only create this directory once |
935 |
- mkdir "${ED}"/usr || die |
936 |
- fi |
937 |
- |
938 |
- emake DESTDIR="${D}" install |
939 |
-} |
940 |
- |
941 |
-multilib_src_install_all() { |
942 |
- # openssl installs perl version of c_rehash by default, but |
943 |
- # we provide a shell version via app-misc/c_rehash |
944 |
- rm "${ED}"/usr/bin/c_rehash || die |
945 |
- |
946 |
- dodoc CHANGES* FAQ NEWS README doc/*.txt doc/${PN}-c-indent.el |
947 |
- |
948 |
- # This is crappy in that the static archives are still built even |
949 |
- # when USE=static-libs. But this is due to a failing in the openssl |
950 |
- # build system: the static archives are built as PIC all the time. |
951 |
- # Only way around this would be to manually configure+compile openssl |
952 |
- # twice; once with shared lib support enabled and once without. |
953 |
- use static-libs || rm -f "${ED}"/usr/lib*/lib*.a |
954 |
- |
955 |
- # create the certs directory |
956 |
- keepdir ${SSL_CNF_DIR}/certs |
957 |
- |
958 |
- # Namespace openssl programs to prevent conflicts with other man pages |
959 |
- cd "${ED}"/usr/share/man || die |
960 |
- local m d s |
961 |
- for m in $(find . -type f | xargs grep -L '#include') ; do |
962 |
- d=${m%/*} ; d=${d#./} ; m=${m##*/} |
963 |
- [[ ${m} == openssl.1* ]] && continue |
964 |
- [[ -n $(find -L ${d} -type l) ]] && die "erp, broken links already!" |
965 |
- mv ${d}/{,ssl-}${m} |
966 |
- # fix up references to renamed man pages |
967 |
- sed -i '/^[.]SH "SEE ALSO"/,/^[.]/s:\([^(, ]*(1)\):ssl-\1:g' ${d}/ssl-${m} |
968 |
- ln -s ssl-${m} ${d}/openssl-${m} |
969 |
- # locate any symlinks that point to this man page ... we assume |
970 |
- # that any broken links are due to the above renaming |
971 |
- for s in $(find -L ${d} -type l) ; do |
972 |
- s=${s##*/} |
973 |
- rm -f ${d}/${s} |
974 |
- # We don't want to "|| die" here |
975 |
- ln -s ssl-${m} ${d}/ssl-${s} |
976 |
- ln -s ssl-${s} ${d}/openssl-${s} |
977 |
- done |
978 |
- done |
979 |
- [[ -n $(find -L ${d} -type l) ]] && die "broken manpage links found :(" |
980 |
- |
981 |
- dodir /etc/sandbox.d #254521 |
982 |
- echo 'SANDBOX_PREDICT="/dev/crypto"' > "${ED}"/etc/sandbox.d/10openssl |
983 |
- |
984 |
- diropts -m0700 |
985 |
- keepdir ${SSL_CNF_DIR}/private |
986 |
-} |
987 |
- |
988 |
-pkg_postinst() { |
989 |
- ebegin "Running 'c_rehash ${EROOT}${SSL_CNF_DIR}/certs/' to rebuild hashes #333069" |
990 |
- c_rehash "${EROOT}${SSL_CNF_DIR}/certs" >/dev/null |
991 |
- eend $? |
992 |
-} |
993 |
|
994 |
diff --git a/dev-libs/openssl/openssl-1.1.1c-r1.ebuild b/dev-libs/openssl/openssl-1.1.1c-r1.ebuild |
995 |
deleted file mode 100644 |
996 |
index a3a0f2a2c06..00000000000 |
997 |
--- a/dev-libs/openssl/openssl-1.1.1c-r1.ebuild |
998 |
+++ /dev/null |
999 |
@@ -1,296 +0,0 @@ |
1000 |
-# Copyright 1999-2019 Gentoo Authors |
1001 |
-# Distributed under the terms of the GNU General Public License v2 |
1002 |
- |
1003 |
-EAPI="7" |
1004 |
- |
1005 |
-inherit flag-o-matic toolchain-funcs multilib multilib-minimal |
1006 |
- |
1007 |
-MY_P=${P/_/-} |
1008 |
- |
1009 |
-# This patch set is based on the following files from Fedora 31, |
1010 |
-# see https://src.fedoraproject.org/rpms/openssl/blob/f31/f/openssl.spec |
1011 |
-# for more details: |
1012 |
-# - hobble-openssl (SOURCE1) |
1013 |
-# - ec_curve.c (SOURCE12) |
1014 |
-# - ectest.c (SOURCE13) |
1015 |
-# - openssl-1.1.1-ec-curves.patch (PATCH37) -- MODIFIED |
1016 |
-BINDIST_PATCH_SET="openssl-1.1.1c-bindist-1.0.tar.xz" |
1017 |
- |
1018 |
-DESCRIPTION="full-strength general purpose cryptography library (including SSL and TLS)" |
1019 |
-HOMEPAGE="https://www.openssl.org/" |
1020 |
-SRC_URI="mirror://openssl/source/${MY_P}.tar.gz |
1021 |
- bindist? ( https://dev.gentoo.org/~whissi/dist/openssl/${BINDIST_PATCH_SET} )" |
1022 |
- |
1023 |
-LICENSE="openssl" |
1024 |
-SLOT="0/1.1" # .so version of libssl/libcrypto |
1025 |
-[[ "${PV}" = *_pre* ]] || \ |
1026 |
-KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~x86-fbsd ~x86-linux" |
1027 |
-IUSE="+asm bindist elibc_musl rfc3779 sctp cpu_flags_x86_sse2 sslv3 static-libs test tls-heartbeat vanilla zlib" |
1028 |
-RESTRICT="!bindist? ( bindist )" |
1029 |
- |
1030 |
-RDEPEND=">=app-misc/c_rehash-1.7-r1 |
1031 |
- zlib? ( >=sys-libs/zlib-1.2.8-r1[static-libs(+)?,${MULTILIB_USEDEP}] )" |
1032 |
-DEPEND="${RDEPEND}" |
1033 |
-BDEPEND=" |
1034 |
- >=dev-lang/perl-5 |
1035 |
- sctp? ( >=net-misc/lksctp-tools-1.0.12 ) |
1036 |
- test? ( |
1037 |
- sys-apps/diffutils |
1038 |
- sys-devel/bc |
1039 |
- )" |
1040 |
-PDEPEND="app-misc/ca-certificates" |
1041 |
- |
1042 |
-PATCHES=( |
1043 |
- "${FILESDIR}"/${PN}-1.1.0j-parallel_install_fix.patch #671602 |
1044 |
-) |
1045 |
- |
1046 |
-S="${WORKDIR}/${MY_P}" |
1047 |
- |
1048 |
-MULTILIB_WRAPPED_HEADERS=( |
1049 |
- usr/include/openssl/opensslconf.h |
1050 |
-) |
1051 |
- |
1052 |
-src_prepare() { |
1053 |
- if use bindist; then |
1054 |
- mv "${WORKDIR}"/bindist-patches/hobble-openssl "${WORKDIR}" || die |
1055 |
- bash "${WORKDIR}"/hobble-openssl || die |
1056 |
- |
1057 |
- cp -f "${WORKDIR}"/bindist-patches/ec_curve.c "${S}"/crypto/ec/ || die |
1058 |
- cp -f "${WORKDIR}"/bindist-patches/ectest.c "${S}"/test/ || die |
1059 |
- |
1060 |
- eapply "${WORKDIR}"/bindist-patches/ec-curves.patch |
1061 |
- |
1062 |
- local known_failing_test |
1063 |
- for known_failing_test in \ |
1064 |
- 30-test_evp_extra.t \ |
1065 |
- 80-test_ssl_new.t \ |
1066 |
- ; do |
1067 |
- ebegin "Disabling test '${known_failing_test}' which is known to fail with USE=bindist" |
1068 |
- rm test/recipes/${known_failing_test} || die |
1069 |
- eend $? |
1070 |
- done |
1071 |
- |
1072 |
- # Also see the configure parts below: |
1073 |
- # enable-ec \ |
1074 |
- # $(use_ssl !bindist ec2m) \ |
1075 |
- fi |
1076 |
- |
1077 |
- # keep this in sync with app-misc/c_rehash |
1078 |
- SSL_CNF_DIR="/etc/ssl" |
1079 |
- |
1080 |
- # Make sure we only ever touch Makefile.org and avoid patching a file |
1081 |
- # that gets blown away anyways by the Configure script in src_configure |
1082 |
- rm -f Makefile |
1083 |
- |
1084 |
- if ! use vanilla ; then |
1085 |
- if [[ $(declare -p PATCHES 2>/dev/null) == "declare -a"* ]] ; then |
1086 |
- [[ ${#PATCHES[@]} -gt 0 ]] && eapply "${PATCHES[@]}" |
1087 |
- fi |
1088 |
- fi |
1089 |
- |
1090 |
- eapply_user #332661 |
1091 |
- |
1092 |
- # make sure the man pages are suffixed #302165 |
1093 |
- # don't bother building man pages if they're disabled |
1094 |
- # Make DOCDIR Gentoo compliant |
1095 |
- sed -i \ |
1096 |
- -e '/^MANSUFFIX/s:=.*:=ssl:' \ |
1097 |
- -e '/^MAKEDEPPROG/s:=.*:=$(CC):' \ |
1098 |
- -e $(has noman FEATURES \ |
1099 |
- && echo '/^install:/s:install_docs::' \ |
1100 |
- || echo '/^MANDIR=/s:=.*:='${EPREFIX}'/usr/share/man:') \ |
1101 |
- -e "/^DOCDIR/s@\$(BASENAME)@&-${PVR}@" \ |
1102 |
- Configurations/unix-Makefile.tmpl \ |
1103 |
- || die |
1104 |
- |
1105 |
- # quiet out unknown driver argument warnings since openssl |
1106 |
- # doesn't have well-split CFLAGS and we're making it even worse |
1107 |
- # and 'make depend' uses -Werror for added fun (#417795 again) |
1108 |
- [[ ${CC} == *clang* ]] && append-flags -Qunused-arguments |
1109 |
- |
1110 |
- # allow openssl to be cross-compiled |
1111 |
- cp "${FILESDIR}"/gentoo.config-1.0.2 gentoo.config || die |
1112 |
- chmod a+rx gentoo.config || die |
1113 |
- |
1114 |
- append-flags -fno-strict-aliasing |
1115 |
- append-flags $(test-flags-CC -Wa,--noexecstack) |
1116 |
- append-cppflags -DOPENSSL_NO_BUF_FREELISTS |
1117 |
- |
1118 |
- # Prefixify Configure shebang (#141906) |
1119 |
- sed \ |
1120 |
- -e "1s,/usr/bin/env,${EPREFIX}&," \ |
1121 |
- -i Configure || die |
1122 |
- # Remove test target when FEATURES=test isn't set |
1123 |
- if ! use test ; then |
1124 |
- sed \ |
1125 |
- -e '/^$config{dirs}/s@ "test",@@' \ |
1126 |
- -i Configure || die |
1127 |
- fi |
1128 |
- # The config script does stupid stuff to prompt the user. Kill it. |
1129 |
- sed -i '/stty -icanon min 0 time 50; read waste/d' config || die |
1130 |
- ./config --test-sanity || die "I AM NOT SANE" |
1131 |
- |
1132 |
- multilib_copy_sources |
1133 |
-} |
1134 |
- |
1135 |
-multilib_src_configure() { |
1136 |
- unset APPS #197996 |
1137 |
- unset SCRIPTS #312551 |
1138 |
- unset CROSS_COMPILE #311473 |
1139 |
- |
1140 |
- tc-export CC AR RANLIB RC |
1141 |
- |
1142 |
- # Clean out patent-or-otherwise-encumbered code |
1143 |
- # Camellia: Royalty Free https://en.wikipedia.org/wiki/Camellia_(cipher) |
1144 |
- # IDEA: Expired https://en.wikipedia.org/wiki/International_Data_Encryption_Algorithm |
1145 |
- # EC: ????????? ??/??/2015 https://en.wikipedia.org/wiki/Elliptic_Curve_Cryptography |
1146 |
- # MDC2: Expired https://en.wikipedia.org/wiki/MDC-2 |
1147 |
- # RC5: Expired https://en.wikipedia.org/wiki/RC5 |
1148 |
- |
1149 |
- use_ssl() { usex $1 "enable-${2:-$1}" "no-${2:-$1}" " ${*:3}" ; } |
1150 |
- echoit() { echo "$@" ; "$@" ; } |
1151 |
- |
1152 |
- local krb5=$(has_version app-crypt/mit-krb5 && echo "MIT" || echo "Heimdal") |
1153 |
- |
1154 |
- # See if our toolchain supports __uint128_t. If so, it's 64bit |
1155 |
- # friendly and can use the nicely optimized code paths. #460790 |
1156 |
- local ec_nistp_64_gcc_128 |
1157 |
- # Disable it for now though #469976 |
1158 |
- #if ! use bindist ; then |
1159 |
- # echo "__uint128_t i;" > "${T}"/128.c |
1160 |
- # if ${CC} ${CFLAGS} -c "${T}"/128.c -o /dev/null >&/dev/null ; then |
1161 |
- # ec_nistp_64_gcc_128="enable-ec_nistp_64_gcc_128" |
1162 |
- # fi |
1163 |
- #fi |
1164 |
- |
1165 |
- local sslout=$(./gentoo.config) |
1166 |
- einfo "Use configuration ${sslout:-(openssl knows best)}" |
1167 |
- local config="Configure" |
1168 |
- [[ -z ${sslout} ]] && config="config" |
1169 |
- |
1170 |
- # Fedora hobbled-EC needs 'no-ec2m' |
1171 |
- # 'srp' was restricted until early 2017 as well. |
1172 |
- # "disable-deprecated" option breaks too many consumers. |
1173 |
- # Don't set it without thorough revdeps testing. |
1174 |
- # Make sure user flags don't get added *yet* to avoid duplicated |
1175 |
- # flags. |
1176 |
- CFLAGS= LDFLAGS= echoit \ |
1177 |
- ./${config} \ |
1178 |
- ${sslout} \ |
1179 |
- $(use cpu_flags_x86_sse2 || echo "no-sse2") \ |
1180 |
- enable-camellia \ |
1181 |
- enable-ec \ |
1182 |
- $(use_ssl !bindist ec2m) \ |
1183 |
- enable-srp \ |
1184 |
- $(use elibc_musl && echo "no-async") \ |
1185 |
- ${ec_nistp_64_gcc_128} \ |
1186 |
- enable-idea \ |
1187 |
- enable-mdc2 \ |
1188 |
- enable-rc5 \ |
1189 |
- $(use_ssl sslv3 ssl3) \ |
1190 |
- $(use_ssl sslv3 ssl3-method) \ |
1191 |
- $(use_ssl asm) \ |
1192 |
- $(use_ssl rfc3779) \ |
1193 |
- $(use_ssl sctp) \ |
1194 |
- $(use_ssl tls-heartbeat heartbeats) \ |
1195 |
- $(use_ssl zlib) \ |
1196 |
- --prefix="${EPREFIX}"/usr \ |
1197 |
- --openssldir="${EPREFIX}"${SSL_CNF_DIR} \ |
1198 |
- --libdir=$(get_libdir) \ |
1199 |
- shared threads \ |
1200 |
- || die |
1201 |
- |
1202 |
- # Clean out hardcoded flags that openssl uses |
1203 |
- local DEFAULT_CFLAGS=$(grep ^CFLAGS= Makefile | LC_ALL=C sed \ |
1204 |
- -e 's:^CFLAGS=::' \ |
1205 |
- -e 's:\(^\| \)-fomit-frame-pointer::g' \ |
1206 |
- -e 's:\(^\| \)-O[^ ]*::g' \ |
1207 |
- -e 's:\(^\| \)-march=[^ ]*::g' \ |
1208 |
- -e 's:\(^\| \)-mcpu=[^ ]*::g' \ |
1209 |
- -e 's:\(^\| \)-m[^ ]*::g' \ |
1210 |
- -e 's:^ *::' \ |
1211 |
- -e 's: *$::' \ |
1212 |
- -e 's: \+: :g' \ |
1213 |
- -e 's:\\:\\\\:g' |
1214 |
- ) |
1215 |
- |
1216 |
- # Now insert clean default flags with user flags |
1217 |
- sed -i \ |
1218 |
- -e "/^CFLAGS=/s|=.*|=${DEFAULT_CFLAGS} ${CFLAGS}|" \ |
1219 |
- -e "/^LDFLAGS=/s|=[[:space:]]*$|=${LDFLAGS}|" \ |
1220 |
- Makefile || die |
1221 |
-} |
1222 |
- |
1223 |
-multilib_src_compile() { |
1224 |
- # depend is needed to use $confopts; it also doesn't matter |
1225 |
- # that it's -j1 as the code itself serializes subdirs |
1226 |
- emake -j1 depend |
1227 |
- emake all |
1228 |
-} |
1229 |
- |
1230 |
-multilib_src_test() { |
1231 |
- emake -j1 test |
1232 |
-} |
1233 |
- |
1234 |
-multilib_src_install() { |
1235 |
- # We need to create $ED/usr on our own to avoid a race condition #665130 |
1236 |
- if [[ ! -d "${ED}/usr" ]]; then |
1237 |
- # We can only create this directory once |
1238 |
- mkdir "${ED}"/usr || die |
1239 |
- fi |
1240 |
- |
1241 |
- emake DESTDIR="${D}" install |
1242 |
-} |
1243 |
- |
1244 |
-multilib_src_install_all() { |
1245 |
- # openssl installs perl version of c_rehash by default, but |
1246 |
- # we provide a shell version via app-misc/c_rehash |
1247 |
- rm "${ED}"/usr/bin/c_rehash || die |
1248 |
- |
1249 |
- dodoc CHANGES* FAQ NEWS README doc/*.txt doc/${PN}-c-indent.el |
1250 |
- |
1251 |
- # This is crappy in that the static archives are still built even |
1252 |
- # when USE=static-libs. But this is due to a failing in the openssl |
1253 |
- # build system: the static archives are built as PIC all the time. |
1254 |
- # Only way around this would be to manually configure+compile openssl |
1255 |
- # twice; once with shared lib support enabled and once without. |
1256 |
- use static-libs || rm -f "${ED}"/usr/lib*/lib*.a |
1257 |
- |
1258 |
- # create the certs directory |
1259 |
- keepdir ${SSL_CNF_DIR}/certs |
1260 |
- |
1261 |
- # Namespace openssl programs to prevent conflicts with other man pages |
1262 |
- cd "${ED}"/usr/share/man || die |
1263 |
- local m d s |
1264 |
- for m in $(find . -type f | xargs grep -L '#include') ; do |
1265 |
- d=${m%/*} ; d=${d#./} ; m=${m##*/} |
1266 |
- [[ ${m} == openssl.1* ]] && continue |
1267 |
- [[ -n $(find -L ${d} -type l) ]] && die "erp, broken links already!" |
1268 |
- mv ${d}/{,ssl-}${m} |
1269 |
- # fix up references to renamed man pages |
1270 |
- sed -i '/^[.]SH "SEE ALSO"/,/^[.]/s:\([^(, ]*(1)\):ssl-\1:g' ${d}/ssl-${m} |
1271 |
- ln -s ssl-${m} ${d}/openssl-${m} |
1272 |
- # locate any symlinks that point to this man page ... we assume |
1273 |
- # that any broken links are due to the above renaming |
1274 |
- for s in $(find -L ${d} -type l) ; do |
1275 |
- s=${s##*/} |
1276 |
- rm -f ${d}/${s} |
1277 |
- # We don't want to "|| die" here |
1278 |
- ln -s ssl-${m} ${d}/ssl-${s} |
1279 |
- ln -s ssl-${s} ${d}/openssl-${s} |
1280 |
- done |
1281 |
- done |
1282 |
- [[ -n $(find -L ${d} -type l) ]] && die "broken manpage links found :(" |
1283 |
- |
1284 |
- dodir /etc/sandbox.d #254521 |
1285 |
- echo 'SANDBOX_PREDICT="/dev/crypto"' > "${ED}"/etc/sandbox.d/10openssl |
1286 |
- |
1287 |
- diropts -m0700 |
1288 |
- keepdir ${SSL_CNF_DIR}/private |
1289 |
-} |
1290 |
- |
1291 |
-pkg_postinst() { |
1292 |
- ebegin "Running 'c_rehash ${EROOT}${SSL_CNF_DIR}/certs/' to rebuild hashes #333069" |
1293 |
- c_rehash "${EROOT}${SSL_CNF_DIR}/certs" >/dev/null |
1294 |
- eend $? |
1295 |
-} |