Gentoo Archives: gentoo-commits

From: Justin Bronder <jsbronder@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: net-nntp/sabnzbd/, net-nntp/sabnzbd/files/1.1.x/
Date: Wed, 21 Sep 2016 23:57:52
Message-Id: 1474502229.348a867daf6cf5e57c0429fc30c62d6d4d9a2116.jsbronder@gentoo
1 commit: 348a867daf6cf5e57c0429fc30c62d6d4d9a2116
2 Author: Justin Bronder <jsbronder <AT> gentoo <DOT> org>
3 AuthorDate: Wed Sep 21 23:57:09 2016 +0000
4 Commit: Justin Bronder <jsbronder <AT> gentoo <DOT> org>
5 CommitDate: Wed Sep 21 23:57:09 2016 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=348a867d
7
8 net-nntp/sabnzbd: bump 1.1.0
9
10 Thanks to Sébastien P. for the report, #593494
11
12 Package-Manager: portage-2.2.28
13
14 net-nntp/sabnzbd/Manifest | 1 +
15 .../0001-use-system-configobj-and-feedparser.patch | 52 ++++++++
16 .../sabnzbd/files/1.1.x/0002-assume-gntp-1.0.patch | 25 ++++
17 .../1.1.x/0003-cfg-disable-growl-by-default.patch | 34 ++++++
18 .../files/1.1.x/0004-use-system-rarfile.patch | 68 +++++++++++
19 net-nntp/sabnzbd/sabnzbd-1.1.0.ebuild | 134 +++++++++++++++++++++
20 6 files changed, 314 insertions(+)
21
22 diff --git a/net-nntp/sabnzbd/Manifest b/net-nntp/sabnzbd/Manifest
23 index 62744e6..e3dca24 100644
24 --- a/net-nntp/sabnzbd/Manifest
25 +++ b/net-nntp/sabnzbd/Manifest
26 @@ -4,3 +4,4 @@ DIST SABnzbd-0.7.18-src.tar.gz 2317137 SHA256 aa05697d901b3e334e92f274b2e8788973
27 DIST SABnzbd-0.7.19-src.tar.gz 2386744 SHA256 31ad0ae24db3873011db816e1b100f4429734b2260f4c669b7261d2f85717487 SHA512 383788d87a3ee4e69ba818f6614f6929aa328d1153b746e04736868de598ee35e556a07cced7c74bc89c54fe77c1e52c4cdde8ed37d536a09bd1c605c551b9e7 WHIRLPOOL fbf1ab129a403011bd6957272d348fd745621e9c13f46f3988362bb8bb7a6ceb26b57253978ec5f5ae97c2ea942ba80ff1cab0ca1d1f99d33a1c55fc03b0dad9
28 DIST SABnzbd-0.7.20-src.tar.gz 2389762 SHA256 20b3a4613a0ecdede4fdfeb628ae806e458ac1a6fb684306328dd4ed1faf8742 SHA512 51ea888fcb7b49156cb719cb4fe75725d69acd726097d8b2526d6af87d0404bf08d0ab4b82f25dae7ac9a52d6c639e57a145bf5af6005fa435ad31f239a716d5 WHIRLPOOL 2686160be649c051ac1186481dae1e876650fbc91fe3ea1ab2d1569baea51f0ab7d0be6c7942b9facd6e5f856ab24ab36d1dc2f55dc645f06be275b2e43abb4b
29 DIST SABnzbd-1.0.3-src.tar.gz 2975111 SHA256 cf87d3f17fc03e8b3a4b3010261115c2ad7e2f773b5ede95a80025b340dbbd35 SHA512 6213cb73f6d2127133c5ab292e5ac2bcf6f4c780b5345b54b91459271c1acad6c6c95c4ba1ebc1e34341d5dc09d14e4806b84b977fc90f5ff0a49725b08a77e9 WHIRLPOOL 021a864f8d2b90481da5f4d1b3b1a5a5478230c3a61af2c30ba2be65594224863a48d58d475fc2e79986274e48e5ad83b5d13a6bc0a7829e99552062fdf185a7
30 +DIST SABnzbd-1.1.0-src.tar.gz 2736977 SHA256 3e86a897dea1c276c54ee38667a980f644f16d57df75612fe9eefa84b339ce9a SHA512 4fd4304253ec66c7bc6038fe8eb7bc08f0133cc4eda9efb28349242574744f262369fe43786da5a22eb90664cfa7fb91356941174787c4faef7d7624751a86d2 WHIRLPOOL f5ef42a01cd1c79f28bbd42c6970b9a1b66846af266c027354494cd103d03d14d2914a3d2b88b1aef740a6e849b9e3216c639323f41146553c5f2dcdeef182aa
31
32 diff --git a/net-nntp/sabnzbd/files/1.1.x/0001-use-system-configobj-and-feedparser.patch b/net-nntp/sabnzbd/files/1.1.x/0001-use-system-configobj-and-feedparser.patch
33 new file mode 100644
34 index 00000000..ef1a6fc
35 --- /dev/null
36 +++ b/net-nntp/sabnzbd/files/1.1.x/0001-use-system-configobj-and-feedparser.patch
37 @@ -0,0 +1,52 @@
38 +From af041fe9945276db0716a5342609b48aa2ac4363 Mon Sep 17 00:00:00 2001
39 +From: Justin Bronder <jsbronder@×××××.com>
40 +Date: Wed, 21 Sep 2016 19:35:16 -0400
41 +Subject: [PATCH 1/4] use system configobj and feedparser
42 +
43 +---
44 + sabnzbd/config.py | 4 +++-
45 + sabnzbd/rss.py | 3 ++-
46 + 2 files changed, 5 insertions(+), 2 deletions(-)
47 +
48 +diff --git a/sabnzbd/config.py b/sabnzbd/config.py
49 +index a59b265..36cc12c 100644
50 +--- a/sabnzbd/config.py
51 ++++ b/sabnzbd/config.py
52 +@@ -24,10 +24,12 @@ import re
53 + import logging
54 + import threading
55 + import shutil
56 ++
57 ++import configobj
58 ++
59 + import sabnzbd.misc
60 + from sabnzbd.constants import CONFIG_VERSION, NORMAL_PRIORITY, DEFAULT_PRIORITY, MAX_WIN_DFOLDER
61 + from sabnzbd.utils import listquote
62 +-from sabnzbd.utils import configobj
63 + from sabnzbd.decorators import synchronized
64 +
65 + CONFIG_LOCK = threading.Lock()
66 +diff --git a/sabnzbd/rss.py b/sabnzbd/rss.py
67 +index fc29e26..a7cdee1 100644
68 +--- a/sabnzbd/rss.py
69 ++++ b/sabnzbd/rss.py
70 +@@ -24,6 +24,8 @@ import logging
71 + import time
72 + import threading
73 +
74 ++import feedparser
75 ++
76 + import sabnzbd
77 + from sabnzbd.constants import RSS_FILE_NAME, DEFAULT_PRIORITY, NORMAL_PRIORITY, DUP_PRIORITY
78 + from sabnzbd.decorators import synchronized
79 +@@ -34,7 +36,6 @@ from sabnzbd.misc import cat_convert, wildcard_to_re, cat_to_opts, \
80 + import sabnzbd.emailer as emailer
81 + from sabnzbd.encoding import unicoder, xml_name
82 +
83 +-import sabnzbd.utils.feedparser as feedparser
84 +
85 + __RSS = None # Global pointer to RSS-scanner instance
86 +
87 +--
88 +2.4.10
89 +
90
91 diff --git a/net-nntp/sabnzbd/files/1.1.x/0002-assume-gntp-1.0.patch b/net-nntp/sabnzbd/files/1.1.x/0002-assume-gntp-1.0.patch
92 new file mode 100644
93 index 00000000..4e0674a
94 --- /dev/null
95 +++ b/net-nntp/sabnzbd/files/1.1.x/0002-assume-gntp-1.0.patch
96 @@ -0,0 +1,25 @@
97 +From 7ffaea52e44a3fbea1ac0aa186a48b2033b409a2 Mon Sep 17 00:00:00 2001
98 +From: Justin Bronder <jsbronder@×××××.com>
99 +Date: Wed, 21 Sep 2016 19:39:30 -0400
100 +Subject: [PATCH 2/4] assume >=gntp-1.0
101 +
102 +---
103 + sabnzbd/notifier.py | 2 +-
104 + 1 file changed, 1 insertion(+), 1 deletion(-)
105 +
106 +diff --git a/sabnzbd/notifier.py b/sabnzbd/notifier.py
107 +index 777f93a..514da75 100644
108 +--- a/sabnzbd/notifier.py
109 ++++ b/sabnzbd/notifier.py
110 +@@ -39,7 +39,7 @@ from sabnzbd.constants import NOTIFY_KEYS
111 + from sabnzbd.misc import split_host, make_script_path
112 + from sabnzbd.newsunpack import external_script
113 +
114 +-from gntp import GNTPRegister
115 ++from gntp.core import GNTPRegister
116 + from gntp.notifier import GrowlNotifier
117 + try:
118 + import Growl
119 +--
120 +2.4.10
121 +
122
123 diff --git a/net-nntp/sabnzbd/files/1.1.x/0003-cfg-disable-growl-by-default.patch b/net-nntp/sabnzbd/files/1.1.x/0003-cfg-disable-growl-by-default.patch
124 new file mode 100644
125 index 00000000..384fb33
126 --- /dev/null
127 +++ b/net-nntp/sabnzbd/files/1.1.x/0003-cfg-disable-growl-by-default.patch
128 @@ -0,0 +1,34 @@
129 +From d969db7d407d21ea73b9ca96ff81b1846cbaff8e Mon Sep 17 00:00:00 2001
130 +From: Justin Bronder <jsbronder@×××××.com>
131 +Date: Tue, 14 Jun 2016 08:38:54 -0400
132 +Subject: [PATCH 3/4] cfg: disable growl by default
133 +
134 +---
135 + sabnzbd/cfg.py | 4 ++--
136 + 1 file changed, 2 insertions(+), 2 deletions(-)
137 +
138 +diff --git a/sabnzbd/cfg.py b/sabnzbd/cfg.py
139 +index 8172646..53b75f3 100644
140 +--- a/sabnzbd/cfg.py
141 ++++ b/sabnzbd/cfg.py
142 +@@ -291,7 +291,7 @@ acenter_prio_queue_done = OptionBool('acenter', 'acenter_prio_queue_done', True)
143 + acenter_prio_other = OptionBool('acenter', 'acenter_prio_other', False)
144 +
145 + # [ntfosd]
146 +-ntfosd_enable = OptionBool('ntfosd', 'ntfosd_enable', not sabnzbd.WIN32 and not sabnzbd.DARWIN)
147 ++ntfosd_enable = OptionBool('ntfosd', 'ntfosd_enable', False)
148 + ntfosd_prio_startup = OptionBool('ntfosd', 'ntfosd_prio_startup', True)
149 + ntfosd_prio_download = OptionBool('ntfosd', 'ntfosd_prio_download', False)
150 + ntfosd_prio_pp = OptionBool('ntfosd', 'ntfosd_prio_pp', False)
151 +@@ -305,7 +305,7 @@ ntfosd_prio_queue_done = OptionBool('ntfosd', 'ntfosd_prio_queue_done', True)
152 + ntfosd_prio_other = OptionBool('ntfosd', 'ntfosd_prio_other', False)
153 +
154 + # [growl]
155 +-growl_enable = OptionBool('growl', 'growl_enable', sabnzbd.DARWIN and sabnzbd.DARWIN_VERSION < 8)
156 ++growl_enable = OptionBool('growl', 'growl_enable', False)
157 + growl_server = OptionStr('growl', 'growl_server')
158 + growl_password = OptionPassword('growl', 'growl_password')
159 + growl_prio_startup = OptionBool('growl', 'growl_prio_startup', True)
160 +--
161 +2.4.10
162 +
163
164 diff --git a/net-nntp/sabnzbd/files/1.1.x/0004-use-system-rarfile.patch b/net-nntp/sabnzbd/files/1.1.x/0004-use-system-rarfile.patch
165 new file mode 100644
166 index 00000000..2fcbf28
167 --- /dev/null
168 +++ b/net-nntp/sabnzbd/files/1.1.x/0004-use-system-rarfile.patch
169 @@ -0,0 +1,68 @@
170 +From a63aed271c34eb81f0bf6aa9c62b9825d1c4929c Mon Sep 17 00:00:00 2001
171 +From: Justin Bronder <jsbronder@×××××.com>
172 +Date: Tue, 14 Jun 2016 08:43:37 -0400
173 +Subject: [PATCH 4/4] use system rarfile
174 +
175 +---
176 + sabnzbd/assembler.py | 3 ++-
177 + sabnzbd/dirscanner.py | 3 ++-
178 + sabnzbd/newsunpack.py | 3 ++-
179 + 3 files changed, 6 insertions(+), 3 deletions(-)
180 +
181 +diff --git a/sabnzbd/assembler.py b/sabnzbd/assembler.py
182 +index 7c69c68..0789540 100644
183 +--- a/sabnzbd/assembler.py
184 ++++ b/sabnzbd/assembler.py
185 +@@ -33,6 +33,8 @@ except:
186 + import md5
187 + new_md5 = md5.new
188 +
189 ++from rarfile import RarFile, is_rarfile
190 ++
191 + import sabnzbd
192 + from sabnzbd.misc import get_filepath, sanitize_filename, get_unique_filename, renamer, \
193 + set_permissions, flag_file, long_path, clip_path
194 +@@ -41,7 +43,6 @@ import sabnzbd.cfg as cfg
195 + from sabnzbd.articlecache import ArticleCache
196 + from sabnzbd.postproc import PostProcessor
197 + import sabnzbd.downloader
198 +-from sabnzbd.utils.rarfile import RarFile, is_rarfile
199 + from sabnzbd.encoding import unicoder, is_utf8
200 + from sabnzbd.rating import Rating
201 +
202 +diff --git a/sabnzbd/dirscanner.py b/sabnzbd/dirscanner.py
203 +index c573435..dcb2859 100644
204 +--- a/sabnzbd/dirscanner.py
205 ++++ b/sabnzbd/dirscanner.py
206 +@@ -27,9 +27,10 @@ import gzip
207 + import bz2
208 + import threading
209 +
210 ++from rarfile import is_rarfile, RarFile
211 ++
212 + import sabnzbd
213 + from sabnzbd.constants import SCAN_FILE_NAME, VALID_ARCHIVES
214 +-from sabnzbd.utils.rarfile import is_rarfile, RarFile
215 + from sabnzbd.encoding import platform_encode
216 + from sabnzbd.newsunpack import is_sevenfile, SevenZip
217 + import sabnzbd.nzbstuff as nzbstuff
218 +diff --git a/sabnzbd/newsunpack.py b/sabnzbd/newsunpack.py
219 +index 7f223d9..b7fbd4f 100644
220 +--- a/sabnzbd/newsunpack.py
221 ++++ b/sabnzbd/newsunpack.py
222 +@@ -28,10 +28,11 @@ from time import time
223 + import binascii
224 + import shutil
225 +
226 ++from rarfile import RarFile, is_rarfile
227 ++
228 + import sabnzbd
229 + from sabnzbd.encoding import TRANS, UNTRANS, unicode2local, \
230 + reliable_unpack_names, unicoder, platform_encode, deunicode
231 +-from sabnzbd.utils.rarfile import RarFile, is_rarfile
232 + from sabnzbd.misc import format_time_string, find_on_path, make_script_path, int_conv, \
233 + flag_file, real_path, globber, globber_full, short_path
234 + from sabnzbd.tvsort import SeriesSorter
235 +--
236 +2.4.10
237 +
238
239 diff --git a/net-nntp/sabnzbd/sabnzbd-1.1.0.ebuild b/net-nntp/sabnzbd/sabnzbd-1.1.0.ebuild
240 new file mode 100644
241 index 00000000..e5f0860
242 --- /dev/null
243 +++ b/net-nntp/sabnzbd/sabnzbd-1.1.0.ebuild
244 @@ -0,0 +1,134 @@
245 +# Copyright 1999-2016 Gentoo Foundation
246 +# Distributed under the terms of the GNU General Public License v2
247 +# $Id$
248 +
249 +EAPI="5"
250 +
251 +# Require python-2 with sqlite USE flag
252 +PYTHON_DEPEND="2:2.7"
253 +PYTHON_USE_WITH="sqlite"
254 +
255 +inherit eutils python user systemd versionator
256 +
257 +MY_P="${P/sab/SAB}"
258 +
259 +DESCRIPTION="Binary newsgrabber with web-interface"
260 +HOMEPAGE="http://www.sabnzbd.org/"
261 +SRC_URI="mirror://sourceforge/sabnzbdplus/${MY_P}-src.tar.gz"
262 +
263 +# Sabnzbd is GPL-2 but bundles software with the following licenses.
264 +LICENSE="GPL-2 BSD LGPL-2 MIT BSD-1"
265 +SLOT="0"
266 +KEYWORDS="~amd64"
267 +IUSE="+rar +ssl unzip +yenc"
268 +
269 +# Sabnzbd is installed to /usr/share/ as upstream makes it clear they should not
270 +# be in python's sitedir. See: http://wiki.sabnzbd.org/unix-packaging
271 +
272 +# TODO: still bundled but not in protage:
273 +# kronos, rsslib, ssmtplib, listquote, json-py, msgfmt
274 +# pynewsleecher
275 +#
276 +# Also note that cherrypy is still bundled. It's near impossible to find
277 +# out where the bundled and heavily patched version came from (pulled from
278 +# cherrypy subversion, patched somewhere, then imported to sabnzbd and patched
279 +# further. Upstream is planning on making this easier with 0.8.0.
280 +# https://github.com/sabnzbd/sabnzbd/issues/47
281 +
282 +RDEPEND="
283 + >=app-arch/par2cmdline-0.4
284 + >=dev-python/cheetah-2.0.1
285 + dev-python/configobj
286 + dev-python/feedparser
287 + dev-python/gntp
288 + dev-python/pythonutils
289 + dev-python/rarfile
290 + net-misc/wget
291 + rar? ( || ( app-arch/unrar app-arch/rar ) )
292 + ssl? ( dev-python/pyopenssl )
293 + unzip? ( >=app-arch/unzip-5.5.2 )
294 + yenc? ( dev-python/yenc )
295 +"
296 +
297 +S="${WORKDIR}/${MY_P}"
298 +
299 +pkg_setup() {
300 + HOMEDIR="/var/lib/${PN}"
301 + python_set_active_version 2
302 + python_pkg_setup
303 +
304 + # Create sabnzbd group
305 + enewgroup ${PN}
306 + # Create sabnzbd user, put in sabnzbd group
307 + enewuser "${PN}" -1 -1 "${HOMEDIR}" "${PN}"
308 +}
309 +
310 +src_prepare() {
311 + epatch "${FILESDIR}"/1.1.x/0001-use-system-configobj-and-feedparser.patch
312 + epatch "${FILESDIR}"/1.1.x/0002-assume-gntp-1.0.patch
313 + epatch "${FILESDIR}"/1.1.x/0003-cfg-disable-growl-by-default.patch
314 + epatch "${FILESDIR}"/1.1.x/0004-use-system-rarfile.patch
315 +
316 + # remove bundled modules
317 + rm -r sabnzbd/utils/{feedparser,configobj,rarfile}.py || die
318 + rm -r gntp || die
319 + rm licenses/License-{feedparser,configobj,gntp,rarfile}.txt || die
320 +}
321 +
322 +src_install() {
323 + local d
324 +
325 + dodir /usr/share/${PN}/sabnzbd
326 + insinto /usr/share/${PN}/
327 + doins SABnzbd.py
328 + fperms +x /usr/share/${PN}/SABnzbd.py
329 + dobin "${FILESDIR}"/sabnzbd
330 +
331 + for d in cherrypy email icons interfaces locale po sabnzbd tools util; do
332 + insinto /usr/share/${PN}/${d}
333 + doins -r ${d}/*
334 + done
335 +
336 + newinitd "${FILESDIR}/${PN}.initd" "${PN}"
337 + newconfd "${FILESDIR}/${PN}.confd" "${PN}"
338 +
339 + diropts -o ${PN} -g ${PN}
340 + dodir /etc/${PN}
341 + dodir /var/log/${PN}
342 +
343 + insinto "/etc/${PN}"
344 + insopts -m 0600 -o ${PN} -g ${PN}
345 + doins "${FILESDIR}/${PN}.ini"
346 +
347 + dodoc {ABOUT,ISSUES,README}.txt licenses/*
348 +
349 + systemd_newunit "${FILESDIR}"/sabnzbd_at.service 'sabnzbd@.service'
350 +}
351 +
352 +pkg_postinst() {
353 + python_mod_optimize /usr/share/${PN}
354 +
355 + einfo "Default directory: ${HOMEDIR}"
356 + einfo ""
357 + einfo "Run: gpasswd -a <user> sabnzbd"
358 + einfo "to add a user to the sabnzbd group so it can edit sabnzbd files"
359 + einfo ""
360 + einfo "By default sabnzbd will listen on 127.0.0.1:8080"
361 + einfo "As growl isn't default notification system on gentoo we disable it."
362 + einfo "By default notifications are forwarded to the 23053 port(gntp)."
363 +
364 + local replacing
365 + for replacing in ${REPLACING_VERSIONS}; do
366 + if [ "$(get_major_version ${replacing})" == "0" ]; then
367 + echo
368 + ewarn "Upgrading from ${PN}-0.x.y to ${PN}-1.x.y introduces incompatible changes"
369 + ewarn "See http://wiki.sabnzbd.org/introducing-1-0-0."
370 + ewarn "In particular, you need to let your queue complete before restarting ${PN}"
371 + break
372 + fi
373 + done
374 +}
375 +
376 +pkg_postrm() {
377 + python_mod_cleanup /usr/share/${PN}
378 +}