1 |
commit: 2c032948f9de88cae579a5e6a12705cce59f6ce5 |
2 |
Author: Michael Mair-Keimberger <m.mairkeimberger <AT> gmail <DOT> com> |
3 |
AuthorDate: Fri Sep 21 18:36:08 2018 +0000 |
4 |
Commit: Patrice Clement <monsieurp <AT> gentoo <DOT> org> |
5 |
CommitDate: Thu Sep 27 21:26:44 2018 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2c032948 |
7 |
|
8 |
net-irc/psybnc: EAPI7, improve ebuild. |
9 |
|
10 |
Closes: https://bugs.gentoo.org/666720 |
11 |
Signed-off-by: Michael Mair-Keimberger <m.mairkeimberger <AT> gmail.com> |
12 |
Closes: https://github.com/gentoo/gentoo/pull/9937 |
13 |
|
14 |
net-irc/psybnc/files/compile.diff | 30 ++-- |
15 |
.../psybnc/files/psybnc-2.3.2.9-multinetwork.patch | 4 +- |
16 |
net-irc/psybnc/files/psybnc-2.3.2.9-oidentd.patch | 4 +- |
17 |
.../psybnc/files/psybnc-2.3.2.9-scripting.patch | 4 +- |
18 |
net-irc/psybnc/psybnc-2.3.2.9-r3.ebuild | 159 +++++++++++++++++++++ |
19 |
5 files changed, 180 insertions(+), 21 deletions(-) |
20 |
|
21 |
diff --git a/net-irc/psybnc/files/compile.diff b/net-irc/psybnc/files/compile.diff |
22 |
index fdee75c6073..99e55b6d8cd 100644 |
23 |
--- a/net-irc/psybnc/files/compile.diff |
24 |
+++ b/net-irc/psybnc/files/compile.diff |
25 |
@@ -1,6 +1,6 @@ |
26 |
-diff -Naurp src/p_blowfish.c src/p_blowfish.c |
27 |
---- src/p_blowfish.c 2007-02-26 12:16:53.000000000 +0000 |
28 |
-+++ src/p_blowfish.c 2007-02-26 12:17:11.000000000 +0000 |
29 |
+diff -Naurp a/src/p_blowfish.c b/src/p_blowfish.c |
30 |
+--- a/src/p_blowfish.c 2007-02-26 12:16:53.000000000 +0000 |
31 |
++++ b/src/p_blowfish.c 2007-02-26 12:17:11.000000000 +0000 |
32 |
@@ -31,7 +31,7 @@ static char rcsid[] = "@(#)# $Id$ |
33 |
#include <string.h> |
34 |
#include <config.h> |
35 |
@@ -10,9 +10,9 @@ diff -Naurp src/p_blowfish.c src/p_blowfish.c |
36 |
char *lngtxt(int msgnum); |
37 |
|
38 |
#define pcontext { strmncpy(ctxt,__FILE__,sizeof(ctxt));strmncpy(cfunc,__FUNCTION__,sizeof(cfunc)); cline=__LINE__; } |
39 |
-diff -Naurp src/p_global.h src/p_global.h |
40 |
---- src/p_global.h 2007-02-26 12:16:53.000000000 +0000 |
41 |
-+++ src/p_global.h 2007-02-26 12:17:11.000000000 +0000 |
42 |
+diff -Naurp a/src/p_global.h b/src/p_global.h |
43 |
+--- a/src/p_global.h 2007-02-26 12:16:53.000000000 +0000 |
44 |
++++ b/src/p_global.h 2007-02-26 12:17:11.000000000 +0000 |
45 |
@@ -972,8 +972,8 @@ int checklogging(int usern); |
46 |
#endif |
47 |
|
48 |
@@ -33,9 +33,9 @@ diff -Naurp src/p_global.h src/p_global.h |
49 |
int strmncasecmp(char *one, char *two); |
50 |
int strmcmp(char *one, char *two); |
51 |
int strmwildcmp(char *line, char *wildcard); |
52 |
-diff -Naurp src/p_memory.c src/p_memory.c |
53 |
---- src/p_memory.c 2007-02-26 12:16:53.000000000 +0000 |
54 |
-+++ src/p_memory.c 2007-02-26 12:17:11.000000000 +0000 |
55 |
+diff -Naurp a/src/p_memory.c b/src/p_memory.c |
56 |
+--- a/src/p_memory.c 2007-02-26 12:16:53.000000000 +0000 |
57 |
++++ b/src/p_memory.c 2007-02-26 12:17:11.000000000 +0000 |
58 |
@@ -32,7 +32,7 @@ FILE *logm=NULL; |
59 |
|
60 |
/* malloc-wrapper. No memory will log an error entry and kill the bouncer */ |
61 |
@@ -54,9 +54,9 @@ diff -Naurp src/p_memory.c src/p_memory.c |
62 |
{ |
63 |
#ifdef LOGALLOC |
64 |
if(logm==NULL) |
65 |
-diff -Naurp src/p_string.c src/p_string.c |
66 |
---- src/p_string.c 2007-02-26 12:16:53.000000000 +0000 |
67 |
-+++ src/p_string.c 2007-02-26 12:17:11.000000000 +0000 |
68 |
+diff -Naurp a/src/p_string.c b/src/p_string.c |
69 |
+--- a/src/p_string.c 2007-02-26 12:16:53.000000000 +0000 |
70 |
++++ b/src/p_string.c 2007-02-26 12:17:11.000000000 +0000 |
71 |
@@ -51,7 +51,7 @@ char *lngtxt(unsigned int msgnum) |
72 |
|
73 |
/* string copy with len and zero delimit */ |
74 |
@@ -66,9 +66,9 @@ diff -Naurp src/p_string.c src/p_string.c |
75 |
{ |
76 |
char bf[strlen(source)+2]; |
77 |
char *pt; |
78 |
-diff -Naurp src/match.c src/match.c |
79 |
---- src/match.c 2007-02-26 12:26:10.000000000 +0000 |
80 |
-+++ src/match.c 2007-02-26 12:26:17.000000000 +0000 |
81 |
+diff -Naurp a/src/match.c b/src/match.c |
82 |
+--- a/src/match.c 2007-02-26 12:26:10.000000000 +0000 |
83 |
++++ b/src/match.c 2007-02-26 12:26:17.000000000 +0000 |
84 |
@@ -36,6 +36,7 @@ |
85 |
/* Remove the next line to use this in IrcII */ |
86 |
#define EGGDROP |
87 |
|
88 |
diff --git a/net-irc/psybnc/files/psybnc-2.3.2.9-multinetwork.patch b/net-irc/psybnc/files/psybnc-2.3.2.9-multinetwork.patch |
89 |
index 4d796961d6f..b4688d7584c 100644 |
90 |
--- a/net-irc/psybnc/files/psybnc-2.3.2.9-multinetwork.patch |
91 |
+++ b/net-irc/psybnc/files/psybnc-2.3.2.9-multinetwork.patch |
92 |
@@ -1,5 +1,5 @@ |
93 |
---- config.h.orig 2009-06-10 21:30:24.000000000 +0000 |
94 |
-+++ config.h 2009-06-10 21:30:39.000000000 +0000 |
95 |
+--- a/config.h.orig 2009-06-10 21:30:24.000000000 +0000 |
96 |
++++ b/config.h 2009-06-10 21:30:39.000000000 +0000 |
97 |
@@ -50,6 +50,10 @@ |
98 |
|
99 |
#define BLOCKDNS |
100 |
|
101 |
diff --git a/net-irc/psybnc/files/psybnc-2.3.2.9-oidentd.patch b/net-irc/psybnc/files/psybnc-2.3.2.9-oidentd.patch |
102 |
index fbb4b163e3a..afc0dcfa140 100644 |
103 |
--- a/net-irc/psybnc/files/psybnc-2.3.2.9-oidentd.patch |
104 |
+++ b/net-irc/psybnc/files/psybnc-2.3.2.9-oidentd.patch |
105 |
@@ -1,5 +1,5 @@ |
106 |
---- config.h.orig 2008-12-14 20:02:57.000000000 +0000 |
107 |
-+++ config.h 2008-12-14 20:03:35.000000000 +0000 |
108 |
+--- a/config.h 2008-12-14 20:02:57.000000000 +0000 |
109 |
++++ b/config.h 2008-12-14 20:03:35.000000000 +0000 |
110 |
@@ -14,6 +14,10 @@ |
111 |
|
112 |
#define TRANSLATE |
113 |
|
114 |
diff --git a/net-irc/psybnc/files/psybnc-2.3.2.9-scripting.patch b/net-irc/psybnc/files/psybnc-2.3.2.9-scripting.patch |
115 |
index 08dce4fa715..a8586e0638d 100644 |
116 |
--- a/net-irc/psybnc/files/psybnc-2.3.2.9-scripting.patch |
117 |
+++ b/net-irc/psybnc/files/psybnc-2.3.2.9-scripting.patch |
118 |
@@ -1,5 +1,5 @@ |
119 |
---- config.h.orig 2009-01-03 17:30:41.000000000 +0000 |
120 |
-+++ config.h 2009-01-03 17:31:27.000000000 +0000 |
121 |
+--- a/config.h.orig 2009-01-03 17:30:41.000000000 +0000 |
122 |
++++ b/config.h 2009-01-03 17:31:27.000000000 +0000 |
123 |
@@ -26,6 +26,10 @@ |
124 |
|
125 |
#define TRAFFICLOG |
126 |
|
127 |
diff --git a/net-irc/psybnc/psybnc-2.3.2.9-r3.ebuild b/net-irc/psybnc/psybnc-2.3.2.9-r3.ebuild |
128 |
new file mode 100644 |
129 |
index 00000000000..f7dc538ded2 |
130 |
--- /dev/null |
131 |
+++ b/net-irc/psybnc/psybnc-2.3.2.9-r3.ebuild |
132 |
@@ -0,0 +1,159 @@ |
133 |
+# Copyright 1999-2018 Gentoo Foundation |
134 |
+# Distributed under the terms of the GNU General Public License v2 |
135 |
+ |
136 |
+EAPI=7 |
137 |
+ |
138 |
+inherit toolchain-funcs user |
139 |
+ |
140 |
+MY_PV="$(ver_rs 3 -)" |
141 |
+PSYBNC_HOME="/var/lib/psybnc" |
142 |
+ |
143 |
+DESCRIPTION="A multi-user and multi-server gateway to IRC networks" |
144 |
+HOMEPAGE="http://www.psybnc.at/index.html" |
145 |
+SRC_URI="http://www.psybnc.at/download/beta/psyBNC-${MY_PV}.tar.gz" |
146 |
+ |
147 |
+LICENSE="GPL-2" |
148 |
+SLOT="0" |
149 |
+KEYWORDS="~amd64 ~sparc ~x86 ~ppc" |
150 |
+IUSE="ipv6 ssl oidentd scripting multinetwork" |
151 |
+ |
152 |
+DEPEND="ssl? ( >=dev-libs/openssl-0.9.7d ) |
153 |
+ oidentd? ( >=net-misc/oidentd-2.0 )" |
154 |
+RDEPEND="${DEPEND}" |
155 |
+S="${WORKDIR}"/"${PN}" |
156 |
+ |
157 |
+pkg_setup() { |
158 |
+ enewgroup psybnc |
159 |
+ enewuser psybnc -1 -1 ${PSYBNC_HOME} psybnc |
160 |
+} |
161 |
+ |
162 |
+src_unpack() { |
163 |
+ unpack ${A} |
164 |
+ cd "${S}" || die |
165 |
+ |
166 |
+ # Useless files |
167 |
+ rm -f */INFO || die |
168 |
+ |
169 |
+ # Pretend we already have a certificate, we generate it in pkg_config |
170 |
+ touch key/psybnc.cert.pem || die |
171 |
+ |
172 |
+ if [[ -f ${ROOT}/usr/share/psybnc/salt.h ]]; then |
173 |
+ einfo "Using existing salt.h for password encryption" |
174 |
+ cp "${ROOT}"/usr/share/psybnc/salt.h salt.h || die |
175 |
+ fi |
176 |
+} |
177 |
+ |
178 |
+src_prepare() { |
179 |
+ default |
180 |
+ eapply "${FILESDIR}/compile.diff" |
181 |
+ eapply "${FILESDIR}/ldflags-fix.patch" |
182 |
+ |
183 |
+ # add oidentd |
184 |
+ use oidentd && eapply "${FILESDIR}/${P}-oidentd.patch" |
185 |
+ |
186 |
+ # add scripting support |
187 |
+ use scripting && eapply "${FILESDIR}/${P}-scripting.patch" |
188 |
+ |
189 |
+ # add multinetwork support |
190 |
+ use multinetwork && eapply "${FILESDIR}/${P}-multinetwork.patch" |
191 |
+ |
192 |
+ # Prevent stripping the binary |
193 |
+ sed -i -e "/@strip/ d" tools/autoconf.c || die |
194 |
+} |
195 |
+ |
196 |
+src_compile() { |
197 |
+ if use ipv6; then |
198 |
+ rm -f tools/chkipv6.c || die |
199 |
+ fi |
200 |
+ if use ssl; then |
201 |
+ rm -f tools/chkssl.c || die |
202 |
+ fi |
203 |
+ |
204 |
+ emake CC="$(tc-getCC)" CFLAGS="${CFLAGS}" LDFLAGS="${LDFLAGS}" |
205 |
+} |
206 |
+ |
207 |
+src_install() { |
208 |
+ dobin psybnc |
209 |
+ |
210 |
+ insinto /usr/share/psybnc |
211 |
+ doins -r help lang salt.h |
212 |
+ fperms 0600 /usr/share/psybnc/salt.h |
213 |
+ |
214 |
+ insinto /etc/psybnc |
215 |
+ doins "${FILESDIR}"/psybnc.conf |
216 |
+ |
217 |
+ keepdir "${PSYBNC_HOME}"/{log,motd,scripts} |
218 |
+ dosym /usr/share/psybnc/lang "${PSYBNC_HOME}"/lang |
219 |
+ dosym /usr/share/psybnc/help "${PSYBNC_HOME}"/help |
220 |
+ |
221 |
+ fowners psybnc:psybnc "${PSYBNC_HOME}"/{,log,motd,scripts} /etc/psybnc/psybnc.conf |
222 |
+ fperms 0750 "${PSYBNC_HOME}"/{,log,motd,scripts} |
223 |
+ fperms 0640 /etc/psybnc/psybnc.conf |
224 |
+ |
225 |
+ if use ssl; then |
226 |
+ keepdir /etc/psybnc/ssl |
227 |
+ dosym /etc/psybnc/ssl "${PSYBNC_HOME}"/key |
228 |
+ else |
229 |
+ # Drop SSL listener from psybnc.conf |
230 |
+ sed -i -e "/^# Default SSL listener$/,+4 d" "${D}"/etc/psybnc/psybnc.conf || die |
231 |
+ fi |
232 |
+ |
233 |
+ if use oidentd; then |
234 |
+ insinto /etc |
235 |
+ doins "${FILESDIR}"/oidentd.conf.psybnc |
236 |
+ fperms 640 /etc/oidentd.conf.psybnc |
237 |
+ # install init-script with oidentd-support |
238 |
+ newinitd "${FILESDIR}"/psybnc-oidentd.initd psybnc |
239 |
+ else |
240 |
+ # install init-script without oidentd-support |
241 |
+ newinitd "${FILESDIR}"/psybnc.initd psybnc |
242 |
+ fi |
243 |
+ |
244 |
+ newconfd "${FILESDIR}"/psybnc.confd psybnc |
245 |
+ |
246 |
+ dodoc CHANGES FAQ README SCRIPTING TODO |
247 |
+ docinto example-script |
248 |
+ dodoc scripts/example/DEFAULT.SCRIPT |
249 |
+} |
250 |
+ |
251 |
+pkg_config() { |
252 |
+ if use ssl; then |
253 |
+ if [[ -f ${ROOT}/etc/psybnc/ssl/psybnc.cert.pem || -f ${ROOT}/etc/psybnc/ssl/psybnc.key.pem ]]; then |
254 |
+ ewarn "Existing /etc/psybnc/psybnc.cert.pem or /etc/psybnc/psybnc.key.pem found!" |
255 |
+ ewarn "Remove /etc/psybnc/psybnc.*.pem and run emerge --config =${CATEGORY}/${PF} again." |
256 |
+ return |
257 |
+ fi |
258 |
+ |
259 |
+ einfo "Generating certificate request..." |
260 |
+ openssl req -new -out "${ROOT}"/etc/psybnc/ssl/psybnc.req.pem \ |
261 |
+ -keyout "${ROOT}"/etc/psybnc/ssl/psybnc.key.pem -nodes || die |
262 |
+ einfo "Generating self-signed certificate..." |
263 |
+ openssl req -x509 -days 365 -in "${ROOT}"/etc/psybnc/ssl/psybnc.req.pem \ |
264 |
+ -key "${ROOT}"/etc/psybnc/ssl/psybnc.key.pem \ |
265 |
+ -out "${ROOT}"/etc/psybnc/ssl/psybnc.cert.pem || die |
266 |
+ einfo "Setting permissions on files..." |
267 |
+ chown root:psybnc "${ROOT}"/etc/psybnc/ssl/psybnc.{cert,key,req}.pem || die |
268 |
+ chmod 0640 "${ROOT}"/etc/psybnc/ssl/psybnc.{cert,key,req}.pem || die |
269 |
+ fi |
270 |
+} |
271 |
+ |
272 |
+pkg_postinst() { |
273 |
+ if use ssl; then |
274 |
+ elog |
275 |
+ elog "Please run \"emerge --config =${CATEGORY}/${PF}\" to create needed SSL certificates." |
276 |
+ fi |
277 |
+ if use oidentd; then |
278 |
+ elog |
279 |
+ elog "You have enabled oidentd-support. You will need to set" |
280 |
+ elog "up your /etc/oident.conf file before running psybnc. An example" |
281 |
+ elog "for psyBNC can be found under /etc/oidentd.conf.psybnc" |
282 |
+ fi |
283 |
+ elog |
284 |
+ elog "You can connect to psyBNC on port 23998 with user gentoo and password gentoo." |
285 |
+ elog "Please edit the psyBNC configuration at /etc/psybnc/psybnc.conf to change this." |
286 |
+ elog |
287 |
+ elog "To be able to reuse an existing psybnc.conf, you need to make sure that the" |
288 |
+ elog "old salt.h is available at /usr/share/psybnc/salt.h when compiling a new" |
289 |
+ elog "version of psyBNC. It is needed for password encryption and decryption." |
290 |
+ elog |
291 |
+} |