# Maintainer: Developer <dev@opalos.org>
# Maintainer: Developer <dev@opalos.org>

pkgname=reiserfsprogs
pkgver=%version%
pkgrel=%release%
pkgdesc="Reiserfs utilities"
arch=('x86_64')
url="https://www.kernel.org/"
license=('GPL')
depends=('util-linux')
source=("https://www.kernel.org/pub/linux/kernel/people/jeffm/reiserfsprogs/v${pkgver}/${pkgname}-${pkgver}.tar.xz"
        reiserfsprogs-3.6.27-loff_t.patch)
sha256sums=('0e95b67fa7746a3c2d59145e9b9c2feb4a6be52853e83b497b182eae508e62e3'
            '2d4e90d5e2b0610021d0c078f350e098d5573edccdf2864909aada83ed0473f9')

prepare() {
  cd ${pkgname}-${pkgver}
  patch -p1 -i "$srcdir"/reiserfsprogs-3.6.27-loff_t.patch
  autoreconf -i
}

build() {
  cd ${pkgname}-${pkgver}
  CFLAGS+=' -fgnu89-inline'
  ./configure --prefix=/usr --sbindir=/usr/bin
  make
}

check() {
  cd ${pkgname}-${pkgver}
  make check
}

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