diff options
author | sputnick | 2015-06-18 23:43:50 +0200 |
---|---|---|
committer | sputnick | 2015-06-18 23:43:50 +0200 |
commit | 36f8c8465ee797fd5f9c525ffb9a65c8ea026865 (patch) | |
tree | cc0aaa4fc6bcce2662831ba5649743b475c235fd | |
download | aur-36f8c8465ee797fd5f9c525ffb9a65c8ea026865.tar.gz |
Initial hellanzb-git commit
-rw-r--r-- | .SRCINFO | 33 | ||||
-rw-r--r-- | 877271-2.diff | 12 | ||||
-rw-r--r-- | 877271.diff | 11 | ||||
-rw-r--r-- | 877281.diff | 11 | ||||
-rw-r--r-- | PKGBUILD | 68 | ||||
-rw-r--r-- | hellanzb.conf.d | 5 | ||||
-rw-r--r-- | hellanzb.install | 20 | ||||
-rwxr-xr-x | hellanzb.rc | 38 | ||||
-rw-r--r-- | par2fix.diff | 10 |
9 files changed, 208 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 000000000000..234c1e427ae1 --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,33 @@ +pkgbase = hellanzb-git + pkgdesc = nzb downloader and post processor + pkgver = 9999 + pkgrel = 7 + url = https://github.com/pjenvey/hellanzb + install = hellanzb.install + arch = i686 + arch = x86_64 + license = BSD + makedepends = git + depends = python2 + depends = twisted-web2 + depends = par2cmdline + depends = unrar + depends = python2-pyopenssl + provides = hellanzb + conflicts = hellanzb + backup = etc/conf.d/hellanzb + source = hellanzb.rc + source = hellanzb.conf.d + source = 877271.diff + source = 877271-2.diff + source = 877281.diff + source = par2fix.diff + md5sums = e33d67945276f754e3ba406bd947296d + md5sums = 0bda37be41e3d0662bd8cdb0fdff6a20 + md5sums = e02e555616f9ffd748f3aedaaf17d143 + md5sums = 93160251bb66d63cbc55e79765b3b1db + md5sums = c0da3f5b87a84abe2d5cb7c3d87769df + md5sums = 3337cb86e63325a6ffb81842f9cbaff3 + +pkgname = hellanzb-git + diff --git a/877271-2.diff b/877271-2.diff new file mode 100644 index 000000000000..a1cd7e208e66 --- /dev/null +++ b/877271-2.diff @@ -0,0 +1,12 @@ +--- HtPasswdAuth.py 2010-03-10 18:30:29.000000000 -0600 ++++ /usr/lib/python2.6/site-packages/Hellanzb/HellaXMLRPC/HtPasswdAuth.py 2010-03-10 18:30:49.0000000$ +@@ -19,7 +19,7 @@ + from twisted.web.resource import Resource + + import twisted.copyright +-if twisted.copyright.version >= '2.0.0': ++if twisted.copyright.version >= '2.0.0' or twisted.copyright.version >= '10.0.0': + from twisted.web import http + else: + from twisted.protocols import http + diff --git a/877271.diff b/877271.diff new file mode 100644 index 000000000000..ede27e1b260d --- /dev/null +++ b/877271.diff @@ -0,0 +1,11 @@ +--- xmlrpc.py 2010-03-10 18:29:19.000000000 -0600 ++++ /usr/lib/python2.6/site-packages/Hellanzb/HellaXMLRPC/xmlrpc.py 2010-03-10 18:30:03.000000000 -0600 +@@ -31,7 +31,7 @@ + from twisted.python import log, reflect + + import twisted.copyright +-if twisted.copyright.version >= '2.0.0': ++if twisted.copyright.version >= '2.0.0' or twisted.copyright.version >= '10.0.0': + from twisted.web import http + else: + from twisted.protocols import http diff --git a/877281.diff b/877281.diff new file mode 100644 index 000000000000..f29795951f37 --- /dev/null +++ b/877281.diff @@ -0,0 +1,11 @@ +--- HellaReactor.py 2010-03-10 18:22:34.000000000 -0600 ++++ /usr/lib/python2.6/site-packages/Hellanzb/HellaReactor.py 2010-03-10 18:30:07.000000000 -0600 +@@ -9,7 +9,7 @@ + import Hellanzb, sys, time + + import twisted.copyright +-if twisted.copyright.version >= '2.0.0': ++if twisted.copyright.version >= '2.0.0' or twisted.copyright.version >= '10.0.0': + from twisted.internet.selectreactor import SelectReactor + from twisted.internet.selectreactor import _NO_FILENO + from twisted.internet.selectreactor import _NO_FILEDESC diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 000000000000..ef20a4d3ff67 --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,68 @@ +# Maintainer: sputnick <gilles *DOT* quenot *AT* gmail> +# Contributor: Roland Kammerer <dev.rck@gmail.com> + +pkgname=hellanzb-git +pkgver=9999 +pkgrel=7 +pkgdesc="nzb downloader and post processor" +url="https://github.com/pjenvey/hellanzb" +depends=('python2' 'twisted-web2' 'par2cmdline' 'unrar' 'python2-pyopenssl') +source=("hellanzb.rc" "hellanzb.conf.d" "877271.diff" "877271-2.diff" "877281.diff" "par2fix.diff") +arch=('i686' 'x86_64') +conflicts=('hellanzb') +provides=('hellanzb') +makedepends=('git') +license=('BSD') +install=hellanzb.install +backup=('etc/conf.d/hellanzb') +md5sums=('e33d67945276f754e3ba406bd947296d' + '0bda37be41e3d0662bd8cdb0fdff6a20' + 'e02e555616f9ffd748f3aedaaf17d143' + '93160251bb66d63cbc55e79765b3b1db' + 'c0da3f5b87a84abe2d5cb7c3d87769df' + '3337cb86e63325a6ffb81842f9cbaff3' ) + +build() { + cd $srcdir + git clone git://github.com/pjenvey/hellanzb.git + + cd $srcdir/hellanzb + + # change the configuration directories searched from /usr/etc to /etc and + # from ./etc to ~/.config + sed -i \ + -e "\|confDirs = |s|sys.prefix|'/'|" \ + -e "\|confDirs\.append|s|join(os.getcwd(), *'etc|expanduser('~/.config|" \ + Hellanzb/Core.py + + patch < $srcdir/877271.diff $srcdir/hellanzb/Hellanzb/HellaXMLRPC/xmlrpc.py + patch < $srcdir/877271-2.diff $srcdir/hellanzb/Hellanzb/HellaXMLRPC/HtPasswdAuth.py + patch < $srcdir/877281.diff $srcdir/hellanzb/Hellanzb/HellaReactor.py + patch < $srcdir/par2fix.diff $srcdir/hellanzb/Hellanzb/PostProcessorUtil.py +} + +package() { + cd $srcdir/hellanzb + python2 ./setup.py install --root=$pkgdir + + # not cool, but the compiled version is always bad for me so this forces a re-compile + sleep 1 + touch $pkgdir/usr/lib/python2.7/site-packages/Hellanzb/HellaXMLRPC/xmlrpc.py \ + $pkgdir/usr/lib/python2.7/site-packages/Hellanzb/HellaXMLRPC/HtPasswdAuth.py \ + $pkgdir/usr/lib/python2.7/site-packages/Hellanzb/HellaReactor.py \ + $pkgdir/usr/lib/python2.7/site-packages/Hellanzb/PostProcessorUtil.py + + # move /usr/etc to /etc + mv $pkgdir/usr/etc $pkgdir/ + + install -D -m644 LICENSE $pkgdir/usr/share/licenses/$pkgname/LICENSE + + # install the rc scripts + mkdir -p $pkgdir/etc/{rc.d,conf.d} + install -D -m755 $srcdir/hellanzb.rc $pkgdir/etc/rc.d/hellanzb + install -D -m644 $srcdir/hellanzb.conf.d $pkgdir/etc/conf.d/hellanzb + + # quick fix from https://aur.archlinux.org/packages.php?ID=3935&comments=all + sed -i s,"from twisted.internet.selectreactor import _NO_FILENO","#from twisted.internet.selectreactor import _NO_FILENO", $pkgdir/usr/lib/python2.7/site-packages/Hellanzb/HellaReactor.py + sed -i s,"from twisted.internet.selectreactor import _NO_FILEDESC","#from twisted.internet.selectreactor import _NO_FILEDESC", $pkgdir/usr/lib/python2.7/site-packages/Hellanzb/HellaReactor.py +} diff --git a/hellanzb.conf.d b/hellanzb.conf.d new file mode 100644 index 000000000000..e0537238bb34 --- /dev/null +++ b/hellanzb.conf.d @@ -0,0 +1,5 @@ +# hellanzb will be run as the user you specify. This is required because the +# files that hellanzb generates are readable only by the user running the +# process. +HELLANZB_USER="your_username" +HELLANZB_CONF="/home/${HELLANZB_USER}/.config/hellanzb.conf" diff --git a/hellanzb.install b/hellanzb.install new file mode 100644 index 000000000000..192392893372 --- /dev/null +++ b/hellanzb.install @@ -0,0 +1,20 @@ +# arg 1: the new package version +post_install() { + echo ">>> If you wish to use SSL, please install pyopenssl." + echo ">>> " + echo ">>> To configure:" + echo ">>> Copy /etc/hellanzb.conf.sample to either /etc/hellanzb.conf or" + echo ">>> ~/.config/hellanzb.conf and edit." + echo ">>> " + echo ">>> To run:" + echo ">>> Run /usr/bin/hellanzb.py or use the rc script /etc/rc.d/hellanzb." + echo ">>> If using the rc script, make sure to edit /etc/conf.d/hellanzb." +} + +post_upgrade() { + post_install +} + +op=$1 +shift +$op $* diff --git a/hellanzb.rc b/hellanzb.rc new file mode 100755 index 000000000000..36adc573d9e1 --- /dev/null +++ b/hellanzb.rc @@ -0,0 +1,38 @@ +#!/bin/bash + +# source application-specific settings +[ -f /etc/conf.d/hellanzb ] && . /etc/conf.d/hellanzb + +. /etc/rc.conf +. /etc/rc.d/functions + +case "$1" in + start) + stat_busy "Starting hellanzb" + /bin/su - ${HELLANZB_USER} -c " /usr/bin/python2 /usr/bin/hellanzb.py -D -c ${HELLANZB_CONF} &> /dev/null" + if [ $? -gt 0 ]; then + stat_fail + else + add_daemon hellanzb + stat_done + fi + ;; + stop) + stat_busy "Stopping hellanzb" + /bin/su - ${HELLANZB_USER} -c " /usr/bin/python2 /usr/bin/hellanzb.py -c ${HELLANZB_CONF} shutdown &> /dev/null" + if [ $? -gt 0 ]; then + stat_fail + else + rm_daemon hellanzb + stat_done + fi + ;; + restart) + $0 stop + sleep 2 + $0 start + ;; + *) + echo "usage: $0 {start|stop|restart}" +esac +exit 0 diff --git a/par2fix.diff b/par2fix.diff new file mode 100644 index 000000000000..1ebfffcda62e --- /dev/null +++ b/par2fix.diff @@ -0,0 +1,10 @@ +--- PostProcessorUtil.py.orig 2011-03-20 14:51:43.299935839 +0200 ++++ PostProcessorUtil.py 2011-03-20 14:52:15.873693265 +0200 +@@ -839,6 +839,7 @@ def par2(postProcessor, parFiles, wildca + repairCmd = [Hellanzb.PAR2_CMD, 'r', '--'] + for parFile in parFiles: + repairCmd.append(pathjoin(dirName, parFile)) ++ os.chdir(dirName) + repairCmd.append('*._hellanzb_dupe*') + + t = Topen(repairCmd, postProcessor) |