description="A completely flexible, totally extensible daemon for delivering ACPI events."
url="https://sourceforge.net/projects/acpid2/"

contributors="Berlius,Fanch,Greg,Spiky,Tnut"
packager="Spiky <spiky@nutyx.org>"

run=(pm-utils)

# Makes installation of enlightenment desktop happy :)
#
set=(enlightenment)

name=acpid
version=2.0.34

runyx_version=20201011

PKGMK_GROUPS=(doc devel man)
source=(http://downloads.tuxfamily.org/nutyx/files/runyx-${runyx_version}.tar.xz
	http://downloads.sourceforge.net/acpid2/$name-$version.tar.xz 
	lid lid.sh)

build() {

cd $name-$version
./configure --prefix=/usr \
--docdir=/usr/share/doc/$name-$version
make

make DESTDIR=$PKG install
install -m755 -d $PKG/etc/acpi/events

cp -r samples $PKG/usr/share/doc/$name-$version
cp -r $SRC/lid $PKG/etc/acpi/events/lid.example
cp -r $SRC/lid.sh $PKG/etc/acpi/lid.sh.example

chmod +x $PKG/etc/acpi/lid.sh.example

# Service
cd $SRC/runyx-${runyx_version}
make DESTDIR=$PKG install-sysv-acpid
make DESTDIR=$PKG install-sysd-acpid
make DESTDIR=$PKG install-runyx-acpid
}
