app=polkit
version=0.120
build=1sml
homepage="http://www.freedesktop.org/wiki/Software/polkit"
download="https://gitlab.freedesktop.org/polkit/polkit/-/archive/$version/polkit-$version.tar.bz2"
desc="Authentication framework to allow communication between unprivileged and privileged processes"
requires="glib netbsd-curses expat libffi zlib dbus"

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

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

  applypatch $srcdir/make-innetgr-optional.patch
  applypatch $srcdir/polkit-0.120-security_fix-1.patch

  ./configure \
    --prefix="/" \
    --sysconfdir=/etc \
    --disable-man-pages \
    --disable-static \
    --disable-examples \
    --enable-libsystemd-login=no \
    --enable-libelogind=no \
    --with-authfw=shadow \
    --enable-verbose-mode \
    --with-os-type=Slackware \
    --disable-introspection 

  make
  make install DESTDIR=$pkg 

  mkdir -p $pkg/var/lib/polkit

  cp COPYING $pkgdocs/

  mkfinalpkg
}

sha512sums="
db072769439d5e17d0eed681e7b94251b77828c1474b40fe40b94293903a64333e7fa17515a3270648691f04a1374d8b404405ead6abf292a8eb8483164adc46  polkit-0.120.tar.gz
0c47751e928a91ce3a477a330ef38b8f6f003b515c94e7fb9842e6f2043be43d749ab7390cc1dbcf1fa6128b62cf0eab353d4f8855d68e595bc53777512f4562  make-innetgr-optional.patch
2606d4ff8ae00be2416da965f6c00c9b2c30ff928b765d9a744f9470805329192949bbca43b42741709e6fb3672c8d6f0bf8b4c97603b4f022d16ca243ab99a2  polkit-0.120-security_fix-1.patch
"
