1 # Contributor: Jim Pryor <jim@jimpryor.net>
6 pkgdesc="daemon to put laptop to sleep when it's not being used or its battery is low"
8 url="http://joey.kitenet.net/code/sleepd/"
10 # can also be built with libhal dependency
13 backup=('etc/conf.d/sleepd')
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"
28 if [[ -d "$_gitname" ]]; then
29 msg "Updating Git repository"
30 (cd "$_gitname"; git pull origin)
32 msg "Checking out fresh Git repository"
33 git clone "$_gitroot" # "$_gitname"
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}"