Gentoo Archives: gentoo-commits

From: Louis Sautier <sbraz@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: net-nntp/nzbget/, net-nntp/nzbget/files/
Date: Mon, 29 Oct 2018 22:21:37
Message-Id: 1540851682.895aef81080868046d66517df146ee6fb4cd034d.sbraz@gentoo
1 commit: 895aef81080868046d66517df146ee6fb4cd034d
2 Author: Louis Sautier <sbraz <AT> gentoo <DOT> org>
3 AuthorDate: Mon Oct 29 21:49:32 2018 +0000
4 Commit: Louis Sautier <sbraz <AT> gentoo <DOT> org>
5 CommitDate: Mon Oct 29 22:21:22 2018 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=895aef81
7
8 net-nntp/nzbget: bump to 21.0_pre2220, add systemd unit
9
10 Closes: https://bugs.gentoo.org/662648
11 Signed-off-by: Louis Sautier <sbraz <AT> gentoo.org>
12 Package-Manager: Portage-2.3.51, Repoman-2.3.11
13
14 net-nntp/nzbget/Manifest | 1 +
15 net-nntp/nzbget/files/nzbget.service | 18 ++++
16 net-nntp/nzbget/nzbget-21.0_pre2220.ebuild | 129 +++++++++++++++++++++++++++++
17 3 files changed, 148 insertions(+)
18
19 diff --git a/net-nntp/nzbget/Manifest b/net-nntp/nzbget/Manifest
20 index 28f8b04a14d..e8c20f8b3ee 100644
21 --- a/net-nntp/nzbget/Manifest
22 +++ b/net-nntp/nzbget/Manifest
23 @@ -2,3 +2,4 @@ DIST nzbget-14.1.tar.gz 1332334 BLAKE2B cbb633993ffd4c7a9cf6556ef833838296bb4d64
24 DIST nzbget-19.1.tar.gz 1809849 BLAKE2B 30740c22e06f9b794485bb5c0c28cd95f9953863203a9055bf453a9adfe1e58adcf69dcddc3640c13aefb90bb26cd444070af2d9f0f6fadee676af453cdb23c2 SHA512 3ba7cd7f7fec28e29129be0a1ca5879a0593bc54be49e3776e84eeb7804377eec47106aa2371b31dec7d9152301d68b199ce9e66db714195defc8e15ef636532
25 DIST nzbget-20.0.tar.gz 1925665 BLAKE2B 4c4e93bb0fa170b4b6433cbb7d27f3fa67ed033c462711b19e179f42c18dfed044c937e6a7ce4b08a620f4d7af7d3ec9245de16f15d4db8005d3d8dc4f8f46d4 SHA512 8b0fe8ea41b64be9a2f624ef0fa2a8b8987bee412db68a0e8f1b607ce6be7bfd03f60ecc5e49807f4c726e136bc5a355c44559b215fea2bd290c2eb62a0b5927
26 DIST nzbget-20.0_pre2176.tar.gz 1923841 BLAKE2B ba6ba301013b160f4dcaf21257dc2c1ceac3c64c645bde556ed45e8dca5011b8d9b9ce76fbaf42b78f6400b530c4c0baa94ad34fe09daa86619506dd76333ca2 SHA512 7be68999cc284a53100c0892f7558e3e1d2ac7d83019c933ae0596de56a8c9bec78571aaf34983103a30563dcdd6387987f7a13404e0ffac48007e0d44efa525
27 +DIST nzbget-21.0_pre2220.tar.gz 1985190 BLAKE2B e19e1c997615f61895a26ca24ff1eb66e6caf99cecf3f3b0eccc2c0f67ebc61c20cdd24d869d8c2a1d2f0d5c53f5222cc3b151720e3a6d1398507fd252586cf5 SHA512 73cd24628ab224d62b4619ca6b9014edb08ac14f02850def3123db640c785fd8836ba4ee4be40a0cf918ba6c25bf19683e67d05aaa0f96c71ad23b6a30284fa0
28
29 diff --git a/net-nntp/nzbget/files/nzbget.service b/net-nntp/nzbget/files/nzbget.service
30 new file mode 100644
31 index 00000000000..031307e3efa
32 --- /dev/null
33 +++ b/net-nntp/nzbget/files/nzbget.service
34 @@ -0,0 +1,18 @@
35 +[Unit]
36 +Description=NZBGet binary newsgrabber
37 +Documentation=https://nzbget.net/Documentation
38 +After=network.target
39 +
40 +[Service]
41 +User=nzbget
42 +Group=nzbget
43 +Type=forking
44 +PIDFile=/run/nzbget/nzbget.pid
45 +RuntimeDirectory=nzbget
46 +RuntimeDirectoryMode=0755
47 +ExecStart=/usr/bin/nzbget -c /etc/nzbgetd.conf -o LockFile=/run/nzbget/nzbget.pid -D
48 +ExecStop=/usr/bin/nzbget -c /etc/nzbgetd.conf -Q
49 +ExecReload=/usr/bin/nzbget -c /etc/nzbgetd.conf -O
50 +
51 +[Install]
52 +WantedBy=multi-user.target
53
54 diff --git a/net-nntp/nzbget/nzbget-21.0_pre2220.ebuild b/net-nntp/nzbget/nzbget-21.0_pre2220.ebuild
55 new file mode 100644
56 index 00000000000..59e359e545b
57 --- /dev/null
58 +++ b/net-nntp/nzbget/nzbget-21.0_pre2220.ebuild
59 @@ -0,0 +1,129 @@
60 +# Copyright 1999-2018 Gentoo Authors
61 +# Distributed under the terms of the GNU General Public License v2
62 +
63 +EAPI=7
64 +
65 +inherit autotools eutils flag-o-matic user systemd
66 +
67 +MY_PV=${PV/_pre/-r}
68 +MY_P=${PN}-${PV/_pre/-testing-r}
69 +
70 +DESCRIPTION="A command-line based binary newsgrabber supporting .nzb files"
71 +HOMEPAGE="https://nzbget.net/"
72 +SRC_URI="https://github.com/${PN}/${PN}/releases/download/v${MY_PV}/${MY_P}-src.tar.gz -> ${P}.tar.gz"
73 +
74 +LICENSE="GPL-2+"
75 +SLOT="0"
76 +KEYWORDS="~amd64 ~arm ~ppc ~x86"
77 +IUSE="debug gnutls ncurses +parcheck ssl test zlib"
78 +
79 +RDEPEND="dev-libs/libxml2:=
80 + ncurses? ( sys-libs/ncurses:0= )
81 + ssl? (
82 + gnutls? (
83 + net-libs/gnutls:=
84 + dev-libs/nettle:=
85 + )
86 + !gnutls? ( dev-libs/openssl:0=[-bindist] )
87 + )
88 + zlib? ( sys-libs/zlib:= )"
89 +DEPEND="${RDEPEND}
90 + test? (
91 + || (
92 + =app-arch/rar-5*
93 + =app-arch/unrar-5*
94 + )
95 + )
96 + virtual/pkgconfig"
97 +DOCS=( ChangeLog README nzbget.conf )
98 +
99 +S=${WORKDIR}/${PN}-${PV/_pre*/-testing}
100 +
101 +check_compiler() {
102 + if [[ ${MERGE_TYPE} != binary ]] && ! test-flag-CXX -std=c++14; then
103 + eerror "${P} requires a C++14-capable compiler. Your current compiler"
104 + eerror "does not seem to support the -std=c++14 option. Please"
105 + eerror "upgrade to gcc-4.9 or an equivalent version supporting C++14."
106 + die "The currently active compiler does not support -std=c++14"
107 + fi
108 +}
109 +
110 +pkg_pretend() {
111 + check_compiler
112 +}
113 +
114 +pkg_setup() {
115 + check_compiler
116 +}
117 +
118 +src_prepare() {
119 + default
120 + eautoreconf
121 +
122 + sed -i 's:^ScriptDir=.*:ScriptDir=/usr/share/nzbget/ppscripts:' nzbget.conf || die
123 +
124 + sed \
125 + -e 's:^MainDir=.*:MainDir=/var/lib/nzbget:' \
126 + -e 's:^LogFile=.*:LogFile=/var/log/nzbget/nzbget.log:' \
127 + -e 's:^WebDir=.*:WebDir=/usr/share/nzbget/webui:' \
128 + -e 's:^ConfigTemplate=.*:ConfigTemplate=/usr/share/nzbget/nzbget.conf:' \
129 + -e 's:^DaemonUsername=.*:DaemonUsername=nzbget:' \
130 + nzbget.conf > nzbgetd.conf || die
131 +}
132 +
133 +src_configure() {
134 + local myconf=(
135 + $(use_enable debug)
136 + $(use_enable ncurses curses)
137 + $(use_enable parcheck)
138 + $(use_enable ssl tls)
139 + $(use_enable zlib gzip)
140 + $(use_enable test tests)
141 + --with-tlslib=$(usex gnutls GnuTLS OpenSSL)
142 + )
143 + econf "${myconf[@]}"
144 +}
145 +
146 +src_test() {
147 + ./nzbget --tests || die "Tests failed"
148 +}
149 +
150 +src_install() {
151 + default
152 +
153 + insinto /etc
154 + doins nzbget.conf
155 + doins nzbgetd.conf
156 +
157 + keepdir /var/lib/nzbget/{dst,nzb,queue,tmp}
158 + keepdir /var/log/nzbget
159 +
160 + newinitd "${FILESDIR}"/nzbget.initd-r1 nzbget
161 + newconfd "${FILESDIR}"/nzbget.confd nzbget
162 + systemd_dounit "${FILESDIR}"/nzbget.service
163 +}
164 +
165 +pkg_preinst() {
166 + enewgroup nzbget
167 + enewuser nzbget -1 -1 /var/lib/nzbget nzbget
168 +
169 + fowners nzbget:nzbget /var/lib/nzbget/{dst,nzb,queue,tmp}
170 + fperms 750 /var/lib/nzbget/{queue,tmp}
171 + fperms 770 /var/lib/nzbget/{dst,nzb}
172 +
173 + fowners nzbget:nzbget /var/log/nzbget
174 + fperms 750 /var/log/nzbget
175 +
176 + fowners nzbget:nzbget /etc/nzbgetd.conf
177 + fperms 640 /etc/nzbgetd.conf
178 +}
179 +
180 +pkg_postinst() {
181 + if [[ -z ${REPLACING_VERSIONS} ]] ; then
182 + elog
183 + elog "Please add users that you want to be able to use the system-wide"
184 + elog "nzbget daemon to the nzbget group. To access the daemon, run nzbget"
185 + elog "with the --configfile /etc/nzbgetd.conf option."
186 + elog
187 + fi
188 +}