1 |
commit: 9595d362c31540ec2db3a7f2e995f596a105e7ec |
2 |
Author: Thomas Deutschmann <whissi <AT> gentoo <DOT> org> |
3 |
AuthorDate: Tue Sep 7 15:55:21 2021 +0000 |
4 |
Commit: Thomas Deutschmann <whissi <AT> gentoo <DOT> org> |
5 |
CommitDate: Tue Sep 7 16:07:28 2021 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=9595d362 |
7 |
|
8 |
dev-libs/openssl: bump to v3.0.0 |
9 |
|
10 |
Package-Manager: Portage-3.0.22, Repoman-3.0.3 |
11 |
Signed-off-by: Thomas Deutschmann <whissi <AT> gentoo.org> |
12 |
|
13 |
dev-libs/openssl/Manifest | 1 + |
14 |
dev-libs/openssl/openssl-3.0.0.ebuild | 292 ++++++++++++++++++++++++++++++++++ |
15 |
2 files changed, 293 insertions(+) |
16 |
|
17 |
diff --git a/dev-libs/openssl/Manifest b/dev-libs/openssl/Manifest |
18 |
index 8063cf862b3..d3acbb4772c 100644 |
19 |
--- a/dev-libs/openssl/Manifest |
20 |
+++ b/dev-libs/openssl/Manifest |
21 |
@@ -5,3 +5,4 @@ DIST openssl-1.1.1i-bindist-1.0.tar.xz 18124 BLAKE2B bcbce700676d1d61498ac98281b |
22 |
DIST openssl-1.1.1k.tar.gz 9823400 BLAKE2B e9bd90f17bc819c4960d07bbee04346e8a7adb87a764a09d033ef76f1d638c67b180c4f2beb84ec25fbff54ccc9c14c13b9b16a27cac231a5dd22b02635d5cec SHA512 73cd042d4056585e5a9dd7ab68e7c7310a3a4c783eafa07ab0b560e7462b924e4376436a6d38a155c687f6942a881cfc0c1b9394afcde1d8c46bf396e7d51121 |
23 |
DIST openssl-1.1.1l.tar.gz 9834044 BLAKE2B 9e8739015db63a013c05587e3d164d67c3f65f1f6c5fc75e4592bcd038c036cde88a7bc95fbc1f1b4ed876f6124ca4dabcd4f5dbb45d1b84299f2efe1a59431a SHA512 d9611f393e37577cca05004531388d3e0ebbf714894cab9f95f4903909cd4f45c214faab664c0cbc3ad3cca309d500b9e6d0ecbf9a0a0588d1677dc6b047f9e0 |
24 |
DIST openssl-3.0.0-beta2.tar.gz 14912360 BLAKE2B f1180eee6561f04e778f40d3d6f9fac5645777de09d965662f00c2506da30d3c3cfa0e98a25fc668e2e1fd39b8d700d7f0fd901f80964be048cb3aaa6432a5f5 SHA512 3eb9b472429bc26a7fc5c5837e2ea496706e3c6273ba33f36bbe3dc13bf7dcf7cba08d19ce005ee9b1cecfc63de68ef86cd8d911df28c82873ee44ba5d7e253a |
25 |
+DIST openssl-3.0.0.tar.gz 14978663 BLAKE2B 64721ee958fc47d57a479dffff91be5692d80d10a6727d804f8a9da66fcaea799b67fda8987f9ecdfb2777ec42033c5e8a6a135e30784d6422eb3c65e676abe6 SHA512 1fdf769ef69631eb802671a9e0bb3a01883d58282f651986212983c2d7c9d3499dabe99a6dee0411e997e6fcfa6f682b121b7698596de0d6c78850c2200241b1 |
26 |
|
27 |
diff --git a/dev-libs/openssl/openssl-3.0.0.ebuild b/dev-libs/openssl/openssl-3.0.0.ebuild |
28 |
new file mode 100644 |
29 |
index 00000000000..c7bab83b760 |
30 |
--- /dev/null |
31 |
+++ b/dev-libs/openssl/openssl-3.0.0.ebuild |
32 |
@@ -0,0 +1,292 @@ |
33 |
+# Copyright 1999-2021 Gentoo Authors |
34 |
+# Distributed under the terms of the GNU General Public License v2 |
35 |
+ |
36 |
+EAPI="7" |
37 |
+ |
38 |
+inherit flag-o-matic linux-info toolchain-funcs multilib-minimal |
39 |
+ |
40 |
+MY_P=${P/_/-} |
41 |
+ |
42 |
+DESCRIPTION="Robust, full-featured Open Source Toolkit for the Transport Layer Security (TLS)" |
43 |
+HOMEPAGE="https://www.openssl.org/" |
44 |
+ |
45 |
+if [[ ${PV} == "9999" ]] ; then |
46 |
+ EGIT_REPO_URI="https://github.com/openssl/openssl.git" |
47 |
+ |
48 |
+ inherit git-r3 |
49 |
+else |
50 |
+ SRC_URI="mirror://openssl/source/${MY_P}.tar.gz" |
51 |
+ KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~x86-linux" |
52 |
+fi |
53 |
+ |
54 |
+LICENSE="Apache-2.0" |
55 |
+SLOT="0/3" # .so version of libssl/libcrypto |
56 |
+ |
57 |
+IUSE="+asm cpu_flags_x86_sse2 elibc_musl ktls rfc3779 sctp static-libs test tls-compression vanilla" |
58 |
+RESTRICT="!test? ( test )" |
59 |
+ |
60 |
+COMMON_DEPEND=" |
61 |
+ >=app-misc/c_rehash-1.7-r1 |
62 |
+ tls-compression? ( >=sys-libs/zlib-1.2.8-r1[static-libs(+)?,${MULTILIB_USEDEP}] ) |
63 |
+" |
64 |
+ |
65 |
+BDEPEND=" |
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 |
+ sys-process/procps |
72 |
+ )" |
73 |
+ |
74 |
+DEPEND="${COMMON_DEPEND}" |
75 |
+ |
76 |
+RDEPEND="${COMMON_DEPEND}" |
77 |
+ |
78 |
+PDEPEND="app-misc/ca-certificates" |
79 |
+ |
80 |
+S="${WORKDIR}/${MY_P}" |
81 |
+ |
82 |
+MULTILIB_WRAPPED_HEADERS=( |
83 |
+ /usr/include/openssl/configuration.h |
84 |
+) |
85 |
+ |
86 |
+pkg_setup() { |
87 |
+ if use ktls ; then |
88 |
+ if kernel_is -lt 4 18 ; then |
89 |
+ ewarn "Kernel implementation of TLS (USE=ktls) requires kernel >=4.18!" |
90 |
+ else |
91 |
+ CONFIG_CHECK="~TLS ~TLS_DEVICE" |
92 |
+ ERROR_TLS="You will be unable to offload TLS to kernel because CONFIG_TLS is not set!" |
93 |
+ ERROR_TLS_DEVICE="You will be unable to offload TLS to kernel because CONFIG_TLS_DEVICE is not set!" |
94 |
+ |
95 |
+ linux-info_pkg_setup |
96 |
+ fi |
97 |
+ fi |
98 |
+ |
99 |
+ [[ ${MERGE_TYPE} == binary ]] && return |
100 |
+ |
101 |
+ # must check in pkg_setup; sysctl don't work with userpriv! |
102 |
+ if use test && use sctp ; then |
103 |
+ # test_ssl_new will fail with "Ensure SCTP AUTH chunks are enabled in kernel" |
104 |
+ # if sctp.auth_enable is not enabled. |
105 |
+ local sctp_auth_status=$(sysctl -n net.sctp.auth_enable 2>/dev/null) |
106 |
+ if [[ -z "${sctp_auth_status}" ]] || [[ ${sctp_auth_status} != 1 ]] ; then |
107 |
+ die "FEATURES=test with USE=sctp requires net.sctp.auth_enable=1!" |
108 |
+ fi |
109 |
+ fi |
110 |
+} |
111 |
+ |
112 |
+src_prepare() { |
113 |
+ # allow openssl to be cross-compiled |
114 |
+ cp "${FILESDIR}"/gentoo.config-1.0.2 gentoo.config || die |
115 |
+ chmod a+rx gentoo.config || die |
116 |
+ |
117 |
+ # keep this in sync with app-misc/c_rehash |
118 |
+ SSL_CNF_DIR="/etc/ssl" |
119 |
+ |
120 |
+ # Make sure we only ever touch Makefile.org and avoid patching a file |
121 |
+ # that gets blown away anyways by the Configure script in src_configure |
122 |
+ rm -f Makefile |
123 |
+ |
124 |
+ if ! use vanilla ; then |
125 |
+ if [[ $(declare -p PATCHES 2>/dev/null) == "declare -a"* ]] ; then |
126 |
+ [[ ${#PATCHES[@]} -gt 0 ]] && eapply "${PATCHES[@]}" |
127 |
+ fi |
128 |
+ fi |
129 |
+ |
130 |
+ eapply_user |
131 |
+ |
132 |
+ if use test && use sctp && has network-sandbox ${FEATURES} ; then |
133 |
+ einfo "Disabling test '80-test_ssl_new.t' which is known to fail with FEATURES=network-sandbox ..." |
134 |
+ rm test/recipes/80-test_ssl_new.t || die |
135 |
+ fi |
136 |
+ |
137 |
+ # make sure the man pages are suffixed #302165 |
138 |
+ # don't bother building man pages if they're disabled |
139 |
+ # Make DOCDIR Gentoo compliant |
140 |
+ sed -i \ |
141 |
+ -e '/^MANSUFFIX/s:=.*:=ssl:' \ |
142 |
+ -e '/^MAKEDEPPROG/s:=.*:=$(CC):' \ |
143 |
+ -e $(has noman FEATURES \ |
144 |
+ && echo '/^install:/s:install_docs::' \ |
145 |
+ || echo '/^MANDIR=/s:=.*:='${EPREFIX}'/usr/share/man:') \ |
146 |
+ -e "/^DOCDIR/s@\$(BASENAME)@&-${PVR}@" \ |
147 |
+ Configurations/unix-Makefile.tmpl \ |
148 |
+ || die |
149 |
+ |
150 |
+ # quiet out unknown driver argument warnings since openssl |
151 |
+ # doesn't have well-split CFLAGS and we're making it even worse |
152 |
+ # and 'make depend' uses -Werror for added fun (#417795 again) |
153 |
+ [[ ${CC} == *clang* ]] && append-flags -Qunused-arguments |
154 |
+ |
155 |
+ append-flags -fno-strict-aliasing |
156 |
+ append-flags $(test-flags-CC -Wa,--noexecstack) |
157 |
+ |
158 |
+ # Prefixify Configure shebang (#141906) |
159 |
+ sed \ |
160 |
+ -e "1s,/usr/bin/env,${EPREFIX}&," \ |
161 |
+ -i Configure || die |
162 |
+ |
163 |
+ # Remove test target when FEATURES=test isn't set |
164 |
+ if ! use test ; then |
165 |
+ sed \ |
166 |
+ -e '/^$config{dirs}/s@ "test",@@' \ |
167 |
+ -i Configure || die |
168 |
+ fi |
169 |
+ |
170 |
+ # The config script does stupid stuff to prompt the user. Kill it. |
171 |
+ sed -i '/stty -icanon min 0 time 50; read waste/d' config || die |
172 |
+ ./config --test-sanity || die "I AM NOT SANE" |
173 |
+ |
174 |
+ multilib_copy_sources |
175 |
+} |
176 |
+ |
177 |
+multilib_src_configure() { |
178 |
+ unset APPS #197996 |
179 |
+ unset SCRIPTS #312551 |
180 |
+ unset CROSS_COMPILE #311473 |
181 |
+ |
182 |
+ tc-export AR CC CXX RANLIB RC |
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 |
+ local sslout=$(./gentoo.config) |
190 |
+ einfo "Use configuration ${sslout:-(openssl knows best)}" |
191 |
+ local config="Configure" |
192 |
+ [[ -z ${sslout} ]] && config="config" |
193 |
+ |
194 |
+ local myeconfargs=( |
195 |
+ ${sslout} |
196 |
+ $(use cpu_flags_x86_sse2 || echo "no-sse2") |
197 |
+ enable-camellia |
198 |
+ enable-ec |
199 |
+ enable-ec2m |
200 |
+ enable-sm2 |
201 |
+ enable-srp |
202 |
+ $(use elibc_musl && echo "no-async") |
203 |
+ enable-idea |
204 |
+ enable-mdc2 |
205 |
+ enable-rc5 |
206 |
+ $(use_ssl asm) |
207 |
+ $(use_ssl ktls) |
208 |
+ $(use_ssl rfc3779) |
209 |
+ $(use_ssl sctp) |
210 |
+ $(use_ssl tls-compression zlib) |
211 |
+ --prefix="${EPREFIX}"/usr |
212 |
+ --openssldir="${EPREFIX}"${SSL_CNF_DIR} |
213 |
+ --libdir=$(get_libdir) |
214 |
+ shared |
215 |
+ threads |
216 |
+ ) |
217 |
+ |
218 |
+ CFLAGS= LDFLAGS= echoit \ |
219 |
+ ./${config} \ |
220 |
+ "${myeconfargs[@]}" \ |
221 |
+ || die |
222 |
+ |
223 |
+ # Clean out hardcoded flags that openssl uses |
224 |
+ local DEFAULT_CFLAGS=$(grep ^CFLAGS= Makefile | LC_ALL=C sed \ |
225 |
+ -e 's:^CFLAGS=::' \ |
226 |
+ -e 's:\(^\| \)-fomit-frame-pointer::g' \ |
227 |
+ -e 's:\(^\| \)-O[^ ]*::g' \ |
228 |
+ -e 's:\(^\| \)-march=[^ ]*::g' \ |
229 |
+ -e 's:\(^\| \)-mcpu=[^ ]*::g' \ |
230 |
+ -e 's:\(^\| \)-m[^ ]*::g' \ |
231 |
+ -e 's:^ *::' \ |
232 |
+ -e 's: *$::' \ |
233 |
+ -e 's: \+: :g' \ |
234 |
+ -e 's:\\:\\\\:g' |
235 |
+ ) |
236 |
+ |
237 |
+ # Now insert clean default flags with user flags |
238 |
+ sed -i \ |
239 |
+ -e "/^CFLAGS=/s|=.*|=${DEFAULT_CFLAGS} ${CFLAGS}|" \ |
240 |
+ -e "/^LDFLAGS=/s|=[[:space:]]*$|=${LDFLAGS}|" \ |
241 |
+ Makefile \ |
242 |
+ || die |
243 |
+} |
244 |
+ |
245 |
+multilib_src_compile() { |
246 |
+ # depend is needed to use $confopts; it also doesn't matter |
247 |
+ # that it's -j1 as the code itself serializes subdirs |
248 |
+ emake -j1 depend |
249 |
+ emake all |
250 |
+} |
251 |
+ |
252 |
+multilib_src_test() { |
253 |
+ emake -j1 test |
254 |
+} |
255 |
+ |
256 |
+multilib_src_install() { |
257 |
+ # We need to create $ED/usr on our own to avoid a race condition #665130 |
258 |
+ if [[ ! -d "${ED}/usr" ]] ; then |
259 |
+ # We can only create this directory once |
260 |
+ mkdir "${ED}"/usr || die |
261 |
+ fi |
262 |
+ |
263 |
+ emake DESTDIR="${D}" install |
264 |
+ |
265 |
+ # This is crappy in that the static archives are still built even |
266 |
+ # when USE=static-libs. But this is due to a failing in the openssl |
267 |
+ # build system: the static archives are built as PIC all the time. |
268 |
+ # Only way around this would be to manually configure+compile openssl |
269 |
+ # twice; once with shared lib support enabled and once without. |
270 |
+ if ! use static-libs ; then |
271 |
+ rm "${ED}"/usr/$(get_libdir)/lib{crypto,ssl}.a || die |
272 |
+ fi |
273 |
+} |
274 |
+ |
275 |
+multilib_src_install_all() { |
276 |
+ # openssl installs perl version of c_rehash by default, but |
277 |
+ # we provide a shell version via app-misc/c_rehash |
278 |
+ rm "${ED}"/usr/bin/c_rehash || die |
279 |
+ |
280 |
+ dodoc {AUTHORS,CHANGES,NEWS,README,README-PROVIDERS}.md doc/*.txt doc/${PN}-c-indent.el |
281 |
+ |
282 |
+ # create the certs directory |
283 |
+ keepdir ${SSL_CNF_DIR}/certs |
284 |
+ |
285 |
+ # Namespace openssl programs to prevent conflicts with other man pages |
286 |
+ cd "${ED}"/usr/share/man || die |
287 |
+ local m d s |
288 |
+ for m in $(find . -type f | xargs grep -L '#include') ; do |
289 |
+ d=${m%/*} ; d=${d#./} ; m=${m##*/} |
290 |
+ |
291 |
+ [[ ${m} == openssl.1* ]] && continue |
292 |
+ |
293 |
+ [[ -n $(find -L ${d} -type l) ]] && die "erp, broken links already!" |
294 |
+ |
295 |
+ mv ${d}/{,ssl-}${m} || die |
296 |
+ |
297 |
+ # fix up references to renamed man pages |
298 |
+ sed -i '/^[.]SH "SEE ALSO"/,/^[.]/s:\([^(, ]*(1)\):ssl-\1:g' ${d}/ssl-${m} || die |
299 |
+ ln -s ssl-${m} ${d}/openssl-${m} || die |
300 |
+ |
301 |
+ # locate any symlinks that point to this man page ... |
302 |
+ # we assume that any broken links are due to the above renaming |
303 |
+ for s in $(find -L ${d} -type l) ; do |
304 |
+ s=${s##*/} |
305 |
+ rm -f ${d}/${s} |
306 |
+ # We don't want to "|| die" here |
307 |
+ ln -s ssl-${m} ${d}/ssl-${s} |
308 |
+ ln -s ssl-${s} ${d}/openssl-${s} |
309 |
+ done |
310 |
+ done |
311 |
+ [[ -n $(find -L ${d} -type l) ]] && die "broken manpage links found :(" |
312 |
+ |
313 |
+ dodir /etc/sandbox.d #254521 |
314 |
+ echo 'SANDBOX_PREDICT="/dev/crypto"' > "${ED}"/etc/sandbox.d/10openssl |
315 |
+ |
316 |
+ diropts -m0700 |
317 |
+ keepdir ${SSL_CNF_DIR}/private |
318 |
+} |
319 |
+ |
320 |
+pkg_postinst() { |
321 |
+ ebegin "Running 'c_rehash ${EROOT}${SSL_CNF_DIR}/certs/' to rebuild hashes #333069" |
322 |
+ c_rehash "${EROOT}${SSL_CNF_DIR}/certs" >/dev/null |
323 |
+ eend $? |
324 |
+} |