1 |
commit: c1be114570a325d593fcc30c72e197e7fa015c52 |
2 |
Author: Louis Sautier <sbraz <AT> gentoo <DOT> org> |
3 |
AuthorDate: Wed Aug 24 10:35:25 2022 +0000 |
4 |
Commit: Louis Sautier <sbraz <AT> gentoo <DOT> org> |
5 |
CommitDate: Wed Aug 24 10:39:32 2022 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c1be1145 |
7 |
|
8 |
net-nntp/nzbget: fix build with OpenSSL 3, bump to EAPI 8 |
9 |
|
10 |
Closes: https://bugs.gentoo.org/805896 |
11 |
Signed-off-by: Louis Sautier <sbraz <AT> gentoo.org> |
12 |
|
13 |
net-nntp/nzbget/files/nzbget-21.1-openssl-3.patch | 28 +++++ |
14 |
net-nntp/nzbget/nzbget-21.1-r2.ebuild | 118 ++++++++++++++++++++++ |
15 |
2 files changed, 146 insertions(+) |
16 |
|
17 |
diff --git a/net-nntp/nzbget/files/nzbget-21.1-openssl-3.patch b/net-nntp/nzbget/files/nzbget-21.1-openssl-3.patch |
18 |
new file mode 100644 |
19 |
index 000000000000..d1d89e9260c0 |
20 |
--- /dev/null |
21 |
+++ b/net-nntp/nzbget/files/nzbget-21.1-openssl-3.patch |
22 |
@@ -0,0 +1,28 @@ |
23 |
+From f76e8555504e3af4cf8dd4a8c8e374b3ca025099 Mon Sep 17 00:00:00 2001 |
24 |
+From: Simon Chopin <simon.chopin@×××××××××.com> |
25 |
+Date: Tue, 7 Dec 2021 13:23:21 +0100 |
26 |
+Subject: [PATCH] daemon:connect: don't use FIPS_mode_set with OpenSSL 3 |
27 |
+ |
28 |
+This function has been removed in OpenSSL 3, replaced by |
29 |
+EVP_default_properties_enable_fips. See |
30 |
+https://www.openssl.org/docs/man3.0/man7/migration_guide.html |
31 |
+--- |
32 |
+ daemon/connect/TlsSocket.cpp | 4 ++++ |
33 |
+ 1 file changed, 4 insertions(+) |
34 |
+ |
35 |
+diff --git a/daemon/connect/TlsSocket.cpp b/daemon/connect/TlsSocket.cpp |
36 |
+index 544bf6850..831da0dc0 100644 |
37 |
+--- a/daemon/connect/TlsSocket.cpp |
38 |
++++ b/daemon/connect/TlsSocket.cpp |
39 |
+@@ -189,7 +189,11 @@ void TlsSocket::Final() |
40 |
+ |
41 |
+ #ifdef HAVE_OPENSSL |
42 |
+ #ifndef LIBRESSL_VERSION_NUMBER |
43 |
++#if OPENSSL_VERSION_NUMBER < 0x30000000L |
44 |
+ FIPS_mode_set(0); |
45 |
++#else |
46 |
++ EVP_default_properties_enable_fips(NULL, 0); |
47 |
++#endif |
48 |
+ #endif |
49 |
+ #ifdef NEED_CRYPTO_LOCKING |
50 |
+ CRYPTO_set_locking_callback(nullptr); |
51 |
|
52 |
diff --git a/net-nntp/nzbget/nzbget-21.1-r2.ebuild b/net-nntp/nzbget/nzbget-21.1-r2.ebuild |
53 |
new file mode 100644 |
54 |
index 000000000000..a7d5afecaf9a |
55 |
--- /dev/null |
56 |
+++ b/net-nntp/nzbget/nzbget-21.1-r2.ebuild |
57 |
@@ -0,0 +1,118 @@ |
58 |
+# Copyright 1999-2022 Gentoo Authors |
59 |
+# Distributed under the terms of the GNU General Public License v2 |
60 |
+ |
61 |
+EAPI=8 |
62 |
+ |
63 |
+inherit autotools systemd |
64 |
+ |
65 |
+MY_PV=${PV/_pre/-r} |
66 |
+MY_P=${PN}-${PV/_pre/-testing-r} |
67 |
+ |
68 |
+DESCRIPTION="A command-line based binary newsgrabber supporting .nzb files" |
69 |
+HOMEPAGE="https://nzbget.net/" |
70 |
+SRC_URI="https://github.com/${PN}/${PN}/releases/download/v${MY_PV}/${MY_P}-src.tar.gz -> ${P}.tar.gz" |
71 |
+S=${WORKDIR}/${PN}-${PV/_pre*/-testing} |
72 |
+ |
73 |
+LICENSE="GPL-2+" |
74 |
+SLOT="0" |
75 |
+KEYWORDS="~amd64 ~arm ~ppc ~x86" |
76 |
+IUSE="debug gnutls ncurses +parcheck ssl test zlib" |
77 |
+RESTRICT="!test? ( test )" |
78 |
+ |
79 |
+DEPEND=" |
80 |
+ dev-libs/libxml2:= |
81 |
+ ncurses? ( sys-libs/ncurses:0= ) |
82 |
+ ssl? ( |
83 |
+ gnutls? ( |
84 |
+ net-libs/gnutls:= |
85 |
+ dev-libs/nettle:= |
86 |
+ ) |
87 |
+ !gnutls? ( dev-libs/openssl:0=[-bindist(-)] ) |
88 |
+ ) |
89 |
+ zlib? ( sys-libs/zlib:= )" |
90 |
+RDEPEND=" |
91 |
+ ${DEPEND} |
92 |
+ acct-user/nzbget |
93 |
+ acct-group/nzbget |
94 |
+" |
95 |
+BDEPEND=" |
96 |
+ test? ( |
97 |
+ || ( |
98 |
+ app-arch/rar |
99 |
+ app-arch/unrar |
100 |
+ ) |
101 |
+ ) |
102 |
+ virtual/pkgconfig |
103 |
+" |
104 |
+ |
105 |
+DOCS=( ChangeLog README nzbget.conf ) |
106 |
+ |
107 |
+PATCHES=( |
108 |
+ # https://bugs.gentoo.org/805896 |
109 |
+ # https://github.com/nzbget/nzbget/pull/793 |
110 |
+ "${FILESDIR}/${P}-openssl-3.patch" |
111 |
+) |
112 |
+ |
113 |
+src_prepare() { |
114 |
+ default |
115 |
+ eautoreconf |
116 |
+ |
117 |
+ sed -i 's:^ScriptDir=.*:ScriptDir=/usr/share/nzbget/ppscripts:' nzbget.conf || die |
118 |
+ |
119 |
+ sed \ |
120 |
+ -e 's:^MainDir=.*:MainDir=/var/lib/nzbget:' \ |
121 |
+ -e 's:^LogFile=.*:LogFile=/var/log/nzbget/nzbget.log:' \ |
122 |
+ -e 's:^WebDir=.*:WebDir=/usr/share/nzbget/webui:' \ |
123 |
+ -e 's:^ConfigTemplate=.*:ConfigTemplate=/usr/share/nzbget/nzbget.conf:' \ |
124 |
+ -e 's:^DaemonUsername=.*:DaemonUsername=nzbget:' \ |
125 |
+ nzbget.conf > nzbgetd.conf || die |
126 |
+} |
127 |
+ |
128 |
+src_configure() { |
129 |
+ local myconf=( |
130 |
+ $(use_enable debug) |
131 |
+ $(use_enable ncurses curses) |
132 |
+ $(use_enable parcheck) |
133 |
+ $(use_enable ssl tls) |
134 |
+ $(use_enable zlib gzip) |
135 |
+ $(use_enable test tests) |
136 |
+ --with-tlslib=$(usex gnutls GnuTLS OpenSSL) |
137 |
+ ) |
138 |
+ econf "${myconf[@]}" |
139 |
+} |
140 |
+ |
141 |
+src_test() { |
142 |
+ ./nzbget --tests || die "Tests failed" |
143 |
+} |
144 |
+ |
145 |
+src_install() { |
146 |
+ default |
147 |
+ |
148 |
+ insinto /etc |
149 |
+ doins nzbget.conf |
150 |
+ doins nzbgetd.conf |
151 |
+ |
152 |
+ keepdir /var/log/nzbget |
153 |
+ |
154 |
+ newinitd "${FILESDIR}"/nzbget.initd-r1 nzbget |
155 |
+ newconfd "${FILESDIR}"/nzbget.confd nzbget |
156 |
+ systemd_dounit "${FILESDIR}"/nzbget.service |
157 |
+} |
158 |
+ |
159 |
+pkg_preinst() { |
160 |
+ fowners nzbget:nzbget /var/log/nzbget |
161 |
+ fperms 750 /var/log/nzbget |
162 |
+ |
163 |
+ fowners nzbget:nzbget /etc/nzbgetd.conf |
164 |
+ fperms 640 /etc/nzbgetd.conf |
165 |
+} |
166 |
+ |
167 |
+pkg_postinst() { |
168 |
+ if [[ -z ${REPLACING_VERSIONS} ]] ; then |
169 |
+ elog |
170 |
+ elog "Please add users that you want to be able to use the system-wide" |
171 |
+ elog "nzbget daemon to the nzbget group. To access the daemon, run nzbget" |
172 |
+ elog "with the --configfile /etc/nzbgetd.conf option." |
173 |
+ elog |
174 |
+ fi |
175 |
+} |