# Description:   daemon for controlling APC UPSes
# URL:           http://www.apcupsd.org/
# Maintainer:    Fredrik Rinnestam, fredrik at rinnestam dot se

name=apcupsd
version=3.14.14
release=1
source=(http://downloads.sourceforge.net/project/$name/apcupsd%20-%20Stable/$version/$name-$version.tar.gz \
        apcupsd)

build(){
cd $name-$version
	./configure --prefix=/usr \
		--sbindir=/usr/sbin \
		--mandir=/usr/man \
		--enable-usb

	make -j1
	make DESTDIR=$PKG install
	rm -r $PKG/usr/share

	install -d $PKG/etc/rc.d
	install -d $PKG/usr/bin

	install -m 755 $SRC/apcupsd $PKG/etc/rc.d
	mv $PKG/usr/sbin/apcaccess $PKG/usr/bin/apcaccess
}
