# Maintainer: PktSurf <smlinux@pktsurf.in>
app=e2fsprogs
version=1.45.3
build=4sml
homepage="http://e2fsprogs.sourceforge.net/"
download="https://mirrors.edge.kernel.org/pub/linux/kernel/people/tytso/e2fsprogs/v$version/e2fsprogs-$version.tar.xz"
desc="Utilities for working with ext 2, 3 and 4 filesystems"
requires="util-linux"

prepbuilddir() {
  mkandenterbuilddir
  rm -rf $app-$version

  tar xf $srcdir/$app-$version.tar.?z*
  cd $app-$version
  fixbuilddirpermissions
}

build() {
  for i in misc/fsck.c misc/mke2fs.c e2fsck/unix.c ; do
    sed -i 's@sbin@bin@g' $i
  done

  ac_cv_path_mkdir="mkdir -p" \
  CFLAGS+=" -D__uint64_t=u_int64_t" \
  LDFLAGS="-static" \
  ./configure \
    --prefix= \
    --with-root-prefix= \
    --sbindir=/bin \
    --disable-libblkid \
    --disable-libuuid \
    --disable-uuidd

  make
  make install DESTDIR=$pkg

  cp NOTICE $pkgdocs/LICENSE

  mkfinalpkg
}

sha512sums="
aaa6e1ef3bce5935cdca853a91ac596f41a62b5f16f7cd944b3ad572fe5890fce9d08335a46c6fefebeab99ec32b1ef6d2df94e6b7afc19f19d244f000605103  e2fsprogs-1.45.3.tar.lz
"
