# Description: Kullanıcı tanımlama ve izleme, oturumlar girişi ve aktif oturumların çerçevesi
# URL: https://github.com/ConsoleKit2/ConsoleKit2
# Packager: milisarge
# Depends on: acl dbus glib xorg-libx11 polkit eudev pam zlib xmlto

name=consolekit2
version=1.0.0
release=2
source=(https://github.com/Consolekit2/ConsoleKit2/releases/download/$version/ConsoleKit2-$version.tar.bz2
        consolekit2.tmpfiles.conf
	75-consolekit2.rules
	consolekit2.logrotate)

build() {
cd ConsoleKit2-$version

./configure                    \
	--prefix=/usr          \
	--sysconfdir=/etc      \
	--sbindir=/usr/bin     \
	--with-rundir=/run     \
	--libexecdir=/usr/lib/ConsoleKit \
	--localstatedir=/var   \
	--enable-polkit        \
	--enable-pam-module    \
	--enable-udev-acl      \
	--enable-docbook-docs  \
	--with-dbus-services=/usr/share/dbus-1/services \
	--with-xinitrc-dir=/etc/X11/xinit/xinitrc.d     \
	--without-systemdsystemunitdir

make
make DESTDIR=$PKG install

install -Dm644 $SRC/consolekit2.tmpfiles.conf $PKG/usr/lib/tmpfiles.d/consolekit.conf

rm -rf $PKG/run

install -D -m644 $SRC/consolekit2.logrotate $PKG/etc/logrotate.d/consolekit

install -dm700 -o polkitd $PKG/usr/share/polkit-1/rules.d
install -m644 $SRC/75-consolekit2.rules $PKG/usr/share/polkit-1/rules.d/75-consolekit.rules

install -dm755 $PKG/etc/pam.d/
cat >> $PKG/etc/pam.d/consolekit << "EOF"
auth            include         system-login
account         include         system-login
session         include         system-login
password        include         system-login
session         optional        pam_ck_connector.so nox11
EOF
}
