# Packager = Tuxcore <dev@tuxcore.org> 
pkgname=libatasmart
pkgver=0.19
pkgrel=6
pkgdesc='ATA S.M.A.R.T. reader and parser library'
arch=('x86_64')
url='https://0pointer.de/blog/projects/being-smart.html'
license=('LGPL-2.1-or-later')
depends=('glibc' 'systemd-libs')
makedepends=('git')
source=("git+https://git.0pointer.net/clone/libatasmart.git#tag=v$pkgver"
        '0001-Dont-test-undefined-bits.patch'
        '0002-Drop-our-own-many-bad-sectors-heuristic.patch')
b2sums=('9a43568707da97163000bdc97f428993c5fc3dc9490e47e42d3ef315dc1f06e39c1f71cdf9bcaccfee44201fd47be4d5df16a30a35ee6aaf729b1bbda24aeb1d'
        '826c9ebce4aa299d57a9c3c410fa3fb0875f2eb92c9a4c5e27e384e78c316a86947dfbf5fa065b7cf9bc84a71948d8df47aa4a47129d4c316fa8f11815b8adcb'
        '6c96188d7cad73b8a7c6be8fa27ae297d6a6b32245bdde01050bbe5d1536b7e9618b7b2c5ffed41ca95d79b878dd84e2b9af7f1f2422e70fde54132646c93f8b')

prepare() {
  cd $pkgname
  patch -Np1 -i ../0001-Dont-test-undefined-bits.patch
  patch -Np1 -i ../0002-Drop-our-own-many-bad-sectors-heuristic.patch

  autoreconf -fi
}

build() {
  cd $pkgname
  ./configure --prefix=/usr --sbindir=/usr/bin
  make
}

package() {
  cd $pkgname
  make DESTDIR="$pkgdir" install
}
