1 # See http://wiki.archlinux.org/index.php/VCS_PKGBUILD_Guidelines
2 # for more information on packaging from GIT sources.
4 # Contributor: David Sommer <icecook@sourceforge.net
5 pkgname=touchdaemon-git
8 pkgdesc="A tool to dis-/enable the touchpad during typping automaticly"
10 url="http://touchdaemon.sourceforge.net"
13 depends=('xorg-server')
19 backup=("/etc/rc.d/touchdaemon" "/etc/rc.d/touchdaemon.conf" )
20 install=touchdaemon.install
23 _gitroot="git://touchdaemon.git.sourceforge.net/gitroot/touchdaemon/touchdaemon"
24 _gitname="touchdaemon"
28 msg "Connecting to GIT server...."
30 if [ -d $_gitname ] ; then
31 cd $_gitname && git pull origin
32 msg "The local files are updated."
34 git clone $_gitroot $_gitname
37 msg "GIT checkout done or server timeout"
38 msg "Starting make..."
40 rm -rf "$srcdir/$_gitname-build"
41 git clone "$srcdir/$_gitname" "$srcdir/$_gitname-build"
42 cd "$srcdir/$_gitname-build"
45 #make DESTDIR="$pkgdir/" install
46 [ -d $pkgdir/usr/share/touchdaemon ] || mkdir $pkgdir/usr/share/touchdaemon -p
47 [ -d $pkgdir/usr/bin ] || mkdir $pkgdir/usr/bin -p
49 cp $srcdir/$_gitname-build/touchdaemon $pkgdir/usr/bin/touchdaemon || return 1
50 rm $srcdir/$_gitname-build/touchdaemon* || return 1
51 cp -r $srcdir/$_gitname-build/* $pkgdir/usr/share/touchdaemon || return 1
54 [ -d $pkgdir/etc/rc.d/ ] || mkdir $pkgdir/etc/rc.d/ -p
56 [ $pkgdir/etc/touchdaemon.conf -f ] || cat << EOF >> $pkgdir/etc/touchdaemon.conf
57 #To dis-/enable your touchpad use a bash command string and replace
58 #"Logitec Touchpad" with your one. You get the name with the command
60 #COMMAND='xinput set-prop "Logitech Touchpad" "Device Enabled"'
62 #touchdaemon puts a " 0" or " 1" at the end of your command to alternate
66 cat << EOF >> $pkgdir/etc/rc.d/touchdaemon
68 . /etc/touchdaemon.conf
71 if [ "\$COMMAND" = "" ]; then
72 echo "no command in /etc/touchdaemon.conf"
78 stat_busy "Starting touchdaemon"
79 /usr/bin/touchdaemon "-c\${COMMAND}" -d
83 add_daemon touchdaemon
88 stat_busy "Stopping touchdaemon"
97 chmod 755 $pkgdir/etc/rc.d/touchdaemon