# Maintainer: Lukas Fleischer <lfleischer@archlinux.org>
# Contributor: Emil Renner Berthing <esmil@mailme.dk>
# Contributor: Xiao-Long Chen <chenxiaolong@cxl.epac.to>

pkgname=hdapsd
pkgver=20250908
pkgrel=1
pkgdesc='HDAPS userspace hard drive protection daemon'
arch=('x86_64')
url='https://github.com/evgeni/hdapsd'
license=('GPL')
depends=('glibc' 'bash')
source=("$pkgname-$pkgver.tar.gz::https://github.com/evgeni/${pkgname}/archive/${pkgver}.tar.gz")
sha256sums=('a4035d90cb2fc84d1550434b192746612b1e2c5747d6776c37d8de4b2dccc27b')

build() {
  cd "${srcdir}/${pkgname}-${pkgver}"

  ./autogen.sh
  ./configure --prefix=/usr --sysconfdir=/etc --sbindir=/usr/bin \
    --with-udevdir=/usr/lib/udev --with-systemdsystemunitdir=/usr/lib/systemd/system
  make ${MAKEFLAGS}
}

package() {
  cd "${srcdir}/${pkgname}-${pkgver}"
  make DESTDIR="${pkgdir}/" install
}
