You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
113 lines
2.4 KiB
113 lines
2.4 KiB
4 years ago
|
# Copyright 1999-2021 Gentoo Authors
|
||
9 years ago
|
# Distributed under the terms of the GNU General Public License v2
|
||
|
|
||
6 years ago
|
EAPI=7
|
||
9 years ago
|
|
||
3 years ago
|
inherit autotools systemd
|
||
9 years ago
|
|
||
8 years ago
|
MY_PV=${PV/_pre/-r}
|
||
|
MY_P=${PN}-${PV/_pre/-testing-r}
|
||
9 years ago
|
|
||
9 years ago
|
DESCRIPTION="A command-line based binary newsgrabber supporting .nzb files"
|
||
7 years ago
|
HOMEPAGE="https://nzbget.net/"
|
||
8 years ago
|
SRC_URI="https://github.com/${PN}/${PN}/releases/download/v${MY_PV}/${MY_P}-src.tar.gz -> ${P}.tar.gz"
|
||
9 years ago
|
|
||
8 years ago
|
LICENSE="GPL-2+"
|
||
9 years ago
|
SLOT="0"
|
||
8 years ago
|
KEYWORDS="~amd64 ~arm ~ppc ~x86"
|
||
6 years ago
|
IUSE="debug gnutls ncurses +parcheck ssl test zlib"
|
||
5 years ago
|
RESTRICT="!test? ( test )"
|
||
9 years ago
|
|
||
3 years ago
|
DEPEND="
|
||
|
dev-libs/libxml2:=
|
||
8 years ago
|
ncurses? ( sys-libs/ncurses:0= )
|
||
9 years ago
|
ssl? (
|
||
8 years ago
|
gnutls? (
|
||
|
net-libs/gnutls:=
|
||
|
dev-libs/nettle:=
|
||
|
)
|
||
3 years ago
|
!gnutls? ( dev-libs/openssl:0=[-bindist(-)] )
|
||
9 years ago
|
)
|
||
7 years ago
|
zlib? ( sys-libs/zlib:= )"
|
||
3 years ago
|
RDEPEND="
|
||
|
${DEPEND}
|
||
|
acct-user/nzbget
|
||
|
acct-group/nzbget
|
||
|
"
|
||
|
BDEPEND="
|
||
7 years ago
|
test? (
|
||
|
|| (
|
||
4 years ago
|
app-arch/rar
|
||
|
app-arch/unrar
|
||
7 years ago
|
)
|
||
|
)
|
||
3 years ago
|
virtual/pkgconfig
|
||
|
"
|
||
9 years ago
|
DOCS=( ChangeLog README nzbget.conf )
|
||
|
|
||
8 years ago
|
S=${WORKDIR}/${PN}-${PV/_pre*/-testing}
|
||
|
|
||
9 years ago
|
src_prepare() {
|
||
8 years ago
|
default
|
||
|
eautoreconf
|
||
9 years ago
|
|
||
|
sed -i 's:^ScriptDir=.*:ScriptDir=/usr/share/nzbget/ppscripts:' nzbget.conf || die
|
||
|
|
||
|
sed \
|
||
|
-e 's:^MainDir=.*:MainDir=/var/lib/nzbget:' \
|
||
|
-e 's:^LogFile=.*:LogFile=/var/log/nzbget/nzbget.log:' \
|
||
|
-e 's:^WebDir=.*:WebDir=/usr/share/nzbget/webui:' \
|
||
|
-e 's:^ConfigTemplate=.*:ConfigTemplate=/usr/share/nzbget/nzbget.conf:' \
|
||
|
-e 's:^DaemonUsername=.*:DaemonUsername=nzbget:' \
|
||
8 years ago
|
nzbget.conf > nzbgetd.conf || die
|
||
9 years ago
|
}
|
||
|
|
||
|
src_configure() {
|
||
6 years ago
|
local myconf=(
|
||
|
$(use_enable debug)
|
||
|
$(use_enable ncurses curses)
|
||
|
$(use_enable parcheck)
|
||
|
$(use_enable ssl tls)
|
||
|
$(use_enable zlib gzip)
|
||
|
$(use_enable test tests)
|
||
9 years ago
|
--with-tlslib=$(usex gnutls GnuTLS OpenSSL)
|
||
6 years ago
|
)
|
||
|
econf "${myconf[@]}"
|
||
9 years ago
|
}
|
||
|
|
||
8 years ago
|
src_test() {
|
||
|
./nzbget --tests || die "Tests failed"
|
||
|
}
|
||
|
|
||
9 years ago
|
src_install() {
|
||
|
default
|
||
|
|
||
|
insinto /etc
|
||
|
doins nzbget.conf
|
||
|
doins nzbgetd.conf
|
||
|
|
||
|
keepdir /var/log/nzbget
|
||
|
|
||
7 years ago
|
newinitd "${FILESDIR}"/nzbget.initd-r1 nzbget
|
||
9 years ago
|
newconfd "${FILESDIR}"/nzbget.confd nzbget
|
||
6 years ago
|
systemd_dounit "${FILESDIR}"/nzbget.service
|
||
9 years ago
|
}
|
||
|
|
||
|
pkg_preinst() {
|
||
|
fowners nzbget:nzbget /var/log/nzbget
|
||
|
fperms 750 /var/log/nzbget
|
||
|
|
||
|
fowners nzbget:nzbget /etc/nzbgetd.conf
|
||
|
fperms 640 /etc/nzbgetd.conf
|
||
|
}
|
||
|
|
||
|
pkg_postinst() {
|
||
|
if [[ -z ${REPLACING_VERSIONS} ]] ; then
|
||
|
elog
|
||
|
elog "Please add users that you want to be able to use the system-wide"
|
||
6 years ago
|
elog "nzbget daemon to the nzbget group. To access the daemon, run nzbget"
|
||
9 years ago
|
elog "with the --configfile /etc/nzbgetd.conf option."
|
||
|
elog
|
||
|
fi
|
||
|
}
|