1 |
commit: 25ec114c14413ef58d51274f8f1ac800b19c650c |
2 |
Author: Louis Sautier <sbraz <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sun Jul 15 22:11:56 2018 +0000 |
4 |
Commit: Louis Sautier <sbraz <AT> gentoo <DOT> org> |
5 |
CommitDate: Sun Jul 15 22:40:41 2018 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=25ec114c |
7 |
|
8 |
net-irc/znc: bump to 1.7.1_rc1, fixes multiple vulnerabilities |
9 |
|
10 |
Bug: https://bugs.gentoo.org/661228 |
11 |
Package-Manager: Portage-2.3.42, Repoman-2.3.9 |
12 |
|
13 |
net-irc/znc/Manifest | 1 + |
14 |
net-irc/znc/files/znc-1.7.1-inttest-dir.patch | 64 +++++++++ |
15 |
net-irc/znc/znc-1.7.1_rc1.ebuild | 182 ++++++++++++++++++++++++++ |
16 |
3 files changed, 247 insertions(+) |
17 |
|
18 |
diff --git a/net-irc/znc/Manifest b/net-irc/znc/Manifest |
19 |
index c68a275dfe4..08205bafd48 100644 |
20 |
--- a/net-irc/znc/Manifest |
21 |
+++ b/net-irc/znc/Manifest |
22 |
@@ -3,3 +3,4 @@ DIST gtest-ba96d0b1161f540656efdaed035b3c062b60e006.tar.gz 987370 BLAKE2B fcedfe |
23 |
DIST znc-1.6.5.tar.gz 1470681 BLAKE2B 9de0b211280489423bc2894d0e76d7276aa42428d07d64516372a9ca6d1616db1f27c0142b54160c61cbee89d65ceadf941d001319254dbff9eb5b016988482e SHA512 d78603ac86d1fb92cdf591b1eb6d32fa19b0e39414bd69e1300c537051612ae590c43d3b8e4dd598cdff605bf3aa1d3d5d806edd428d15d50f733e1670f3e626 |
24 |
DIST znc-1.6.6.tar.gz 1471612 BLAKE2B 8bd977a95417c4259e9f38759d838f55a146f376dc8bb6230ab6e1b698fb7c9e060cbc237efd4e836961314abab56cc02e7c6bc74e40bad17abaf06e47fbb516 SHA512 cc5bc7328bfe36525ab215b4b53c7cd20aa02b41e7bb28507ff9d9632560f4c30396804e4b828bca0ece19f42813e3fce59d1bae639ea5fc149059f6979e63e7 |
25 |
DIST znc-1.7.0.tar.gz 1853666 BLAKE2B 3e519d4005a10a9a5329f22ab6abbd19dfa2c7cecb949c138bc72909eae8883576fc0352e3ac46b852b8c58f038150419720aa48791a1339b004206f3afc20e9 SHA512 718dec65dfa2374c568b2694e4faef1f8cf313ae96d171e2263656e077e0fae5f8037c69a23ae33f4ea314ac6e15480c7dccef73ad3ac9324eb79caca622d54b |
26 |
+DIST znc-1.7.1-rc1.tar.gz 2041320 BLAKE2B 62669b598d7423cb55fad458fe6172be36904e8599dcde757936883093f24deb6a5ed6a093e3e92854810f02e96372f44139f9807e70e0cf007de90a1373c6a8 SHA512 b4e223c86c75bc97620c52333d90d6458a02777dce9c629f8a095f8134a06992a60978b2fe8bbce29ed1155932f9f37e0a324a498ee16527b0235e4306c34973 |
27 |
|
28 |
diff --git a/net-irc/znc/files/znc-1.7.1-inttest-dir.patch b/net-irc/znc/files/znc-1.7.1-inttest-dir.patch |
29 |
new file mode 100644 |
30 |
index 00000000000..9aff2a9b64b |
31 |
--- /dev/null |
32 |
+++ b/net-irc/znc/files/znc-1.7.1-inttest-dir.patch |
33 |
@@ -0,0 +1,64 @@ |
34 |
+commit 95f1c7e9081866ea1e716743ea039a74565f80c6 |
35 |
+Author: Louis Sautier <sautier.louis@×××××.com> |
36 |
+Date: Sun Jul 15 15:36:21 2018 +0200 |
37 |
+ |
38 |
+ Allow integration tests to be run inside a different root |
39 |
+ |
40 |
+ Based on DarthGandalf's patch submitted in |
41 |
+ https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=15112014e7605d13624297d7601504b5d187a6de |
42 |
+ |
43 |
+diff --git a/include/znc/znc.h b/include/znc/znc.h |
44 |
+index ecb2b41a..a791a648 100644 |
45 |
+--- a/include/znc/znc.h |
46 |
++++ b/include/znc/znc.h |
47 |
+@@ -251,6 +251,7 @@ class CZNC : private CCoreTranslationMixin { |
48 |
+ void DisableConfigTimer(); |
49 |
+ |
50 |
+ static void DumpConfig(const CConfig* Config); |
51 |
++ static CString UnusualRoot(); |
52 |
+ |
53 |
+ private: |
54 |
+ static CString FormatBindError(); |
55 |
+diff --git a/src/Modules.cpp b/src/Modules.cpp |
56 |
+index 5aec7805..6f9c34ae 100644 |
57 |
+--- a/src/Modules.cpp |
58 |
++++ b/src/Modules.cpp |
59 |
+@@ -1899,9 +1899,10 @@ CModules::ModDirList CModules::GetModDirs() { |
60 |
+ sDir = CZNC::Get().GetModPath() + "/"; |
61 |
+ ret.push(std::make_pair(sDir, sDir)); |
62 |
+ |
63 |
++ CString sUnusualRoot = CZNC::UnusualRoot(); |
64 |
+ // <moduledir> and <datadir> (<prefix>/lib/znc) |
65 |
+- ret.push(std::make_pair(_MODDIR_ + CString("/"), |
66 |
+- _DATADIR_ + CString("/modules/"))); |
67 |
++ ret.push(std::make_pair(sUnusualRoot + _MODDIR_ + CString("/"), |
68 |
++ sUnusualRoot + _DATADIR_ + CString("/modules/"))); |
69 |
+ |
70 |
+ return ret; |
71 |
+ } |
72 |
+diff --git a/src/WebModules.cpp b/src/WebModules.cpp |
73 |
+index a5841987..f1b8a421 100644 |
74 |
+--- a/src/WebModules.cpp |
75 |
++++ b/src/WebModules.cpp |
76 |
+@@ -565,7 +565,7 @@ CString CWebSock::GetSkinPath(const CString& sSkinName) { |
77 |
+ sRet = CZNC::Get().GetCurPath() + "/webskins/" + sSkin; |
78 |
+ |
79 |
+ if (!CFile::IsDir(sRet)) { |
80 |
+- sRet = CString(_SKINDIR_) + "/" + sSkin; |
81 |
++ sRet = CZNC::UnusualRoot() + CString(_SKINDIR_) + "/" + sSkin; |
82 |
+ } |
83 |
+ } |
84 |
+ |
85 |
+diff --git a/src/znc.cpp b/src/znc.cpp |
86 |
+index 4e7216ee..dd901497 100644 |
87 |
+--- a/src/znc.cpp |
88 |
++++ b/src/znc.cpp |
89 |
+@@ -2130,3 +2130,8 @@ void CZNC::DisableConfigTimer() { |
90 |
+ m_pConfigTimer = nullptr; |
91 |
+ } |
92 |
+ } |
93 |
++ |
94 |
++CString CZNC::UnusualRoot() { |
95 |
++ char* szUnusualRoot = getenv("ZNC_UNUSUAL_ROOT"); |
96 |
++ return szUnusualRoot ? szUnusualRoot : ""; |
97 |
++} |
98 |
|
99 |
diff --git a/net-irc/znc/znc-1.7.1_rc1.ebuild b/net-irc/znc/znc-1.7.1_rc1.ebuild |
100 |
new file mode 100644 |
101 |
index 00000000000..e59849a6e29 |
102 |
--- /dev/null |
103 |
+++ b/net-irc/znc/znc-1.7.1_rc1.ebuild |
104 |
@@ -0,0 +1,182 @@ |
105 |
+# Copyright 1999-2018 Gentoo Foundation |
106 |
+# Distributed under the terms of the GNU General Public License v2 |
107 |
+ |
108 |
+EAPI=6 |
109 |
+ |
110 |
+PYTHON_COMPAT=( python3_{4,5,6} ) |
111 |
+ |
112 |
+inherit cmake-utils python-single-r1 readme.gentoo-r1 systemd user |
113 |
+ |
114 |
+GTEST_VER="ba96d0b1161f540656efdaed035b3c062b60e006" # 1.8.0 is too old, but newer version not released yet |
115 |
+GTEST_URL="https://github.com/google/googletest/archive/${GTEST_VER}.tar.gz -> gtest-${GTEST_VER}.tar.gz" |
116 |
+DESCRIPTION="An advanced IRC Bouncer" |
117 |
+ |
118 |
+if [[ ${PV} == *9999* ]]; then |
119 |
+ inherit git-r3 |
120 |
+ EGIT_REPO_URI=${EGIT_REPO_URI:-"https://github.com/znc/znc.git"} |
121 |
+ SRC_URI="" |
122 |
+else |
123 |
+ MY_PV=${PV/_/-} |
124 |
+ MY_P=${PN}-${MY_PV} |
125 |
+ SRC_URI=" |
126 |
+ https://znc.in/releases/archive/${MY_P}.tar.gz |
127 |
+ test? ( ${GTEST_URL} ) |
128 |
+ " |
129 |
+ KEYWORDS="~amd64 ~arm ~x86" |
130 |
+ S=${WORKDIR}/${MY_P} |
131 |
+fi |
132 |
+ |
133 |
+HOMEPAGE="https://znc.in" |
134 |
+LICENSE="Apache-2.0" |
135 |
+SLOT="0" |
136 |
+IUSE="+ipv6 +icu libressl nls perl python +ssl sasl tcl test +zlib" |
137 |
+ |
138 |
+REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} icu )" |
139 |
+ |
140 |
+RDEPEND=" |
141 |
+ icu? ( dev-libs/icu:= ) |
142 |
+ nls? ( dev-libs/boost:=[nls] ) |
143 |
+ perl? ( >=dev-lang/perl-5.10:= ) |
144 |
+ python? ( ${PYTHON_DEPS} ) |
145 |
+ sasl? ( >=dev-libs/cyrus-sasl-2 ) |
146 |
+ ssl? ( |
147 |
+ !libressl? ( dev-libs/openssl:0= ) |
148 |
+ libressl? ( dev-libs/libressl:0= ) |
149 |
+ ) |
150 |
+ tcl? ( dev-lang/tcl:0= ) |
151 |
+ zlib? ( sys-libs/zlib:0= ) |
152 |
+" |
153 |
+DEPEND=" |
154 |
+ ${RDEPEND} |
155 |
+ virtual/pkgconfig |
156 |
+ nls? ( sys-devel/gettext ) |
157 |
+ perl? ( >=dev-lang/swig-3.0.0 ) |
158 |
+ python? ( >=dev-lang/swig-3.0.0 ) |
159 |
+ test? ( dev-qt/qtnetwork:5 ) |
160 |
+" |
161 |
+ |
162 |
+PATCHES=( "${FILESDIR}"/${PN}-1.7.1-inttest-dir.patch ) |
163 |
+ |
164 |
+pkg_setup() { |
165 |
+ if use python; then |
166 |
+ python-single-r1_pkg_setup |
167 |
+ fi |
168 |
+ |
169 |
+ enewgroup ${PN} |
170 |
+ enewuser ${PN} -1 -1 /var/lib/${PN} ${PN} |
171 |
+ # The home directory was previously set to /dev/null |
172 |
+ # This caused a bug with the systemd unit |
173 |
+ # https://bugs.gentoo.org/521916 |
174 |
+ esethome ${PN} /var/lib/${PN} |
175 |
+} |
176 |
+ |
177 |
+src_prepare() { |
178 |
+ # Let SWIG rebuild modperl/modpython to make user patching easier. |
179 |
+ if [[ ${PV} != *9999* ]]; then |
180 |
+ rm modules/modperl/generated.tar.gz || die |
181 |
+ rm modules/modpython/generated.tar.gz || die |
182 |
+ fi |
183 |
+ |
184 |
+ sed -i -e "s|DZNC_BIN_DIR:path=|DZNC_BIN_DIR:path=${T}/inttest|" \ |
185 |
+ test/CMakeLists.txt || die |
186 |
+ |
187 |
+ cmake-utils_src_prepare |
188 |
+} |
189 |
+ |
190 |
+src_configure() { |
191 |
+ local mycmakeargs=( |
192 |
+ -DWANT_SYSTEMD=yes # Causes -DSYSTEMD_DIR to be used. |
193 |
+ -DSYSTEMD_DIR="$(systemd_get_systemunitdir)" |
194 |
+ -DWANT_ICU="$(usex icu)" |
195 |
+ -DWANT_IPV6="$(usex ipv6)" |
196 |
+ -DWANT_I18N="$(usex nls)" |
197 |
+ -DWANT_PERL="$(usex perl)" |
198 |
+ -DWANT_PYTHON="$(usex python)" |
199 |
+ -DWANT_CYRUS="$(usex sasl)" |
200 |
+ -DWANT_OPENSSL="$(usex ssl)" |
201 |
+ -DWANT_TCL="$(usex tcl)" |
202 |
+ -DWANT_ZLIB="$(usex zlib)" |
203 |
+ ) |
204 |
+ |
205 |
+ if [[ ${PV} != *9999* ]] && use test; then |
206 |
+ export GTEST_ROOT="${WORKDIR}/googletest-${GTEST_VER}/googletest" |
207 |
+ export GMOCK_ROOT="${WORKDIR}/googletest-${GTEST_VER}/googlemock" |
208 |
+ fi |
209 |
+ |
210 |
+ cmake-utils_src_configure |
211 |
+} |
212 |
+ |
213 |
+src_test() { |
214 |
+ cmake-utils_src_make unittest |
215 |
+ if has network-sandbox ${FEATURES}; then |
216 |
+ cmake-utils_src_make install DESTDIR="${T}/inttest" |
217 |
+ local filter='-' |
218 |
+ if ! use perl; then |
219 |
+ filter="${filter}:ZNCTest.Modperl*" |
220 |
+ fi |
221 |
+ if ! use python; then |
222 |
+ filter="${filter}:ZNCTest.Modpython*" |
223 |
+ fi |
224 |
+ # CMAKE_PREFIX_PATH and CXXFLAGS are needed for znc-buildmod |
225 |
+ # invocations from inside the test |
226 |
+ GTEST_FILTER="${filter}" ZNC_UNUSUAL_ROOT="${T}/inttest" \ |
227 |
+ CMAKE_PREFIX_PATH="${T}/inttest/usr/share/znc/cmake" \ |
228 |
+ CXXFLAGS="${CXXFLAGS} -isystem ${T}/inttest/usr/include" \ |
229 |
+ cmake-utils_src_make inttest |
230 |
+ else |
231 |
+ # TODO: don't require sandbox after |
232 |
+ # https://github.com/znc/znc/pull/1363 is implemented |
233 |
+ ewarn "FEATURES=-network-sandbox; skipping integration tests which" |
234 |
+ ewarn "temporary open local ports." |
235 |
+ fi |
236 |
+} |
237 |
+ |
238 |
+src_install() { |
239 |
+ cmake-utils_src_install |
240 |
+ |
241 |
+ dodoc NOTICE |
242 |
+ newinitd "${FILESDIR}"/znc.initd-r2 znc |
243 |
+ newconfd "${FILESDIR}"/znc.confd-r1 znc |
244 |
+ |
245 |
+ DOC_CONTENTS=$(<"${FILESDIR}/README.gentoo-r1") || die |
246 |
+ DISABLE_AUTOFORMATTING=1 |
247 |
+ readme.gentoo_create_doc |
248 |
+} |
249 |
+ |
250 |
+pkg_postinst() { |
251 |
+ if [[ -z "${REPLACING_VERSIONS}" ]]; then |
252 |
+ # This is a new installation |
253 |
+ readme.gentoo_print_elog |
254 |
+ fi |
255 |
+ |
256 |
+ if [[ -d "${EROOT%/}"/etc/znc ]]; then |
257 |
+ ewarn "${EROOT%/}/etc/znc exists on your system." |
258 |
+ ewarn "Due to the nature of the contents of that folder," |
259 |
+ ewarn "we have changed the default configuration to use" |
260 |
+ ewarn " ${EROOT%/}/var/lib/znc" |
261 |
+ ewarn "please move ${EROOT%/}/etc/znc to ${EROOT%/}/var/lib/znc" |
262 |
+ ewarn "or adjust your service configuration." |
263 |
+ fi |
264 |
+} |
265 |
+ |
266 |
+pkg_config() { |
267 |
+ if [[ -e "${EROOT%/}/var/lib/znc" ]]; then |
268 |
+ ewarn "${EROOT%/}/var/lib/znc already exists, aborting to avoid damaging" |
269 |
+ ewarn "any existing configuration. If you are sure you want" |
270 |
+ ewarn "to generate a new configuration, remove the folder" |
271 |
+ ewarn "and try again." |
272 |
+ else |
273 |
+ einfo "Press enter to interactively create a new configuration file for znc." |
274 |
+ einfo "To abort, press Control-C" |
275 |
+ read |
276 |
+ mkdir -p "${EROOT%/}/var/lib/znc" || die |
277 |
+ chown -R ${PN}:${PN} "${EROOT%/}/var/lib/znc" || |
278 |
+ die "Setting permissions failed" |
279 |
+ start-stop-daemon --start --user ${PN}:${PN} --env ZNC_NO_LAUNCH_AFTER_MAKECONF=1 \ |
280 |
+ "${EROOT%/}"/usr/bin/znc -- --makeconf --datadir "${EROOT%/}/var/lib/znc" || |
281 |
+ die "Config failed" |
282 |
+ einfo |
283 |
+ einfo "You can now start the znc service using the init system of your choice." |
284 |
+ einfo "Don't forget to enable it if you want to use znc at boot." |
285 |
+ fi |
286 |
+} |