summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSven Wegener <swegener@gentoo.org>2008-06-07 21:19:45 +0000
committerSven Wegener <swegener@gentoo.org>2008-06-07 21:19:45 +0000
commitcd1b820d6171f2ea34de6968b99434b13a2df9f6 (patch)
tree81f354b625bc291d419abdc3d99b035e8465ea73 /net-nntp/nzbget
parentRemove unused inherits that were used to patch and re-autotools before. (diff)
downloadgentoo-2-cd1b820d6171f2ea34de6968b99434b13a2df9f6.tar.gz
gentoo-2-cd1b820d6171f2ea34de6968b99434b13a2df9f6.tar.bz2
gentoo-2-cd1b820d6171f2ea34de6968b99434b13a2df9f6.zip
Add support for a system-wide nzbget daemon, bug #217359. Credit for the idea goes to Chris Carlin.
(Portage version: 2.1.5.4)
Diffstat (limited to 'net-nntp/nzbget')
-rw-r--r--net-nntp/nzbget/ChangeLog9
-rw-r--r--net-nntp/nzbget/files/nzbget.confd15
-rw-r--r--net-nntp/nzbget/files/nzbget.initd37
-rw-r--r--net-nntp/nzbget/nzbget-0.4.0-r1.ebuild79
4 files changed, 139 insertions, 1 deletions
diff --git a/net-nntp/nzbget/ChangeLog b/net-nntp/nzbget/ChangeLog
index 8bf1df101923..63ad43631285 100644
--- a/net-nntp/nzbget/ChangeLog
+++ b/net-nntp/nzbget/ChangeLog
@@ -1,6 +1,13 @@
# ChangeLog for net-nntp/nzbget
# Copyright 2000-2008 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/net-nntp/nzbget/ChangeLog,v 1.18 2008/06/07 20:28:54 swegener Exp $
+# $Header: /var/cvsroot/gentoo-x86/net-nntp/nzbget/ChangeLog,v 1.19 2008/06/07 21:19:45 swegener Exp $
+
+*nzbget-0.4.0-r1 (07 Jun 2008)
+
+ 07 Jun 2008; Sven Wegener <swegener@gentoo.org> +files/nzbget.confd,
+ +files/nzbget.initd, +nzbget-0.4.0-r1.ebuild:
+ Add support for a system-wide nzbget daemon, bug #217359. Credit for the
+ idea goes to Chris Carlin.
07 Jun 2008; Sven Wegener <swegener@gentoo.org> -files/0.2.3-gcc41.patch,
-files/0.2.3-include-order.patch, -files/0.2.3-double-free.patch,
diff --git a/net-nntp/nzbget/files/nzbget.confd b/net-nntp/nzbget/files/nzbget.confd
new file mode 100644
index 000000000000..ee8f38c1aefd
--- /dev/null
+++ b/net-nntp/nzbget/files/nzbget.confd
@@ -0,0 +1,15 @@
+# Copyright 1999-2008 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+# /etc/conf.d/nzbget
+# Config file for nzbget init script
+
+# Which user to run nzbget as
+NZBGET_USER="nzbget"
+NZBGET_GROUP="nzbget"
+
+# Location of config file
+NZBGET_CONFIGFILE="/etc/nzbgetd.conf"
+
+# Other options
+NZBGET_OPTS=""
diff --git a/net-nntp/nzbget/files/nzbget.initd b/net-nntp/nzbget/files/nzbget.initd
new file mode 100644
index 000000000000..c174b81bc505
--- /dev/null
+++ b/net-nntp/nzbget/files/nzbget.initd
@@ -0,0 +1,37 @@
+#!/sbin/runscript
+# Copyright 1999-2008 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/net-nntp/nzbget/files/nzbget.initd,v 1.1 2008/06/07 21:19:45 swegener Exp $
+
+opts="pause unpause"
+
+depend() {
+ need net
+}
+
+start() {
+ ebegin "Starting nzbget"
+ start-stop-daemon --quiet --start --chuid "${NZBGET_USER}" \
+ --group "${NZBGET_GROUP}" --exec /usr/bin/nzbget -- \
+ --configfile "${NZBGET_CONFIGFILE}" --daemon \
+ ${NZBGET_OPTS}
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping nzbget"
+ /usr/bin/nzbget --configfile "${NZBGET_CONFIGFILE}" --quit >/dev/null
+ eend $?
+}
+
+pause() {
+ ebegin "Pausing nzbget"
+ /usr/bin/nzbget --configfile "${NZBGET_CONFIGFILE}" --pause >/dev/null
+ eend $?
+}
+
+unpause() {
+ ebegin "Unpausing nzbget"
+ /usr/bin/nzbget --configfile "${NZBGET_CONFIGFILE}" --unpause >/dev/null
+ eend $?
+}
diff --git a/net-nntp/nzbget/nzbget-0.4.0-r1.ebuild b/net-nntp/nzbget/nzbget-0.4.0-r1.ebuild
new file mode 100644
index 000000000000..ea9dfbc463db
--- /dev/null
+++ b/net-nntp/nzbget/nzbget-0.4.0-r1.ebuild
@@ -0,0 +1,79 @@
+# Copyright 1999-2008 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/net-nntp/nzbget/nzbget-0.4.0-r1.ebuild,v 1.1 2008/06/07 21:19:45 swegener Exp $
+
+EAPI="1"
+
+inherit eutils
+
+DESCRIPTION="A command-line based binary newsgrabber supporting .nzb files"
+HOMEPAGE="http://nzbget.sourceforge.net/"
+SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz"
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~ppc ~x86"
+IUSE="debug ncurses parcheck"
+
+DEPEND="dev-libs/libxml2
+ parcheck? (
+ app-arch/libpar2
+ dev-libs/libsigc++:2
+ )
+ ncurses? ( sys-libs/ncurses )"
+RDEPEND="${DEPEND}"
+
+src_unpack() {
+ unpack ${A}
+
+ sed -i \
+ -e 's:^$MAINDIR=.*:$MAINDIR=/var/lib/nzbget:' \
+ -e 's:^LockFile=.*:LockFile=/var/run/nzbget/nzbget.pid:' \
+ -e 's:^LogFile=.*:LogFile=/var/log/nzbget/nzbget.log:' \
+ "${S}"/nzbget.conf.example \
+ || die "sed nzbget.conf.example failed"
+}
+
+src_compile() {
+ econf \
+ $(use_enable debug) \
+ $(use_enable ncurses curses) \
+ $(use_enable parcheck) \
+ || die "econf failed"
+ emake || die "emake failed"
+}
+
+src_install() {
+ emake install DESTDIR="${D}" || die "emake install failed"
+
+ insinto /etc
+ newins nzbget.conf.example nzbgetd.conf || die "newins failed"
+
+ keepdir /var/lib/nzbget/{dst,nzb,queue,tmp}
+ keepdir /var/{log,run}/nzbget
+
+ newinitd "${FILESDIR}"/nzbget.initd nzbget
+ newconfd "${FILESDIR}"/nzbget.confd nzbget
+
+ dodoc AUTHORS ChangeLog README nzbget.conf.example || die "dodoc failed"
+}
+
+pkg_postinst() {
+ enewgroup nzbget
+ enewuser nzbget -1 -1 /var/lib/nzbget nzbget
+
+ chown nzbget:nzbget "${ROOT}"/var/lib/nzbget/{dst,nzb,queue,tmp}
+ chmod 750 "${ROOT}"/var/lib/nzbget/{queue,tmp}
+ chmod 770 "${ROOT}"/var/lib/nzbget/{dst,nzb}
+
+ chown nzbget:nzbget "${ROOT}"/var/{log,run}/nzbget
+ chmod 750 "${ROOT}"/var/{log,run}/nzbget
+
+ chown root:nzbget "${ROOT}"/etc/nzbgetd.conf
+ chmod 640 "${ROOT}"/etc/nzbgetd.conf
+
+ elog
+ elog "Please add users that you want to be able to use the system-wide"
+ elog "nzbget daemon to the nzbget group. To access the daemon run nzbget"
+ elog "with the --configfile /etc/nzbgetd.conf option."
+ elog
+}