pkgname=expat
pkgver=2.7.1
pkgdesc="An XML parser library"
homepage="https://libexpat.github.io/"
license=(MIT)
sources=("${pkgname}-${pkgver}.tar.xz")
urls=("https://github.com/libexpat/libexpat/releases/download/R_2_7_1/${sources[0]}")
md5sums=("9f0c266ff4b9720beae0c6bd53ae4469")

src_prepare() {
  tar -xf ${distdir}/${sources[0]} --strip-components=1
}

src_build() {
  ./configure --prefix=/usr    \
              --disable-static \
              --docdir=/usr/share/doc/${pkgname}-${pkgver}
  make
}

src_check() {
  make check
}

src_install() {
  make DESTDIR="${pkgdir}" install
  install -v -m644 doc/*.{html,css} "${pkgdir}/usr/share/doc/${pkgname}-${pkgver}"
  install -vDm 644 COPYING -t "${pkgdir}/usr/share/licenses/${pkgname}/"
}

