# Contributor: Leonardo Arena <rnalrd@alpinelinux.org>
# Maintainer: Leonardo Arena <rnalrd@alpinelinux.org>
pkgname=pm-utils
pkgver=1.4.1
pkgrel=0
pkgdesc="A small collection of scripts that handle suspend and resume on behalf of HAL"
url="http://pm-utils.freedesktop.org"
arch="all"
license="GPL"
depends=
depends_dev=
makedepends="linux-headers $depends_dev"
install=
subpackages="$pkgname-dev $pkgname-doc"
source="http://pm-utils.freedesktop.org/releases/$pkgname-$pkgver.tar.gz"


_builddir="$srcdir"/$pkgname-$pkgver

prepare() {
	cd "$_builddir"
	# apply patches here
}

build() {
	cd "$_builddir"
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--sysconfdir=/etc \
		--mandir=/usr/share/man \
		--infodir=/usr/share/info \
		|| return 1
	make || return 1
}

package() {
	cd "$_builddir"
	make DESTDIR="$pkgdir" install

	# remove the 2 lines below (and this) if there is no init.d script
	# install -m755 -D "$srcdir"/$pkgname.initd "$pkgdir"/etc/init.d/$pkgname
	# install -m644 -D "$srcdir"/$pkgname.confd "$pkgdir"/etc/conf.d/$pkgname
}

sha512sums="5bc9479fe75f120aee136befeb24c8d7d85f61410b551177ed61fd1b4ea9cce7989796b067e357ea93b44b4ae9f66311687066f188236c5efdfd3750695a8017  pm-utils-1.4.1.tar.gz"