# Description: Framework for defining and tracking users, login sessions, and seats
# URL: http://www.freedesktop.org/wiki/Software/ConsoleKit
# Maintainer: Tim Biermann, tbier at posteo dot de
# Depends on: dbus gobject-introspection linux-pam xorg-libx11
# Optional: polkit

name=consolekit
version=1.2.6
release=1
source=(https://github.com/ConsoleKit2/ConsoleKit2/archive/$version/ConsoleKit2-$version.tar.gz
  system-session pam-foreground-compat.ck)

build() {
  cd ConsoleKit2-$version

  NOCONFIGURE=1 ./autogen.sh
  ./configure \
    --prefix=/usr \
    --sysconfdir=/etc \
    --localstatedir=/var \
    --libexecdir=/usr/lib/ConsoleKit \
    --with-xinitrc-dir=/etc/X11/xinit/xinitrc.d \
    --with-rundir=/run \
    --enable-udev-acl \
    --enable-pam-module \
    --disable-nls

  make
  make DESTDIR=$PKG install

  # http://www.linuxfromscratch.org/blfs/view/stable/postlfs/consolekit.html
  install -D -m 0644 $SRC/system-session $PKG/etc/pam.d/system-session
  install -m 0755 $SRC/pam-foreground-compat.ck $PKG/etc/ConsoleKit/run-session.d/
  mv $PKG/etc/X11/xinit/xinitrc.d/90-consolekit{,.sh}

  rm -r $PKG/etc/logrotate.d $PKG/run
}
