# Maintainer: PktSurf <smlinux@pktsurf.in>
app=shared-mime-info
version=1.7
build=2sml
homepage="https://freedesktop.org/wiki/Software/shared-mime-info/"
download="https://gitlab.freedesktop.org/xdg/shared-mime-info/-/archive/Release-1-7/shared-mime-info-Release-1-7.tar.bz2"
desc="Freedesktop.org Shared MIME Info"
requires="glib libxml2 xmlto"

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

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

build() {
  ac_cv_func_fdatasync=no \
  ./configure \
    --prefix=""

  mkdir -p .deps
  touch .deps/update_mime_database-update-mime-database.Tpo

  sed -i 's@$(AM_V_at)$(am__mv) $(DEPDIR)/update_mime_database-update-mime-database.Tpo@#@' Makefile
  for i in po ; do
    printf 'check:\n\ttrue\n\nall:\n\ttrue\ninstall:\n\ttrue\nclean:\n\ttrue\n\n' > "$i"/Makefile
  done

  make -j1
  make install DESTDIR=$pkg 

  cp COPYING $pkgdocs/

  mkfinalpkg
}

sha512sums="
c9925bfb0f9d8dc7994a9b71a3a26540ae6c92ac549de46401d8399306a380e8b2213defd5a884f416ad6e0a928e59bcddd63a163cdc1c16b1a427a2e922876d  shared-mime-info-1.7.tar.lz
"
