Gentoo Archives: gentoo-commits

From: Thomas Deutschmann <whissi@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: net-nntp/sabnzbd/, net-nntp/sabnzbd/files/
Date: Sun, 28 Jun 2020 12:59:24
Message-Id: 1593349148.0f0e394cc4589571a6ed678fb9712c1aabcce5ea.whissi@gentoo
1 commit: 0f0e394cc4589571a6ed678fb9712c1aabcce5ea
2 Author: Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
3 AuthorDate: Sun Jun 28 12:34:45 2020 +0000
4 Commit: Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
5 CommitDate: Sun Jun 28 12:59:08 2020 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=0f0e394c
7
8 net-nntp/sabnzbd: bump to v3.0.0 RC1
9
10 Bug: https://bugs.gentoo.org/708958
11 Package-Manager: Portage-2.3.101, Repoman-2.3.22
12 Signed-off-by: Thomas Deutschmann <whissi <AT> gentoo.org>
13
14 net-nntp/sabnzbd/files/sabnzbd-r1.ini | 12 ++++
15 net-nntp/sabnzbd/files/sabnzbd-r1.initd | 71 ++++++++++++++++++++++
16 ....0_rc1_pre0.ebuild => sabnzbd-3.0.0_rc1.ebuild} | 45 +++++++-------
17 3 files changed, 104 insertions(+), 24 deletions(-)
18
19 diff --git a/net-nntp/sabnzbd/files/sabnzbd-r1.ini b/net-nntp/sabnzbd/files/sabnzbd-r1.ini
20 new file mode 100644
21 index 00000000000..5ccd7e19ca3
22 --- /dev/null
23 +++ b/net-nntp/sabnzbd/files/sabnzbd-r1.ini
24 @@ -0,0 +1,12 @@
25 +__version__ = 19
26 +[misc]
27 +log_dir = /var/log/sabnzbd
28 +admin_dir = /var/lib/sabnzbd/admin
29 +cache_dir = /var/lib/sabnzbd/cache
30 +complete_dir = /var/lib/sabnzbd/complete
31 +download_dir = /var/lib/sabnzbd/download
32 +dirscan_dir = /var/lib/sabnzbd/dirscan
33 +nzb_backup_dir = /var/lib/sabnzbd/backup
34 +auto_browser = 0
35 +host = ::
36 +port = 8080
37
38 diff --git a/net-nntp/sabnzbd/files/sabnzbd-r1.initd b/net-nntp/sabnzbd/files/sabnzbd-r1.initd
39 new file mode 100644
40 index 00000000000..eff3352a90b
41 --- /dev/null
42 +++ b/net-nntp/sabnzbd/files/sabnzbd-r1.initd
43 @@ -0,0 +1,71 @@
44 +#!/sbin/openrc-run
45 +# Copyright 1999-2020 Gentoo Authors
46 +# Distributed under the terms of the GNU General Public License v2
47 +
48 +PIDFILE="/run/sabnzbd/sabnzbd.pid"
49 +
50 +depend() {
51 + use dns
52 +}
53 +
54 +get_var() {
55 + grep -P -o -m 1 "(?<=^${1} = ).*" "${SABNZBD_CONFIGFILE}" || echo 0
56 +}
57 +
58 +start() {
59 + ebegin "Starting SABnzbd"
60 +
61 + checkpath -q -d -o ${SABNZBD_USER}:${SABNZBD_GROUP} -m 0770 "$(dirname "${PIDFILE}")"
62 +
63 + start-stop-daemon \
64 + --quiet \
65 + --start \
66 + --user ${SABNZBD_USER} \
67 + --group ${SABNZBD_GROUP} \
68 + --pidfile "${PIDFILE}" \
69 + --wait 1000 \
70 + --exec /usr/share/sabnzbd/SABnzbd.py \
71 + -- \
72 + --config-file "${SABNZBD_CONFIGFILE}" \
73 + --logging "${SABNZBD_LOGGING}" \
74 + --daemon \
75 + --pidfile "${PIDFILE}"
76 +
77 + eend $?
78 +}
79 +
80 +stop() {
81 + local protocol="http"
82 + local host="$(get_var "host")"
83 + local port="$(get_var "port")"
84 +
85 + if [ $(get_var "enable_https") -eq 1 ]; then
86 + protocol="https"
87 + port="$(get_var "https_port")"
88 + fi
89 +
90 + case "${host}" in
91 + *:*) host="[${host}]" ;;
92 + esac
93 +
94 + local url="${protocol}://${host}:${port}/sabnzbd/api?mode=shutdown"
95 +
96 + if [ $(get_var "disable_api_key") -eq 0 ]; then
97 + url="${url}&apikey=$(get_var "api_key")"
98 + fi
99 +
100 + local signals="TERM/1/KILL/1"
101 +
102 + ebegin "Stopping SABnzbd"
103 +
104 + if [ "$(wget -o /dev/null -t 1 -O - -T 10 "${url}")" = "ok" ]; then
105 + signals="NULL/5/${signals}"
106 + fi
107 +
108 + start-stop-daemon \
109 + --stop \
110 + --pidfile "${PIDFILE}" \
111 + --retry "${signals}"
112 +
113 + eend $?
114 +}
115
116 diff --git a/net-nntp/sabnzbd/sabnzbd-3.0.0_rc1_pre0.ebuild b/net-nntp/sabnzbd/sabnzbd-3.0.0_rc1.ebuild
117 similarity index 75%
118 rename from net-nntp/sabnzbd/sabnzbd-3.0.0_rc1_pre0.ebuild
119 rename to net-nntp/sabnzbd/sabnzbd-3.0.0_rc1.ebuild
120 index 2a8fb3992d6..afa365fd3af 100644
121 --- a/net-nntp/sabnzbd/sabnzbd-3.0.0_rc1_pre0.ebuild
122 +++ b/net-nntp/sabnzbd/sabnzbd-3.0.0_rc1.ebuild
123 @@ -7,7 +7,7 @@ EAPI="7"
124 PYTHON_COMPAT=( python3_{6..8} )
125 PYTHON_REQ_USE="sqlite"
126
127 -inherit python-single-r1 user systemd
128 +inherit python-single-r1 systemd
129
130 MY_PV="${PV/_rc/RC}"
131 MY_PV="${MY_PV//_pre*}"
132 @@ -21,13 +21,15 @@ SRC_URI="https://github.com/sabnzbd/sabnzbd/releases/download/${MY_PV}/${MY_P}-s
133 # Sabnzbd is GPL-2 but bundles software with the following licenses.
134 LICENSE="GPL-2 BSD LGPL-2 MIT BSD-1"
135 SLOT="0"
136 -KEYWORDS=""
137 +KEYWORDS="~amd64"
138 IUSE="+7za +rar unzip"
139
140 # Sabnzbd is installed to /usr/share/ as upstream makes it clear they should not
141 # be in python's sitedir. See: https://sabnzbd.org/wiki/advanced/unix-packaging
142
143 COMMON_DEPS="
144 + acct-user/sabnzbd
145 + acct-group/sabnzbd
146 ${PYTHON_DEPS}
147 $(python_gen_cond_dep '
148 dev-python/chardet[${PYTHON_MULTI_USEDEP}]
149 @@ -60,11 +62,6 @@ S="${WORKDIR}/${MY_P}"
150 pkg_setup() {
151 MY_HOMEDIR="/var/lib/${PN}"
152 python-single-r1_pkg_setup
153 -
154 - # Create sabnzbd group
155 - enewgroup "${PN}"
156 - # Create sabnzbd user, put in sabnzbd group
157 - enewuser "${PN}" -1 -1 "${MY_HOMEDIR}" "${PN}"
158 }
159
160 src_install() {
161 @@ -81,7 +78,7 @@ src_install() {
162 python_fix_shebang "${ED}/usr/share/${PN}"
163 python_optimize "${ED}/usr/share/${PN}"
164
165 - newinitd "${FILESDIR}/${PN}.initd" "${PN}"
166 + newinitd "${FILESDIR}/${PN}-r1.initd" "${PN}"
167 newconfd "${FILESDIR}/${PN}.confd" "${PN}"
168
169 diropts -o "${PN}" -g "${PN}"
170 @@ -90,7 +87,7 @@ src_install() {
171
172 insinto "/etc/${PN}"
173 insopts -m 0600 -o "${PN}" -g "${PN}"
174 - doins "${FILESDIR}/${PN}.ini"
175 + newins "${FILESDIR}"/${PN}-r1.ini ${PN}.ini
176
177 dodoc {ABOUT,ISSUES}.txt README.mkd licenses/*
178
179 @@ -104,21 +101,21 @@ pkg_postinst() {
180 einfo
181 einfo "To add a user to the sabnzbd group so it can edit SABnzbd+ files, run:"
182 einfo
183 - einfo " gpasswd -a <user> sabnzbd"
184 + einfo " usermod -a -G sabnzbd <user>"
185 einfo
186 - einfo "By default, SABnzbd+ will listen on TCP port 8080."
187 + einfo "By default, SABnzbd will listen on TCP port 8080."
188 + else
189 + local v
190 + for v in ${REPLACING_VERSIONS}; do
191 + if ver_test "${v}" -lt 3; then
192 + ewarn
193 + ewarn "Due to changes in this release, the queue will be converted when ${PN}"
194 + ewarn "is started for the first time. Job order, settings and data will be"
195 + ewarn "preserved, but all jobs will be unpaused and URLs that did not finish"
196 + ewarn "fetching before the upgrade will be lost!"
197 + ewarn
198 + break
199 + fi
200 + done
201 fi
202 -
203 - local v
204 - for v in ${REPLACING_VERSIONS}; do
205 - if ver_test "${v}" -lt 3; then
206 - ewarn
207 - ewarn "Due to changes in this release, the queue will be converted when ${PN}"
208 - ewarn "is started for the first time. Job order, settings and data will be"
209 - ewarn "preserved, but all jobs will be unpaused and URLs that did not finish"
210 - ewarn "fetching before the upgrade will be lost!"
211 - ewarn
212 - break
213 - fi
214 - done
215 }