# Maintainer: Alexey Pavlov <Alexpux@gmail.com>

pkgname=rarian
pkgver=0.8.1
pkgrel=2
pkgdesc="Documentation meta-data library, designed as a replacement for Scrollkeeper."
arch=('i686' 'x86_64')
url="https://rarian.freedesktop.org/"
license=('GPL')
depends=('gcc-libs')
makedepends=('libxslt')
source=(https://download.gnome.org/sources/${pkgname}/0.8/${pkgname}-${pkgver}.tar.bz2
        user-segfault.patch
        msysize.patch
        0.8-no-undefined.patch
        0.8.1-file-uri.patch)
sha256sums=('aafe886d46e467eb3414e91fa9e42955bd4b618c3e19c42c773026b205a84577'
            '518b1834d4f44e92161f0cf2f72a6474f0ec687ea53562c64109df90d343fe71'
            'eb52d89126cb55a10441ec60b03ed12f5e1c20eb1daaee90eef94e07577416b0'
            'de0cddcf34294f6a8cf14c38c196462de75840b5cfdf6445804100398bb2daa4'
            'c3a447c98280653474112a9f4e740325f11947a2e4a4dc6b9afc8fb5e64e98d3')

prepare() {
  cd "${srcdir}/${pkgname}-${pkgver}"
  patch -Np0 -i ${srcdir}/user-segfault.patch
  patch -Np1 -i ${srcdir}/msysize.patch
  patch -Np2 -i ${srcdir}/0.8-no-undefined.patch
  patch -Np2 -i ${srcdir}/0.8.1-file-uri.patch

  autoreconf -fi
}

build() {
  cd "${srcdir}/${pkgname}-${pkgver}"
  ./configure --prefix=/usr \
      --sysconfdir=/etc \
      --localstatedir=/var \
      --disable-static
  make
}

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