public
Created

PKGBUILD & systemd .service file for razercfg-tool-git

  • Download Gist
PKGBUILD
Shell
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59
# Maintainer: Jedipottsy
# Contributer: Mark Harviston <infinull@gmail.com>
 
pkgname=razercfg-tool-git
pkgrel=1
pkgver=20121107
pkgdesc="The next generation Razer device configuration tool."
arch=(i686 x86_64)
url="http://dual.bues.ch/cms/hacking/razercfg.html"
license=('GPL')
source=('razercfg.desktop' 'razerd.initscript' 'razerd.service')
md5sums=()
depends=('python2' 'libusb' 'python2-qt')
makedepends=('git' 'cmake')
provides=('razercfg')
conflicts=('razercfg')
md5sums=('85017a8e0bfc7228851bc93930b8a226'
'5a5f40a1182a0d784202f893972a001b'
'6a60ef198400819f0219bbcf045ca432')
 
 
_gitname="razer"
_gitroot="git://git.bues.ch/${_gitname}.git"
 
 
build() {
cd ${srcdir}
msg "Connecting to ${_gitroot} GIT server...."
if [[ -d ${srcdir}/${_gitname} ]] ; then
cd ${_gitname}
git pull origin || return 1
msg "The local files are updated."
else
git clone ${_gitroot} || return 1
cd ${_gitname}
fi
msg "GIT checkout done"
msg "Starting make..."
sed 's|/usr/bin/env python|/usr/bin/python2|g' -i ui/{{q,}razercfg,pyrazer.py}
sed 's/-O2/-O0/g' -i scripts/cmake.global
cmake -DCMAKE_INSTALL_PREFIX=/usr . || return 1
make || return 1
make DESTDIR="${pkgdir}" install || return 1
install -m755 -d "${pkgdir}"/etc/rc.d || return 1
install -m755 "${srcdir}/razerd.initscript" "${pkgdir}/etc/rc.d/razerd" || return 1
install -m755 -d ${pkgdir}/usr/share/applications || return 1
install -m644 $startdir/razercfg.desktop ${pkgdir}/usr/share/applications || return 1
install -m755 -d ${pkgdir}/usr/lib/systemd/system || return 1
install -m644 $startdir/razerd.service ${pkgdir}/usr/lib/systemd/system || return 1
 
echo
echo
echo -------------------------------------------------------------
echo 'Add "razerd" to the MODULES array in your "/etc/rc.conf"'
echo 'Or for systemd, do systemctl enable razerd'
echo -------------------------------------------------------------
echo
echo
}
razerd.service
1 2 3 4 5 6 7 8 9 10
[Unit]
Description=Razer Mouse Configuration Daemon
 
[Service]
Type=forking
PIDFile=/var/run/razerd/razerd.pid
ExecStart=/usr/sbin/razerd -B -P /var/run/razerd/razerd.pid
 
[Install]
WantedBy=multi-user.target

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.