1 |
commit: 88b866871abbac089263a5cdf5a74f7da9dc76fb |
2 |
Author: Lars Wendler <polynomial-c <AT> gentoo <DOT> org> |
3 |
AuthorDate: Wed Apr 25 08:32:03 2018 +0000 |
4 |
Commit: Lars Wendler <polynomial-c <AT> gentoo <DOT> org> |
5 |
CommitDate: Wed Apr 25 08:32:21 2018 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=88b86687 |
7 |
|
8 |
dev-libs/openssl: Bump to version 1.1.1_pre5 |
9 |
|
10 |
Package-Manager: Portage-2.3.31, Repoman-2.3.9 |
11 |
|
12 |
dev-libs/openssl/Manifest | 4 + |
13 |
dev-libs/openssl/openssl-1.1.1_pre5.ebuild | 282 +++++++++++++++++++++++++++++ |
14 |
2 files changed, 286 insertions(+) |
15 |
|
16 |
diff --git a/dev-libs/openssl/Manifest b/dev-libs/openssl/Manifest |
17 |
index e0219b43b79..2da8795bde0 100644 |
18 |
--- a/dev-libs/openssl/Manifest |
19 |
+++ b/dev-libs/openssl/Manifest |
20 |
@@ -10,3 +10,7 @@ DIST openssl-1.1.0h.tar.gz 5422717 BLAKE2B 11de1468855c0bb1836fb346c8efdfedd0613 |
21 |
DIST openssl-1.1.0h_ec_curve.c 18393 BLAKE2B 49dca7ddbc23270e5927454925df7bb18c8d9eb58f79e3a4fbcd8b7fc22fad36e2cb54ff9b63c2beeeea15c0c075a96e4ce8d03991355419af41fa9dc2aed3ad SHA512 ee3e576825bccdf02cede4205ab92c42ae9dd3a8e75ce58617a3a5980a61d144eb3c5197d9dcd378a5d49bf34c4b2f591aa6a619fee92b7a22825d72681ab879 |
22 |
DIST openssl-1.1.0h_ectest.c 29907 BLAKE2B 73dc800c1de5449f14d7753f7f7b8e672cd36bd4570e6df07f246d1d823c7dbbeef492f25cdd0ebfd693f5956732bc84c9d91fc6a22c854fe4b245ecf3890bda SHA512 90cec9d46326cb7216236811c8e963032b6fa7500117cea36f28534eb50a5ab1260c7f9a5c8c490d845236b0769576a8d97bc7471f970e9c5e70cb3408c20dae |
23 |
DIST openssl-1.1.0h_hobble-openssl 1117 BLAKE2B c3a1477e63331e83cf1cbe58e9ef131ec500a311e22d3da55034800ca353c387b2e202575acf3badb00b236ff91d4bac1bb131a33930939646d26bec27be6e04 SHA512 fa9cc70afa11a7a292548b4bddbba8159824a364ce5c279b483768e6ae2aa4b5491d9bf2cc734819f30a11c8ee0d91bcb991c4a7ab357296aeb4c04feac74826 |
24 |
+DIST openssl-1.1.1-pre5.tar.gz 8288689 BLAKE2B f65c797a8cce6e2240008ed842d9bc7667ef4bb792a141a0832f475b51b1e499786fa2bab87977aa58f8edaba7c35be1a67563bc8a6d0e41fcf1a3c95961b877 SHA512 dfdf4ee2e0f05ff9af5ecd7305bad4ff8d587c08ea675055048d7eae2a8e38fe74c2e63b13facd95ccbcb586be2d6e388088c567380af64f0ccc88095a881173 |
25 |
+DIST openssl-1.1.1_pre5_ec_curve.c 18393 BLAKE2B 49dca7ddbc23270e5927454925df7bb18c8d9eb58f79e3a4fbcd8b7fc22fad36e2cb54ff9b63c2beeeea15c0c075a96e4ce8d03991355419af41fa9dc2aed3ad SHA512 ee3e576825bccdf02cede4205ab92c42ae9dd3a8e75ce58617a3a5980a61d144eb3c5197d9dcd378a5d49bf34c4b2f591aa6a619fee92b7a22825d72681ab879 |
26 |
+DIST openssl-1.1.1_pre5_ectest.c 29908 BLAKE2B b398bafd5d5aea71daa9c3e2749dece9e515950e35547a6191d83987907aae73e090a4b552636af4d1ab2b39f7e3b1ea3fde2012c99f068f9c99d247996c1212 SHA512 e4445f8959b040caca6a7494da2026b840f84348df5d4eab47a68570d274333f62fa0c381955093edd86c857dad98595ffa2980c54afdcf2a8d32f32d0c70450 |
27 |
+DIST openssl-1.1.1_pre5_hobble-openssl 1117 BLAKE2B c3a1477e63331e83cf1cbe58e9ef131ec500a311e22d3da55034800ca353c387b2e202575acf3badb00b236ff91d4bac1bb131a33930939646d26bec27be6e04 SHA512 fa9cc70afa11a7a292548b4bddbba8159824a364ce5c279b483768e6ae2aa4b5491d9bf2cc734819f30a11c8ee0d91bcb991c4a7ab357296aeb4c04feac74826 |
28 |
|
29 |
diff --git a/dev-libs/openssl/openssl-1.1.1_pre5.ebuild b/dev-libs/openssl/openssl-1.1.1_pre5.ebuild |
30 |
new file mode 100644 |
31 |
index 00000000000..57d99704100 |
32 |
--- /dev/null |
33 |
+++ b/dev-libs/openssl/openssl-1.1.1_pre5.ebuild |
34 |
@@ -0,0 +1,282 @@ |
35 |
+# Copyright 1999-2018 Gentoo Foundation |
36 |
+# Distributed under the terms of the GNU General Public License v2 |
37 |
+ |
38 |
+EAPI="6" |
39 |
+ |
40 |
+inherit flag-o-matic toolchain-funcs multilib multilib-minimal |
41 |
+ |
42 |
+MY_P=${P/_/-} |
43 |
+DESCRIPTION="full-strength general purpose cryptography library (including SSL and TLS)" |
44 |
+HOMEPAGE="https://www.openssl.org/" |
45 |
+SRC_URI="mirror://openssl/source/${MY_P}.tar.gz" |
46 |
+ |
47 |
+LICENSE="openssl" |
48 |
+SLOT="0/1.1" # .so version of libssl/libcrypto |
49 |
+[[ "${PV}" = *_pre* ]] || \ |
50 |
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~x86-fbsd ~arm-linux ~x86-linux" |
51 |
+IUSE="+asm bindist elibc_musl rfc3779 sctp cpu_flags_x86_sse2 static-libs test tls-heartbeat vanilla zlib" |
52 |
+RESTRICT="!bindist? ( bindist )" |
53 |
+ |
54 |
+RDEPEND=">=app-misc/c_rehash-1.7-r1 |
55 |
+ zlib? ( >=sys-libs/zlib-1.2.8-r1[static-libs(+)?,${MULTILIB_USEDEP}] )" |
56 |
+DEPEND="${RDEPEND} |
57 |
+ >=dev-lang/perl-5 |
58 |
+ sctp? ( >=net-misc/lksctp-tools-1.0.12 ) |
59 |
+ test? ( |
60 |
+ sys-apps/diffutils |
61 |
+ sys-devel/bc |
62 |
+ )" |
63 |
+PDEPEND="app-misc/ca-certificates" |
64 |
+ |
65 |
+# This does not copy the entire Fedora patchset, but JUST the parts that |
66 |
+# are needed to make it safe to use EC with RESTRICT=bindist. |
67 |
+# See openssl.spec for the matching numbering of SourceNNN, PatchNNN |
68 |
+SOURCE1=hobble-openssl |
69 |
+SOURCE12=ec_curve.c |
70 |
+SOURCE13=ectest.c |
71 |
+PATCH1=openssl-1.1.0-build.patch # Fixes EVP testcase for EC |
72 |
+PATCH37=openssl-1.1.0-ec-curves.patch |
73 |
+FEDORA_GIT_BASE='https://src.fedoraproject.org/cgit/rpms/openssl.git/plain/' |
74 |
+FEDORA_GIT_BRANCH='f27' |
75 |
+FEDORA_SRC_URI=() |
76 |
+FEDORA_SOURCE=( ${SOURCE1} ${SOURCE12} ${SOURCE13} ) |
77 |
+FEDORA_PATCH=( ${PATCH1} ${PATCH37} ) |
78 |
+for i in "${FEDORA_SOURCE[@]}" ; do |
79 |
+ FEDORA_SRC_URI+=( "${FEDORA_GIT_BASE}/${i}?h=${FEDORA_GIT_BRANCH} -> ${P}_${i}" ) |
80 |
+done |
81 |
+for i in "${FEDORA_PATCH[@]}" ; do # Already have a version prefix |
82 |
+ FEDORA_SRC_URI+=( "${FEDORA_GIT_BASE}/${i}?h=${FEDORA_GIT_BRANCH} -> ${i}" ) |
83 |
+done |
84 |
+SRC_URI+=" bindist? ( ${FEDORA_SRC_URI[@]} )" |
85 |
+ |
86 |
+S="${WORKDIR}/${MY_P}" |
87 |
+ |
88 |
+MULTILIB_WRAPPED_HEADERS=( |
89 |
+ usr/include/openssl/opensslconf.h |
90 |
+) |
91 |
+ |
92 |
+PATCHES=( |
93 |
+ "${FILESDIR}"/${PN}-1.0.2a-x32-asm.patch #542618 |
94 |
+) |
95 |
+ |
96 |
+src_prepare() { |
97 |
+ if use bindist; then |
98 |
+ # This just removes the prefix, and puts it into WORKDIR like the RPM. |
99 |
+ for i in "${FEDORA_SOURCE[@]}" ; do |
100 |
+ cp -f "${DISTDIR}"/"${P}_${i}" "${WORKDIR}"/"${i}" || die |
101 |
+ done |
102 |
+ # .spec %prep |
103 |
+ bash "${WORKDIR}"/"${SOURCE1}" || die |
104 |
+ cp -f "${WORKDIR}"/"${SOURCE12}" "${S}"/crypto/ec/ || die |
105 |
+ cp -f "${WORKDIR}"/"${SOURCE13}" "${S}"/test/ || die |
106 |
+ for i in "${FEDORA_PATCH[@]}" ; do |
107 |
+ eapply "${DISTDIR}"/"${i}" |
108 |
+ done |
109 |
+ # Also see the configure parts below: |
110 |
+ # enable-ec \ |
111 |
+ # $(use_ssl !bindist ec2m) \ |
112 |
+ |
113 |
+ fi |
114 |
+ # keep this in sync with app-misc/c_rehash |
115 |
+ SSL_CNF_DIR="/etc/ssl" |
116 |
+ |
117 |
+ # Make sure we only ever touch Makefile.org and avoid patching a file |
118 |
+ # that gets blown away anyways by the Configure script in src_configure |
119 |
+ rm -f Makefile |
120 |
+ |
121 |
+ if ! use vanilla ; then |
122 |
+ eapply "${PATCHES[@]}" |
123 |
+ fi |
124 |
+ |
125 |
+ eapply_user #332661 |
126 |
+ |
127 |
+ # make sure the man pages are suffixed #302165 |
128 |
+ # don't bother building man pages if they're disabled |
129 |
+ # Make DOCDIR Gentoo compliant |
130 |
+ sed -i \ |
131 |
+ -e '/^MANSUFFIX/s:=.*:=ssl:' \ |
132 |
+ -e '/^MAKEDEPPROG/s:=.*:=$(CC):' \ |
133 |
+ -e $(has noman FEATURES \ |
134 |
+ && echo '/^install:/s:install_docs::' \ |
135 |
+ || echo '/^MANDIR=/s:=.*:='${EPREFIX}'/usr/share/man:') \ |
136 |
+ -e "/^DOCDIR/s@\$(BASENAME)@&-${PF}@" \ |
137 |
+ Configurations/unix-Makefile.tmpl \ |
138 |
+ || die |
139 |
+ |
140 |
+ # quiet out unknown driver argument warnings since openssl |
141 |
+ # doesn't have well-split CFLAGS and we're making it even worse |
142 |
+ # and 'make depend' uses -Werror for added fun (#417795 again) |
143 |
+ [[ ${CC} == *clang* ]] && append-flags -Qunused-arguments |
144 |
+ |
145 |
+ # allow openssl to be cross-compiled |
146 |
+ cp "${FILESDIR}"/gentoo.config-1.0.2 gentoo.config || die |
147 |
+ chmod a+rx gentoo.config || die |
148 |
+ |
149 |
+ append-flags -fno-strict-aliasing |
150 |
+ append-flags $(test-flags-CC -Wa,--noexecstack) |
151 |
+ append-cppflags -DOPENSSL_NO_BUF_FREELISTS |
152 |
+ |
153 |
+ # Prefixify Configure shebang (#141906) |
154 |
+ sed \ |
155 |
+ -e "1s,/usr/bin/env,${EPREFIX}&," \ |
156 |
+ -i Configure || die |
157 |
+ # Remove test target when FEATURES=test isn't set |
158 |
+ if ! use test ; then |
159 |
+ sed \ |
160 |
+ -e '/^$config{dirs}/s@ "test",@@' \ |
161 |
+ -i Configure || die |
162 |
+ fi |
163 |
+ # The config script does stupid stuff to prompt the user. Kill it. |
164 |
+ sed -i '/stty -icanon min 0 time 50; read waste/d' config || die |
165 |
+ ./config --test-sanity || die "I AM NOT SANE" |
166 |
+ |
167 |
+ multilib_copy_sources |
168 |
+} |
169 |
+ |
170 |
+multilib_src_configure() { |
171 |
+ unset APPS #197996 |
172 |
+ unset SCRIPTS #312551 |
173 |
+ unset CROSS_COMPILE #311473 |
174 |
+ |
175 |
+ tc-export CC AR RANLIB RC |
176 |
+ |
177 |
+ # Clean out patent-or-otherwise-encumbered code |
178 |
+ # Camellia: Royalty Free https://en.wikipedia.org/wiki/Camellia_(cipher) |
179 |
+ # IDEA: Expired https://en.wikipedia.org/wiki/International_Data_Encryption_Algorithm |
180 |
+ # EC: ????????? ??/??/2015 https://en.wikipedia.org/wiki/Elliptic_Curve_Cryptography |
181 |
+ # MDC2: Expired https://en.wikipedia.org/wiki/MDC-2 |
182 |
+ # RC5: Expired https://en.wikipedia.org/wiki/RC5 |
183 |
+ |
184 |
+ use_ssl() { usex $1 "enable-${2:-$1}" "no-${2:-$1}" " ${*:3}" ; } |
185 |
+ echoit() { echo "$@" ; "$@" ; } |
186 |
+ |
187 |
+ local krb5=$(has_version app-crypt/mit-krb5 && echo "MIT" || echo "Heimdal") |
188 |
+ |
189 |
+ # See if our toolchain supports __uint128_t. If so, it's 64bit |
190 |
+ # friendly and can use the nicely optimized code paths. #460790 |
191 |
+ local ec_nistp_64_gcc_128 |
192 |
+ # Disable it for now though #469976 |
193 |
+ #if ! use bindist ; then |
194 |
+ # echo "__uint128_t i;" > "${T}"/128.c |
195 |
+ # if ${CC} ${CFLAGS} -c "${T}"/128.c -o /dev/null >&/dev/null ; then |
196 |
+ # ec_nistp_64_gcc_128="enable-ec_nistp_64_gcc_128" |
197 |
+ # fi |
198 |
+ #fi |
199 |
+ |
200 |
+ local sslout=$(./gentoo.config) |
201 |
+ einfo "Use configuration ${sslout:-(openssl knows best)}" |
202 |
+ local config="Configure" |
203 |
+ [[ -z ${sslout} ]] && config="config" |
204 |
+ |
205 |
+ # Fedora hobbled-EC needs 'no-ec2m' |
206 |
+ # 'srp' was restricted until early 2017 as well. |
207 |
+ # "disable-deprecated" option breaks too many consumers. |
208 |
+ # Don't set it without thorough revdeps testing. |
209 |
+ echoit \ |
210 |
+ ./${config} \ |
211 |
+ ${sslout} \ |
212 |
+ $(use cpu_flags_x86_sse2 || echo "no-sse2") \ |
213 |
+ enable-camellia \ |
214 |
+ enable-ec \ |
215 |
+ $(use_ssl !bindist ec2m) \ |
216 |
+ enable-srp \ |
217 |
+ $(use elibc_musl && echo "no-async") \ |
218 |
+ ${ec_nistp_64_gcc_128} \ |
219 |
+ enable-idea \ |
220 |
+ enable-mdc2 \ |
221 |
+ enable-rc5 \ |
222 |
+ $(use_ssl asm) \ |
223 |
+ $(use_ssl rfc3779) \ |
224 |
+ $(use_ssl sctp) \ |
225 |
+ $(use_ssl tls-heartbeat heartbeats) \ |
226 |
+ $(use_ssl zlib) \ |
227 |
+ --prefix="${EPREFIX}"/usr \ |
228 |
+ --openssldir="${EPREFIX}"${SSL_CNF_DIR} \ |
229 |
+ --libdir=$(get_libdir) \ |
230 |
+ shared threads \ |
231 |
+ || die |
232 |
+ |
233 |
+ # Clean out hardcoded flags that openssl uses |
234 |
+ # Fix quoting for sed |
235 |
+ local DEFAULT_CFLAGS=$(grep ^CFLAGS= Makefile | LC_ALL=C sed \ |
236 |
+ -e 's:^CFLAGS=::' \ |
237 |
+ -e 's:-fomit-frame-pointer ::g' \ |
238 |
+ -e 's:-O[0-9] ::g' \ |
239 |
+ -e 's:-march=[-a-z0-9]* ::g' \ |
240 |
+ -e 's:-mcpu=[-a-z0-9]* ::g' \ |
241 |
+ -e 's:-m[a-z0-9]* ::g' \ |
242 |
+ -e 's:\\:\\\\:g' \ |
243 |
+ ) |
244 |
+ sed -i \ |
245 |
+ -e "/^CFLAGS=/s|=.*|=${DEFAULT_CFLAGS} ${CFLAGS}|" \ |
246 |
+ -e "/^LDFLAGS=/s|=[[:space:]]*$|=${LDFLAGS}|" \ |
247 |
+ Makefile || die |
248 |
+} |
249 |
+ |
250 |
+multilib_src_compile() { |
251 |
+ # depend is needed to use $confopts; it also doesn't matter |
252 |
+ # that it's -j1 as the code itself serializes subdirs |
253 |
+ emake -j1 depend |
254 |
+ emake all |
255 |
+} |
256 |
+ |
257 |
+multilib_src_test() { |
258 |
+ emake -j1 test |
259 |
+} |
260 |
+ |
261 |
+multilib_src_install() { |
262 |
+ emake DESTDIR="${D}" install |
263 |
+} |
264 |
+ |
265 |
+multilib_src_install_all() { |
266 |
+ # openssl installs perl version of c_rehash by default, but |
267 |
+ # we provide a shell version via app-misc/c_rehash |
268 |
+ rm "${ED%/}"/usr/bin/c_rehash || die |
269 |
+ |
270 |
+ dodoc CHANGES* FAQ NEWS README doc/*.txt doc/${PN}-c-indent.el |
271 |
+ |
272 |
+ # This is crappy in that the static archives are still built even |
273 |
+ # when USE=static-libs. But this is due to a failing in the openssl |
274 |
+ # build system: the static archives are built as PIC all the time. |
275 |
+ # Only way around this would be to manually configure+compile openssl |
276 |
+ # twice; once with shared lib support enabled and once without. |
277 |
+ use static-libs || rm -f "${ED%/}"/usr/lib*/lib*.a |
278 |
+ |
279 |
+ # create the certs directory |
280 |
+ keepdir ${SSL_CNF_DIR}/certs |
281 |
+ |
282 |
+ # Namespace openssl programs to prevent conflicts with other man pages |
283 |
+ cd "${ED%/}"/usr/share/man || die |
284 |
+ local m d s |
285 |
+ for m in $(find . -type f | xargs grep -L '#include') ; do |
286 |
+ d=${m%/*} ; d=${d#./} ; m=${m##*/} |
287 |
+ [[ ${m} == openssl.1* ]] && continue |
288 |
+ [[ -n $(find -L ${d} -type l) ]] && die "erp, broken links already!" |
289 |
+ mv ${d}/{,ssl-}${m} |
290 |
+ # fix up references to renamed man pages |
291 |
+ sed -i '/^[.]SH "SEE ALSO"/,/^[.]/s:\([^(, ]*(1)\):ssl-\1:g' ${d}/ssl-${m} |
292 |
+ ln -s ssl-${m} ${d}/openssl-${m} |
293 |
+ # locate any symlinks that point to this man page ... we assume |
294 |
+ # that any broken links are due to the above renaming |
295 |
+ for s in $(find -L ${d} -type l) ; do |
296 |
+ s=${s##*/} |
297 |
+ rm -f ${d}/${s} |
298 |
+ # We don't want to "|| die" here |
299 |
+ ln -s ssl-${m} ${d}/ssl-${s} |
300 |
+ ln -s ssl-${s} ${d}/openssl-${s} |
301 |
+ done |
302 |
+ done |
303 |
+ [[ -n $(find -L ${d} -type l) ]] && die "broken manpage links found :(" |
304 |
+ |
305 |
+ dodir /etc/sandbox.d #254521 |
306 |
+ echo 'SANDBOX_PREDICT="/dev/crypto"' > "${ED%/}"/etc/sandbox.d/10openssl |
307 |
+ |
308 |
+ diropts -m0700 |
309 |
+ keepdir ${SSL_CNF_DIR}/private |
310 |
+} |
311 |
+ |
312 |
+pkg_postinst() { |
313 |
+ ebegin "Running 'c_rehash ${EROOT%/}${SSL_CNF_DIR}/certs/' to rebuild hashes #333069" |
314 |
+ c_rehash "${EROOT%/}${SSL_CNF_DIR}/certs" >/dev/null |
315 |
+ eend $? |
316 |
+} |