### this file is sourced not run
PKGVER=0.122
PKGBUILD=1
PKGARCH=x86_64

# BLFS 11.3
TARBALL=polkit-122.tar.gz
MD5SUM=bbe3e745fc5bc1a41f1b5044f09a0f26
SRC_URL=https://gitlab.freedesktop.org/polkit/polkit/-/archive/122/$TARBALL
BUNDLE=

SLACKREQ='glib duktape elogind'
SLACKDESC="
polkit: polkit $PKGVER (Authorisations library)
polkit: 
polkit: Polkit is a toolkit for defining and handling authorizations. It is 
polkit: used for allowing unprivileged processes to communicate with 
polkit: privileged processes.
polkit: 
polkit: NOTE This package is unconfigured. It is originally created to satisfy
polkit: link dependencies of third party packages. If you want to use it, you
polkit: will have to configure it yourself.
polkit: 
polkit: 
"
SLACKINSTALL='
! grep -q polkitd ./etc/passwd && echo "polkitd:x:46:46:PolicyKit Daemon Owner,,,:/etc/polkit-1:/bin/false" >> ./etc/passwd
! grep -q polkitd ./etc/group  && echo "polkitd:x:46:" >> ./etc/group
'

### default pkg_download
### default pkg_prepare
### default pkg_package
### build
pkg_build() {
	# create users - must be the same as the ones specified in SLACKINSTALL
	{	echo "cd /"
		echo "$SLACKINSTALL"
	} > /tmp/create-user &&
	sh /tmp/create-user
	
	MESONFLAGS="$MESONFLAGS \
		-Dman=true                    \
		-Dsession_tracking=libelogind \
		-Dsystemdsystemunitdir=/tmp   \
		-Dtests=false                 \
		-Djs_engine=duktape           \
		-Dauthfw=shadow               \
		-Dos_type=lfs                 \
	" &&
	pkg_build_meson &&
	pkg_build_slackdesc &&

	# multilib
	mv -v /usr/share/gir-1.0/* /usr/share/gir-1.0-64 &&
	rm -r /usr/share/gir-1.0/ &&

	# BLFS 11.3: clean up
	rm -v /tmp/*.service &&
	rm -f /etc/passwd /etc/group &&

	true
}
