APP=smartmontools
VERSION=6.5
BUILD=1sml
HOMEPAGE="http://smartmontools.sourceforge.net"
DOWNLOAD="https://sourceforge.net/projects/smartmontools/files/smartmontools/6.5/smartmontools-6.5.tar.gz"
DESC="monitoring utilities for hard drives using SMART protocol"
REQUIRES="musl"

build() {
  mkandenterbuilddir
  rm -rf $APP-$VERSION

  tar xf $SRCDIR/$APP-$VERSION.tar.?z*
  cd $APP-$VERSION
  fixbuilddirpermissions

  ./configure \
    --prefix="" \
    --sysconfdir=/etc \
    --sbindir=/bin 

  make
  make install DESTDIR=$PKG

  cp COPYING README $PKGDOCS/
  head -n 1000 ChangeLog > $PKGDOCS/CHANGELOG

  install -Dm 755 $SRCDIR/rc.smartd $PKG/etc/rc.d/rc.smartd

  mkfinalpkg
}

SHA512SUMS="
3ae0cf5eb6afb0a7630496575709fb8ad41b7692f1b2a544ba4a539b6d01e01a1a62b1b73132e4b3d2981f1b8b717c9cbd5037a86a1aae1031640d5cf096417c  smartmontools-6.5.tar.lz
"
