NAME="hddtemp"
DESC="Small utility that gives you the temperature of your hard drive by reading S.M.A.R.T. informations"
VERSION="0.3-beta15"
FILES=(
  "https://download.savannah.nongnu.org/releases/hddtemp/hddtemp-$VERSION.tar.bz2"
  "https://deb.debian.org/debian/pool/main/h/hddtemp/hddtemp_$VERSION-53.diff.gz"
  "hddtemp.service"
)
HASHES=(
  "618541584054093d53be8a2d9e81c97174f30f00af91cb8700a97e442d79ef5b"
  "6f1ddaa9fbc90ea5c00b949e0981b78c5014e109de88804ae2512209091eae56"
  "7f6fda4379630a21a8014d8f471eef6451fa15d73df32ec90a85d6a3f9d0c7d4"
)
DEPENDS=()
KEEP=("/etc/hddtemp.db")

PACKAGE() {
  tar xf $NAME-$VERSION.tar.bz2
  gunzip ${NAME}_$VERSION-53.diff.gz 
  cd $NAME-$VERSION

  patch -p1 -i "../hddtemp_$VERSION-53.diff"
  rm "../hddtemp_$VERSION-53.diff"

  ./configure               \
		--prefix=/usr           \
		--sbindir=/usr/bin      \
		--mandir=/usr/share/man \
		--with-db-path="/etc/hddtemp.db"
	make && make DESTDIR="$ROOTDIR" install
  install -Dm0644 -t "$ROOTDIR/etc/" debian/hddtemp.db
  install -Dm0644 -t "$ROOTDIR/usr/lib/systemd/system/" "../hddtemp.service"

  cd .. && rm -r $NAME-$VERSION
}
