updated on Wed Jan 25 08:34:36 UTC 2012
[aur-mirror.git] / sleepd-git / PKGBUILD
blob9a6d81798ec23953aa5e1c3bb13a20fa32f19002
1 # Contributor: Jim Pryor <jim@jimpryor.net>
3 pkgname=sleepd-git
4 pkgver=20100804
5 pkgrel=1
6 pkgdesc="daemon to put laptop to sleep when it's not being used or its battery is low"
7 arch=('i686' 'x86_64')
8 url="http://joey.kitenet.net/code/sleepd/"
9 license=('GPL')
10 # can also be built with libhal dependency
11 # depends=('hal')
12 makedepends=('git')
13 backup=('etc/conf.d/sleepd')
14 options=(docs)
15 install='sleepd.install'
17 source=(sleepd.conf sleepd.rc from_apmd.h no-apmd.patch)
18 md5sums=('a9dfb662da15d0b0ad05a4fd6be234a9'
19          '0904b5ba3ba6b33e0491aa08c6aa75ca'
20          'b472409aba64835b3c37e92edddbce5d'
21          '77ad58101f81816d8f0870204d34183b')
23 _gitroot="git://git.kitenet.net/sleepd"
24 _gitname="sleepd"
26 build() {
27         cd "$srcdir"
28         if [[ -d "$_gitname" ]]; then
29                 msg "Updating Git repository"
30                 (cd "$_gitname"; git pull origin) 
31         else
32                 msg "Checking out fresh Git repository"
33                 git clone "$_gitroot" # "$_gitname"
34         fi
35         msg "Copying files"
36         rm -rf "${_gitname}-build"
37         cp -HR --preserve=all "${_gitname}" "${_gitname}-build"
38         cd "${_gitname}-build"
39         msg "Starting build..."
41         cp "$srcdir/from_apmd.h" .
42         patch -p1 -i "$srcdir/no-apmd.patch" || return 1
44         make USE_HAL="" || return 1
45         make USE_HAL="" PREFIX="$pkgdir" install || return 1
47         install -D -m755 "$srcdir/${pkgname%-git}.rc" "$pkgdir/etc/rc.d/${pkgname%-git}"
48         install -D -m644 "$srcdir/${pkgname%-git}.conf" "$pkgdir/etc/conf.d/${pkgname%-git}"
52 # vim:syntax=sh