pkgname=e2fsprogs
pkgver=1.47.3
pkgdesc='Ext2/3/4 filesystem utilities'
arch=('x86_64')
license=('GPL' 'LGPL' 'MIT')
homepage="https://e2fsprogs.sourceforge.net/"
sources=("${pkgname}-${pkgver}.tar.gz")
urls=("https://downloads.sourceforge.net/project/${pkgname}/${pkgname}/v${pkgver}/${sources[0]}")
md5sums=("113d7a7ee0710d2a670a44692a35fd2e")

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

src_build() {
  mkdir -v build
  cd       build

  ../configure --prefix=/usr       \
               --sysconfdir=/etc   \
               --enable-elf-shlibs \
               --disable-libblkid  \
               --disable-libuuid   \
               --disable-uuidd     \
               --disable-fsck
  make
}

src_check() {
  leaf_record_message "m_assume_storage_prezeroed is known to fail."
  leaf_record_message "m_rootdir_acl is known to fail on non-ext4 FS."
  make check
}


src_install() {
  make DESTDIR="${pkgdir}" install
  rm -fv ${pkgdir}/usr/lib/{libcom_err,libe2p,libext2fs,libss}.a
}

