pkgname=tar
pkgver=1.35
pkgdesc='Utility used to store, backup, and transport files'
arch=('x86_64')
homepage='https://www.gnu.org/software/tar/'
license=('GPL3')
sources=("${pkgname}-${pkgver}.tar.xz")
urls=("https://ftp.gnu.org/gnu/${pkgname}/${sources[0]}")
md5sums=("a2d8042658cfd8ea939e6d911eaf4152")

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

src_build() {
  FORCE_UNSAFE_CONFIGURE=1 ./configure --prefix=/usr
  make
}

src_check() {
  leaf_record_message "capabilities: binary store/restore is known to fail. See LFS handbook."
  make check
}

src_install() {
  make DESTDIR="${pkgdir}" install
  make DESTDIR="${pkgdir}" -C doc install-html docdir=/usr/share/doc/tar-${pkgver}
}
