Git-Url: http://git.frugalware.org/gitweb/gitweb.cgi?p=xfcetesting.git;a=commitdiff;h=dde2c541c67197bd5d8af05d625ff4ba22242a7f
commit dde2c541c67197bd5d8af05d625ff4ba22242a7f Author: Devil505 <[email protected]> Date: Mon Aug 15 15:59:23 2011 +0200 sabnzbd-0.6.7-1-i686 * new package diff --git a/source/network-extra/sabnzbd/FrugalBuild b/source/network-extra/sabnzbd/FrugalBuild new file mode 100644 index 0000000..8d9e22a --- /dev/null +++ b/source/network-extra/sabnzbd/FrugalBuild @@ -0,0 +1,51 @@ +# Compiling Time: 0.05 SBU +# Maintainer: Devil505 <[email protected]> + +pkgname=sabnzbd +pkgver=0.6.7 +pkgrel=1 +pkgdesc="A web-interface based binary newsgrabber with NZB file support" +url="http://mookooh.org/coverfinder/" +depends=('par2cmdline' 'python-cheetah' 'feedparser' 'python-yenc' 'pyopenssl' \ + 'unrar' 'unzip' 'python-sqlite3' 'curl') +groups=('network-extra') +archs=('i686' 'x86_64') +backup=('etc/sysconfig/sabnzbd' 'usr/share/sabnzbd/sabnzbd.ini') +_F_sourceforge_ext="-src.tar.gz" +_F_sourceforge_name="SABnzbd" +_F_sourceforge_dirname="sabnzbdplus" +Finclude sourceforge +source=($source sabnzbd.service sabnzbd.sysconfig x-nzb.xml nzb-2.png sab2_64.png addnzb.sh) +sha1sums=('65d2b4b76203514f779ea62aad3e6efe0c0f91dc' \ + 'b52b647a0778da9170965d721a03a54de1cf95fc' \ + '273086a2c18a69e61496b1e62eca4b5bf6c6fdea' \ + 'fd607d2431583320a8233cced780ed98aa074c4e' \ + 'a77d34fd2222f060d77d121d56bbb94c85cf3f09' \ + '92c17637b360bb938b7000ea0c2dc81178ede130' \ + '82b87a3e662940e83f797ce824082fffd94771f6') +replaces=('hellanzb') + +_F_desktop_name="SABnzbd+" +_F_desktop_desc="Binary Newsreader" +_F_desktop_icon="sab2_64.png" +_F_desktop_exec="sh /usr/share/sabnzbd/addnzb.sh %u" +_F_desktop_categories="Network" +_F_desktop_mime="application/x-nzb" + +build() { + Fmkdir usr/share/$pkgname + mv -v $Fsrcdir/SABnzbd-$pkgver/* $Fdestdir/usr/share/$pkgname || Fdie + touch $Fdestdir/usr/share/$pkgname/$pkgname.ini || Fdie + find $Fdestdir/usr/share/$pkgname -type d -exec chmod 755 {} \; + find $Fdestdir/usr/share/$pkgname -type f -exec chmod 644 {} \; + Ffileschmod usr/share/$pkgname/SABnzbd.py 755 + Ffileschmod usr/share/$pkgname/Sample-PostProc.sh 755 + Fwrapper 'python /usr/share/sabnzbd/SABnzbd.py -f $HOME/.sabnzbd.ini "$@"' $pkgname + Ffile /lib/systemd/system/sabnzbd.service + Finstall 644 $pkgname.sysconfig etc/sysconfig/$pkgname + Fdesktop2 + Ficon nzb-2.png + Ficon sab2_64.png + Fexe addnzb.sh usr/share/$pkgname/addnzb.sh + Finstall 770 x-nzb.xml usr/share/$pkgname/x-nzb.xml +} diff --git a/source/network-extra/sabnzbd/addnzb.sh b/source/network-extra/sabnzbd/addnzb.sh new file mode 100644 index 0000000..d2a2022 --- /dev/null +++ b/source/network-extra/sabnzbd/addnzb.sh @@ -0,0 +1,14 @@ +#!/bin/bash +set -a # export all variables + +. /etc/sysconfig/sabnzbd + +# SABnzbd must be able to read the file, so we copy it to a directory where it +# certainly has rights. +nzbname=$(basename "$1") +TEMP_NZB="/var/tmp/$nzbname" + +curl -s $(python -c 'import urlparse,urllib,sys; print sys.argv[1] if urlparse.urlparse(sys.argv[1]).scheme else urlparse.urlparse(urllib.pathname2url(sys.argv[1]),"file").geturl()' "$1") -o "$TEMP_NZB" +curl -f $(python -c 'import urllib,os; print os.environ["SABNZBD_PROTOCOL"]+"://"+urllib.quote(os.environ["SABNZBD_USPW"]+os.environ["SABNZBD_IP"])+":"+os.environ["SABNZBD_PORT"]+"/sabnzbd/api?mode=addlocalfile&name="+urllib.quote(os.environ["TEMP_NZB"])+"&apikey="+urllib.quote(os.environ["NZB_KEY"])') +rm "$TEMP_NZB" +exit 0 diff --git a/source/network-extra/sabnzbd/nzb-2.png b/source/network-extra/sabnzbd/nzb-2.png new file mode 100644 index 0000000..53adbf6 Binary files /dev/null and b/source/network-extra/sabnzbd/nzb-2.png differ diff --git a/source/network-extra/sabnzbd/sab2_64.png b/source/network-extra/sabnzbd/sab2_64.png new file mode 100644 index 0000000..2c62900 Binary files /dev/null and b/source/network-extra/sabnzbd/sab2_64.png differ diff --git a/source/network-extra/sabnzbd/sabnzbd.install b/source/network-extra/sabnzbd/sabnzbd.install new file mode 100644 index 0000000..8fcad77 --- /dev/null +++ b/source/network-extra/sabnzbd/sabnzbd.install @@ -0,0 +1,25 @@ +## arg 1: the new package version +post_install() { + # add x-nzb mimetype + xdg-mime install --mode system /usr/share/sabnzbd/x-nzb.xml + xdg-icon-resource install --context mimetypes --size 64 /usr/share/sabnzbd/nzb-2.png application-x-nzb + + groupadd sabnzbd &> /dev/null + useradd -g sabnzbd -d /usr/share/sabnzbd -s /bin/false sabnzbd &> /dev/null + chown -R sabnzbd:sabnzbd /usr/share/sabnzbd + echo " >> Don't forget to edit /etc/sysconfig/sabnzbd!" + echo " >> Add your Session key and if necessary your username and password to ensure a proper shutdown." + echo " >> " + echo " >> If you want to associate .nzb-files with SABnzbd, run 'xdg-mime default sabnzbd.desktop applications/x-nzb'" + +} +## arg 1: the new package version +## arg 2: the old package version +post_upgrade() { + chown -R sabnzbd:sabnzbd /usr/share/sabnzbd +} + +## arg 1: the old package version +pre_remove() { + userdel sabnzbd &> /dev/null +} diff --git a/source/network-extra/sabnzbd/sabnzbd.service b/source/network-extra/sabnzbd/sabnzbd.service new file mode 100644 index 0000000..3dddcd6 --- /dev/null +++ b/source/network-extra/sabnzbd/sabnzbd.service @@ -0,0 +1,10 @@ +[Unit] +Description=Web-interface based binary newsgrabber with NZB file support +After=syslog.target + +[Service] +EnvironmentFile=/etc/sysconfig/sabnzbd +ExecStart=/bin/su - $SABNZBD_USER -c "python /usr/share/sabnzbd/SABnzbd.py -f ${SABNZBD_CONF} -s ${SABNZBD_IP}:${SABNZBD_PORT}" -s /bin/sh + +[Install] +WantedBy=multi-user.target diff --git a/source/network-extra/sabnzbd/sabnzbd.sysconfig b/source/network-extra/sabnzbd/sabnzbd.sysconfig new file mode 100644 index 0000000..ee6aaa1 --- /dev/null +++ b/source/network-extra/sabnzbd/sabnzbd.sysconfig @@ -0,0 +1,17 @@ +SABNZBD_USER="sabnzbd" +SABNZBD_CONF="/usr/share/sabnzbd/sabnzbd.ini" + +# Put the session keys from Config > General here +SABNZBD_KEY="" +NZB_KEY="" + +# Set to the protocol, IP and port +SABNZBD_PROTOCOL="http" +SABNZBD_IP="127.0.0.1" +SABNZBD_PORT="8080" + +# If you use a username and password, change the following variable to +# "user:pass@" +SABNZBD_USPW="" + + diff --git a/source/network-extra/sabnzbd/x-nzb.xml b/source/network-extra/sabnzbd/x-nzb.xml new file mode 100644 index 0000000..e77d284 --- /dev/null +++ b/source/network-extra/sabnzbd/x-nzb.xml @@ -0,0 +1,10 @@ +<?xml version="1.0" encoding="UTF-8"?> +<mime-info xmlns="http://www.freedesktop.org/standards/shared-mime-info"> + <mime-type type="application/x-nzb"> + + <comment xml:lang='en'>An XML-based file format for retrieving posts from NNTP (Usenet) servers</comment> + <sub-class-of type="application/xml"/> + <glob pattern="*.nzb"/> + + </mime-type> +</mime-info> _______________________________________________ Frugalware-git mailing list [email protected] http://frugalware.org/mailman/listinfo/frugalware-git
