Updating aur of sabnzbd

This commit is contained in:
Mike Brown 2012-09-09 10:11:13 -04:00
parent d43028bbdc
commit 3dc033a362
5 changed files with 63 additions and 20 deletions

View file

@ -1,6 +1,6 @@
pkgname=sabnzbd
_pkgname=SABnzbd
pkgver=0.7.2
pkgver=0.7.3
pkgrel=1
pkgdesc="A web-interface based binary newsgrabber with NZB file support"
url="http://www.sabnzbd.org"
@ -8,21 +8,24 @@ arch=("any")
license=("GPL")
depends=("curl" "par2cmdline"
"python2" "python2-cheetah" "python2-feedparser" "python2-pyopenssl" "python2-yenc"
"sqlite3" "unrar" "unzip")
"sqlite" "unrar" "unzip" "xdg-utils")
install="${pkgname}.install"
backup=("etc/conf.d/${pkgname}" "opt/${pkgname}/${pkgname}.ini")
source=("http://downloads.sourceforge.net/sabnzbdplus/${_pkgname}-${pkgver}-src.tar.gz"
"${pkgname}" "${pkgname}.confd" "${pkgname}.init" "${pkgname}.desktop"
"addnzb.sh" "nzb-2.png" "sab2_64.png" "x-nzb.xml")
md5sums=("913e42175682dca8ce668ce571ec039c"
"48d60a1c626503c7fef1bc5374390513"
"7d7ae7cca08e90582587773da3b55de8"
"848c7b117388671f243bd0833ff41f89"
"f9bd5485072714b11f8c30a28024dc4d"
"c0d52ba8d47f731790cd717fde46b829"
"2a49c07b1e3e6448eabe92644315f983"
"fdc878dd0f6f25617e627b04409abbbd"
"11fb2cd1451e3725b08bfc2bd045be54")
"addnzb.sh" "nzb-2.png" "sab2_64.png" "x-nzb.xml" "${pkgname}.service" "${pkgname}_systemd.confd" "${pkgname}.tmp")
md5sums=('5a528e9ac07cce558c9a775d5d2b91d3'
'48d60a1c626503c7fef1bc5374390513'
'7d7ae7cca08e90582587773da3b55de8'
'848c7b117388671f243bd0833ff41f89'
'f9bd5485072714b11f8c30a28024dc4d'
'c0d52ba8d47f731790cd717fde46b829'
'2a49c07b1e3e6448eabe92644315f983'
'fdc878dd0f6f25617e627b04409abbbd'
'11fb2cd1451e3725b08bfc2bd045be54'
'7c2971c330fc131e75ad55979231edff'
'bb1111d3938d76dcc4109d24f1107fe7'
'1ced962fabe7f5392e32828429b93d04')
package() {
mkdir -p "${pkgdir}/opt/${pkgname}"
@ -39,6 +42,9 @@ package() {
install -Dm755 "${srcdir}/${pkgname}" "${pkgdir}/usr/bin/${pkgname}"
install -Dm755 "${srcdir}/${pkgname}.init" "${pkgdir}/etc/rc.d/${pkgname}"
install -Dm644 "${srcdir}/${pkgname}.confd" "${pkgdir}/etc/conf.d/${pkgname}"
install -Dm644 "${srcdir}/${pkgname}_systemd.confd" "${pkgdir}/etc/conf.d/${pkgname}_systemd"
install -Dm644 "${srcdir}/${pkgname}.tmp" "${pkgdir}/usr/lib/tmpfiles.d/${pkgname}.conf"
install -Dm644 "${srcdir}/${pkgname}.service" "${pkgdir}/usr/lib/systemd/system/${pkgname}.service"
install -Dm755 "${srcdir}/${pkgname}.desktop" \
"${pkgdir}/usr/share/applications/${pkgname}.desktop"
install -Dm755 "${srcdir}/addnzb.sh" "${pkgdir}/opt/${pkgname}/addnzb.sh"

View file

@ -9,7 +9,7 @@ post_install() {
post_upgrade
cat << "EOM"
==> Don't forget to edit /etc/conf.d/sabnzbd!
==> Don't forget to edit /etc/conf.d/sabnzbd or /etc/conf.d/sabnzbd_systemd!
==> Add your Session key and if necessary your username and password to ensure a proper shutdown.
==> If you want to associate .nzb-files with SABnzbd, run 'xdg-mime default sabnzbd.desktop applications/x-nzb'
EOM
@ -22,16 +22,14 @@ pre_upgrade() {
if [ -f /run/daemons/sabnzbd ]; then
/etc/rc.d/sabnzbd stop # kill the daemon
fi
if [[ -d "/run/sabnzbd/" && "$(ls -A /run/sabnzbd/)" ]]; then
systemctl stop sabnzbd.service
fi
if [ -n "${PID}" ];then
kill "${PID}" # kill the daemon finaly
fi
#remove with 0.7.x release {{{
grep -q "SABNZBD_GROUP" /etc/conf.d/sabnzbd || \
echo 'SABNZBD_GROUP="sabnzbd"' >> /etc/conf.d/sabnzbd
grep -q "SABNZBD_DIR" /etc/conf.d/sabnzbd || \
echo 'SABNZBD_DIR="/opt/sabnzbd"' >> /etc/conf.d/sabnzbd
#}}}
}
## arg 1: the new package version
@ -80,6 +78,10 @@ post_upgrade() {
fi
chown -R "${SABNZBD_USER}:${SABNZBD_GROUP}" "${SABNZBD_DIR}"
if command -v "systemd-tmpfiles" &> /dev/null; then
systemd-tmpfiles --create /usr/lib/tmpfiles.d/sabnzbd.conf
fi
}
## arg 1: the old package version

View file

@ -0,0 +1,14 @@
[Unit]
Description=SABnzbd binary newsreader
[Service]
EnvironmentFile=/etc/conf.d/sabnzbd_systemd
ExecStart=/bin/sh/ -c "python2 ${SABNZBD_DIR}/SABnzbd.py ${SABNZBD_ARGS} --pid /run/sabnzbd"
ExecStop=/usr/bin/curl -f "${SABNZBD_PROTOCOL}://${SABNZBD_USPW}${SABNZBD_IP}:${SABNZBD_PORT}/sabnzbd/api?mode=shutdown&apikey=${SABNZBD_KEY}"
Type=forking
PIDFile=/run/sabnzbd/sabnzbd-8080.pid
User=sabnzbd
Group=sabnzbd
[Install]
WantedBy=multi-user.target

1
aur/sabnzbd/sabnzbd.tmp Normal file
View file

@ -0,0 +1 @@
d /run/sabnzbd 0755 sabnzbd sabnzbd -

View file

@ -0,0 +1,20 @@
# Systemd configuration file for SABnzbd
# NOTE: Change user, group and port in sabnzbd.service as well.
# Due to a bug these cannot be loaded from this config file
# Set the protocol, IP and port
SABNZBD_PROTOCOL=http
SABNZBD_IP=127.0.0.1
SABNZBD_PORT=8080
# Set your default user/group(id), startarguments and your configfile
SABNZBD_DIR=/opt/sabnzbd
SABNZBD_ARGS=-f /opt/sabnzbd/sabnzbd.ini -s 127.0.0.1:8080 -d
# Put the session keys from Config > General here
SABNZBD_KEY=
NZB_KEY=
# If you use a username and password, change the following variable to
# "user:pass@"
SABNZBD_USPW=