# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=smartmontools
pkgver=6.6
pkgrel=0
pkgdesc="Control and monitor S.M.A.R.T. enabled ATA and SCSI Hard Drives."
url="http://smartmontools.sourceforge.net"
arch="all"
license="GPL"
makedepends="linux-headers"
subpackages="$pkgname-doc"
source="http://downloads.sourceforge.net/sourceforge/$pkgname/$pkgname-$pkgver.tar.gz
	smartd.initd
	smartd.confd
	musl-canonicalize_file_name.patch
	"
builddir="$srcdir/$pkgname-$pkgver"

build() {
	cd "$builddir"

	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--sysconfdir=/etc
	make
}

check() {
	cd "$builddir"

	make check
}

package() {
	cd "$builddir"

	make DESTDIR="$pkgdir"/ install

	install -Dm755 "$srcdir"/smartd.initd "$pkgdir"/etc/init.d/smartd
	install -Dm644 "$srcdir"/smartd.confd "$pkgdir"/etc/conf.d/smartd
}

sha512sums="64bb533dac29f62ddd662a16a12c97df1af9cbac9ac526ce7af0b3bff9da49cf265a2030d91a7160452b56a67e80d7f34c9b4e45bbb320114f55695e2cb5cfaf  smartmontools-6.6.tar.gz
61cae548fc9f3a9fbea20d684502d3816e7b0b60fcf533ae4e1ab850725c208eb6ba5012ae154a46f0b7bb7285a9e63cbdecafed8db7fd63fda0ba59081260cc  smartd.initd
ff45462944f01c0e7cac99443078b253dcbaed4f99ffab85052b12361d9eec4beec81cab334fbede9148b3dd503d5205add32ef4327a788f02a8b1e37f460437  smartd.confd
eff9a1ca8e10be5b05a4be609973065d6f02f12c9d511d3a7c87fa172934d3739594f00e5a61ed2d6dc65de5fd1ff23ec049b21078d5b1620c5dbafa56d78bbe  musl-canonicalize_file_name.patch"
