1 |
commit: 1fbc7d68335e35af898606f1dfdaedf9bf6bea14 |
2 |
Author: Julian Ospald <hasufell <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sun Sep 20 12:57:34 2015 +0000 |
4 |
Commit: Julian Ospald <hasufell <AT> gentoo <DOT> org> |
5 |
CommitDate: Sun Sep 20 12:58:23 2015 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1fbc7d68 |
7 |
|
8 |
net-irc/znc: add libressl support |
9 |
|
10 |
net-irc/znc/files/znc-1.6.1-libressl.patch | 19 +++++ |
11 |
.../znc/{znc-9999.ebuild => znc-1.6.1-r1.ebuild} | 89 ++++++++++++++-------- |
12 |
net-irc/znc/znc-9999.ebuild | 7 +- |
13 |
3 files changed, 83 insertions(+), 32 deletions(-) |
14 |
|
15 |
diff --git a/net-irc/znc/files/znc-1.6.1-libressl.patch b/net-irc/znc/files/znc-1.6.1-libressl.patch |
16 |
new file mode 100644 |
17 |
index 0000000..8bbe9cf |
18 |
--- /dev/null |
19 |
+++ b/net-irc/znc/files/znc-1.6.1-libressl.patch |
20 |
@@ -0,0 +1,19 @@ |
21 |
+$OpenBSD: patch-src_Csocket_cpp,v 1.1 2014/07/12 14:42:37 pascal Exp $ |
22 |
+--- src/Csocket.cpp.orig Sat Jul 12 16:03:48 2014 |
23 |
++++ src/Csocket.cpp Sat Jul 12 16:04:36 2014 |
24 |
+@@ -555,6 +555,7 @@ bool InitSSL( ECompType eCompressionType ) |
25 |
+ } |
26 |
+ #endif /* _WIN32 */ |
27 |
+ |
28 |
++#ifndef OPENSSL_NO_COMP |
29 |
+ COMP_METHOD *cm = NULL; |
30 |
+ |
31 |
+ if( CT_ZLIB & eCompressionType ) |
32 |
+@@ -570,6 +571,7 @@ bool InitSSL( ECompType eCompressionType ) |
33 |
+ if( cm ) |
34 |
+ SSL_COMP_add_compression_method( CT_RLE, cm ); |
35 |
+ } |
36 |
++#endif |
37 |
+ |
38 |
+ // setting this up once in the begining |
39 |
+ g_iCsockSSLIdx = SSL_get_ex_new_index( 0, ( void * )"CsockGlobalIndex", NULL, NULL, NULL ); |
40 |
|
41 |
diff --git a/net-irc/znc/znc-9999.ebuild b/net-irc/znc/znc-1.6.1-r1.ebuild |
42 |
similarity index 59% |
43 |
copy from net-irc/znc/znc-9999.ebuild |
44 |
copy to net-irc/znc/znc-1.6.1-r1.ebuild |
45 |
index cff81dc..a6f8c03 100644 |
46 |
--- a/net-irc/znc/znc-9999.ebuild |
47 |
+++ b/net-irc/znc/znc-1.6.1-r1.ebuild |
48 |
@@ -5,20 +5,21 @@ |
49 |
EAPI=5 |
50 |
|
51 |
PYTHON_COMPAT=( python{3_3,3_4} ) |
52 |
-inherit autotools eutils python-single-r1 user |
53 |
+inherit eutils python-single-r1 systemd user |
54 |
|
55 |
MY_PV=${PV/_/-} |
56 |
+GTEST_VER="1.7.0" |
57 |
+GTEST_URL="https://googletest.googlecode.com/files/gtest-${GTEST_VER}.zip" |
58 |
DESCRIPTION="An advanced IRC Bouncer" |
59 |
|
60 |
-inherit git-r3 |
61 |
-EGIT_REPO_URI=${EGIT_REPO_URI:-"git://github.com/znc/znc.git"} |
62 |
-SRC_URI="" |
63 |
-KEYWORDS="" |
64 |
+SRC_URI="http://znc.in/releases/${PN}-${MY_PV}.tar.gz |
65 |
+ test? ( ${GTEST_URL} )" |
66 |
+KEYWORDS="~amd64 ~arm ~x86" |
67 |
|
68 |
HOMEPAGE="http://znc.in" |
69 |
LICENSE="GPL-2" |
70 |
SLOT="0" |
71 |
-IUSE="daemon debug ipv6 perl python ssl sasl tcl" |
72 |
+IUSE="daemon debug ipv6 libressl perl python ssl sasl tcl test" |
73 |
|
74 |
REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )" |
75 |
|
76 |
@@ -28,7 +29,10 @@ RDEPEND=" |
77 |
perl? ( >=dev-lang/perl-5.10 ) |
78 |
python? ( ${PYTHON_DEPS} ) |
79 |
sasl? ( >=dev-libs/cyrus-sasl-2 ) |
80 |
- ssl? ( >=dev-libs/openssl-0.9.7d:0 ) |
81 |
+ ssl? ( |
82 |
+ !libressl? ( dev-libs/openssl:0 ) |
83 |
+ libressl? ( dev-libs/libressl ) |
84 |
+ ) |
85 |
tcl? ( dev-lang/tcl:0= ) |
86 |
" |
87 |
DEPEND="${RDEPEND} |
88 |
@@ -43,7 +47,13 @@ DEPEND="${RDEPEND} |
89 |
|
90 |
S=${WORKDIR}/${PN}-${MY_PV} |
91 |
|
92 |
-CONFDIR="/var/lib/znc" |
93 |
+PATCHES=( |
94 |
+ "${FILESDIR}"/${PN}-1.6.1-systemwideconfig.patch |
95 |
+ "${FILESDIR}"/${PN}-1.6.1-create-pidfile-per-default.patch |
96 |
+ "${FILESDIR}"/${PN}-1.6.1-libressl.patch |
97 |
+) |
98 |
+ |
99 |
+ZNC_DATADIR="${ZNC_DATADIR:-"/var/lib/znc"}" |
100 |
|
101 |
pkg_setup() { |
102 |
if use python; then |
103 |
@@ -55,28 +65,36 @@ pkg_setup() { |
104 |
fi |
105 |
} |
106 |
|
107 |
-src_prepare() { |
108 |
- AT_M4DIR="${S}/m4" \ |
109 |
- eautoreconf |
110 |
+src_unpack() { |
111 |
+ default |
112 |
+ |
113 |
+ if use test; then |
114 |
+ cd "${S}"/test || die "Failed to chdir into '${S}/test'" |
115 |
+ unpack ${GTEST_URL##*/} |
116 |
+ mv gtest-${GTEST_VER} gtest \ |
117 |
+ || die "Failed to rename '${S}/test/gtest-${GTEST_VER}' dir" |
118 |
+ fi |
119 |
+} |
120 |
|
121 |
- # build system quirk, it does not define AM_INIT_AUTOMAKE, nor |
122 |
- # does it have Makefile.am in the root dir, but we need '--add-missing' |
123 |
- automake --add-missing |
124 |
+src_prepare() { |
125 |
+ epatch ${PATCHES[@]} |
126 |
} |
127 |
|
128 |
src_configure() { |
129 |
econf \ |
130 |
+ --with-systemdsystemunitdir=$(systemd_get_unitdir) \ |
131 |
$(use_enable debug) \ |
132 |
$(use_enable ipv6) \ |
133 |
$(use_enable perl) \ |
134 |
$(use python && echo "--enable-python=python3") \ |
135 |
$(use_enable sasl cyrus) \ |
136 |
$(use_enable ssl openssl) \ |
137 |
- $(use_enable tcl tcl) |
138 |
+ $(use_enable tcl tcl) \ |
139 |
+ $(use_with test gtest "${S}/test/gtest") |
140 |
} |
141 |
|
142 |
src_install() { |
143 |
- emake install DESTDIR="${D}" |
144 |
+ emake install DESTDIR="${D%/}" |
145 |
dodoc NOTICE README.md |
146 |
if use daemon; then |
147 |
newinitd "${FILESDIR}"/znc.initd-r1 znc |
148 |
@@ -94,54 +112,65 @@ pkg_postinst() { |
149 |
elog |
150 |
elog "An init-script was installed in /etc/init.d" |
151 |
elog "A config file was installed in /etc/conf.d" |
152 |
- if [[ ! -d "${EROOT}${CONFDIR}" ]]; then |
153 |
+ if [[ ! -d "${EROOT}${ZNC_DATADIR}" ]]; then |
154 |
elog |
155 |
elog "Run 'emerge --config znc' under portage" |
156 |
elog "or 'cave config znc' under paludis to configure ZNC" |
157 |
elog "as a system-wide daemon." |
158 |
elog |
159 |
elog "To generate a new SSL certificate, run:" |
160 |
- elog " znc --system-wide-config-as znc --makepem -d ${CONFDIR}" |
161 |
+ elog " znc --system-wide-config-as znc --makepem -d ${ZNC_DATADIR}" |
162 |
elog "as root" |
163 |
elog |
164 |
elog "If migrating from a user-based install" |
165 |
elog "you can use your existing config files:" |
166 |
- elog " mkdir ${CONFDIR}" |
167 |
- elog " mv /home/\$USER/.znc/* ${CONFDIR}" |
168 |
+ elog " mkdir ${ZNC_DATADIR}" |
169 |
+ elog " mv /home/\$USER/.znc/* ${ZNC_DATADIR}" |
170 |
elog " rm -rf /home/\$USER/.znc" |
171 |
- elog " chown -R znc:znc ${CONFDIR}" |
172 |
+ elog " chown -R znc:znc ${ZNC_DATADIR}" |
173 |
elog |
174 |
elog "If you already have znc set up and want take advantage of the" |
175 |
elog "init script but skip of all the above, you can also edit" |
176 |
elog " /etc/conf.d/znc" |
177 |
elog "and adjust the variables to your current znc user and config" |
178 |
elog "location." |
179 |
+ elog |
180 |
+ elog "Please make sure that your existing configuration contains" |
181 |
+ elog " PidFile = /run/znc/znc.pid" |
182 |
+ elog "or that PidFile value matches the one in /etc/conf.d/znc" |
183 |
if [[ -d "${EROOT}"/etc/znc ]]; then |
184 |
elog |
185 |
ewarn "/etc/znc exists on your system." |
186 |
ewarn "Due to the nature of the contents of that folder," |
187 |
ewarn "we have changed the default configuration to use" |
188 |
- ewarn " /var/lib/znc" |
189 |
- ewarn "please move /etc/znc to /var/lib/znc" |
190 |
+ ewarn " ${ZNC_DATADIR}" |
191 |
+ ewarn "please move /etc/znc to ${ZNC_DATADIR}" |
192 |
ewarn "or adjust /etc/conf.d/znc" |
193 |
fi |
194 |
else |
195 |
- elog "Existing config detected in ${CONFDIR}" |
196 |
- elog "You're good to go :)" |
197 |
+ elog "Existing config detected in ${ZNC_DATADIR}" |
198 |
+ if ! systemd_is_booted; then |
199 |
+ elog |
200 |
+ elog "Please make sure that your existing configuration contains" |
201 |
+ elog " PidFile = /run/znc/znc.pid" |
202 |
+ elog "or that PidFile value matches the one in /etc/conf.d/znc" |
203 |
+ else |
204 |
+ elog "You're good to go :)" |
205 |
+ fi |
206 |
fi |
207 |
elog |
208 |
fi |
209 |
} |
210 |
|
211 |
pkg_config() { |
212 |
- if use daemon && ! [[ -d "${EROOT}${CONFDIR}" ]]; then |
213 |
+ if use daemon && ! [[ -d "${EROOT}${ZNC_DATADIR}" ]]; then |
214 |
einfo "Press ENTER to interactively create a new configuration file for znc." |
215 |
einfo "To abort, press Control-C" |
216 |
read |
217 |
- mkdir -p "${EROOT}${CONFDIR}" || die |
218 |
- chown -R ${PN}:${PN} "${EROOT}${CONFDIR}" || |
219 |
+ mkdir -p "${EROOT}${ZNC_DATADIR}" || die |
220 |
+ chown -R ${PN}:${PN} "${EROOT}${ZNC_DATADIR}" || |
221 |
die "Setting permissions failed" |
222 |
- "${EROOT}"/usr/bin/znc --system-wide-config-as znc -c -r -d "${EROOT}${CONFDIR}" || |
223 |
+ "${EROOT}"/usr/bin/znc --system-wide-config-as znc -c -r -d "${EROOT}${ZNC_DATADIR}" || |
224 |
die "Config failed" |
225 |
echo |
226 |
einfo "To start znc, run '/etc/init.d/znc start'" |
227 |
@@ -149,7 +178,7 @@ pkg_config() { |
228 |
einfo " rc-update add znc default" |
229 |
else |
230 |
if use daemon; then |
231 |
- ewarn "${CONFDIR} already exists, aborting to avoid damaging" |
232 |
+ ewarn "${ZNC_DATADIR} already exists, aborting to avoid damaging" |
233 |
ewarn "any existing configuration. If you are sure you want" |
234 |
ewarn "to generate a new configuration, remove the folder" |
235 |
ewarn "and try again." |
236 |
|
237 |
diff --git a/net-irc/znc/znc-9999.ebuild b/net-irc/znc/znc-9999.ebuild |
238 |
index cff81dc..561efde 100644 |
239 |
--- a/net-irc/znc/znc-9999.ebuild |
240 |
+++ b/net-irc/znc/znc-9999.ebuild |
241 |
@@ -18,7 +18,7 @@ KEYWORDS="" |
242 |
HOMEPAGE="http://znc.in" |
243 |
LICENSE="GPL-2" |
244 |
SLOT="0" |
245 |
-IUSE="daemon debug ipv6 perl python ssl sasl tcl" |
246 |
+IUSE="daemon debug ipv6 libressl perl python ssl sasl tcl" |
247 |
|
248 |
REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )" |
249 |
|
250 |
@@ -28,7 +28,10 @@ RDEPEND=" |
251 |
perl? ( >=dev-lang/perl-5.10 ) |
252 |
python? ( ${PYTHON_DEPS} ) |
253 |
sasl? ( >=dev-libs/cyrus-sasl-2 ) |
254 |
- ssl? ( >=dev-libs/openssl-0.9.7d:0 ) |
255 |
+ ssl? ( |
256 |
+ !libressl? ( dev-libs/openssl:0 ) |
257 |
+ libressl? ( dev-libs/libressl ) |
258 |
+ ) |
259 |
tcl? ( dev-lang/tcl:0= ) |
260 |
" |
261 |
DEPEND="${RDEPEND} |