mirror of
https://github.com/archlinuxarm/PKGBUILDs.git
synced 2024-09-19 22:08:32 +00:00
Added aur/couchpotato-git
This commit is contained in:
parent
1ad0c7908c
commit
0bb7365d04
42
aur/couchpotato-git/PKGBUILD
Normal file
42
aur/couchpotato-git/PKGBUILD
Normal file
|
@ -0,0 +1,42 @@
|
||||||
|
# Maintainer: Ben Ruijl <benruyl at gmail>
|
||||||
|
|
||||||
|
plugrel=1
|
||||||
|
|
||||||
|
pkgname=couchpotato-git
|
||||||
|
pkgver=20110227
|
||||||
|
pkgrel=1
|
||||||
|
pkgdesc="Automatic Movie Downloading via NZBs & Torrent"
|
||||||
|
arch=('i686' 'x86_64')
|
||||||
|
url="http://couchpotatoapp.com/"
|
||||||
|
license=('unknown')
|
||||||
|
depends=('python2')
|
||||||
|
makedepends=('git')
|
||||||
|
install='couchpotato.install'
|
||||||
|
source=('couchpotato' 'couchpotato.init')
|
||||||
|
md5sums=('a7db842a8af532847ef41890f6714819'
|
||||||
|
'6f247a743fd17aa38e99f64e6e123978')
|
||||||
|
|
||||||
|
|
||||||
|
_gitroot="git://github.com/RuudBurger/CouchPotato.git"
|
||||||
|
_gitname="couchpotato_src"
|
||||||
|
|
||||||
|
build() {
|
||||||
|
cd "$srcdir"
|
||||||
|
msg "Connecting to GIT server...."
|
||||||
|
|
||||||
|
if [ -d $_gitname ]; then
|
||||||
|
cd $_gitname && git pull origin
|
||||||
|
msg "The local files are updated."
|
||||||
|
else
|
||||||
|
git clone $_gitroot $_gitname
|
||||||
|
fi
|
||||||
|
|
||||||
|
msg "GIT checkout done or server timeout"
|
||||||
|
msg "Starting install..."
|
||||||
|
|
||||||
|
mkdir -p "${pkgdir}/opt/"
|
||||||
|
cp -r "$srcdir/$_gitname" "${pkgdir}/opt/couchpotato"
|
||||||
|
|
||||||
|
install -D -m755 "${srcdir}/couchpotato" "${pkgdir}/usr/bin/couchpotato"
|
||||||
|
install -D -m755 "${srcdir}/couchpotato.init" "${pkgdir}/etc/rc.d/couchpotato"
|
||||||
|
}
|
3
aur/couchpotato-git/couchpotato
Normal file
3
aur/couchpotato-git/couchpotato
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
python2 /opt/couchpotato/CouchPotato.py "$@"
|
43
aur/couchpotato-git/couchpotato.init
Normal file
43
aur/couchpotato-git/couchpotato.init
Normal file
|
@ -0,0 +1,43 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
. /etc/rc.conf
|
||||||
|
. /etc/rc.d/functions
|
||||||
|
|
||||||
|
case "$1" in
|
||||||
|
start)
|
||||||
|
stat_busy "Starting CouchPotato"
|
||||||
|
|
||||||
|
if [ -f /var/run/daemons/couchpotato ]; then
|
||||||
|
echo -n "CouchPotato is already running as a daemon! If you are certain it is not running, remove /var/run/daemons/couchpotato."
|
||||||
|
stat_fail
|
||||||
|
else
|
||||||
|
su - couchpotato -c "python2 /opt/couchpotato/CouchPotato.py &> /dev/null &" -s /bin/sh
|
||||||
|
if [ $? -gt 0 ]; then
|
||||||
|
stat_fail
|
||||||
|
else
|
||||||
|
add_daemon couchpotato
|
||||||
|
stat_done
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
stop)
|
||||||
|
stat_busy "Stopping CouchPotato"
|
||||||
|
|
||||||
|
curl -f http://localhost:5000/config/exit/ &> /dev/null
|
||||||
|
|
||||||
|
if [ $? -gt 0 ]; then
|
||||||
|
stat_fail
|
||||||
|
else
|
||||||
|
rm_daemon couchpotato
|
||||||
|
stat_done
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
restart)
|
||||||
|
$0 stop
|
||||||
|
sleep 1
|
||||||
|
$0 start
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
echo "usage: $0 {start|stop|restart}"
|
||||||
|
esac
|
||||||
|
exit 0
|
17
aur/couchpotato-git/couchpotato.install
Normal file
17
aur/couchpotato-git/couchpotato.install
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
## arg 1: the new package version
|
||||||
|
post_install() {
|
||||||
|
groupadd couchpotato &> /dev/null
|
||||||
|
useradd -g couchpotato -d /opt/couchpotato -s /bin/false couchpotato &> /dev/null
|
||||||
|
chown -R couchpotato:couchpotato /opt/couchpotato
|
||||||
|
echo " >> If you change CouchPotato's port in the general configuration page, you will need to edit /etc/rc.d/couchpotato to have it point to the new port number"
|
||||||
|
}
|
||||||
|
## arg 1: the new package version
|
||||||
|
## arg 2: the old package version
|
||||||
|
post_upgrade() {
|
||||||
|
chown -R couchpotato:couchpotato /opt/couchpotato
|
||||||
|
}
|
||||||
|
|
||||||
|
## arg 1: the old package version
|
||||||
|
pre_remove() {
|
||||||
|
userdel couchpotato &> /dev/null
|
||||||
|
}
|
Loading…
Reference in a new issue