Mercurial > vanilla
changeset 491:9deb4fcc5475
core/consolekit2: initial import, closes #1579
author | David Demelier <markand@malikania.fr> |
---|---|
date | Sun, 07 Apr 2019 14:44:40 +0200 |
parents | dbffca6c243e |
children | a89c2ee9ff94 |
files | core/consolekit2/consolekit2.sh |
diffstat | 1 files changed, 94 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/core/consolekit2/consolekit2.sh Sun Apr 07 14:44:40 2019 +0200 @@ -0,0 +1,94 @@ +#!/bin/sh +# +# Copyright (c) 2019 David Demelier <markand@malikania.fr> +# +# Permission to use, copy, modify, and/or distribute this software for any +# purpose with or without fee is hereby granted, provided that the above +# copyright notice and this permission notice appear in all copies. +# +# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +# + +PKGNAME=consolekit2 +PKGVERSION=1.2.1 +PKGREVISION=1 +PKGLICENSE="GPLv2" +PKGSUMMARY="framework for defining and tracking user sessions" +PKGDOWNLOAD="https://github.com/ConsoleKit2/ConsoleKit2/releases/download/$PKGVERSION/ConsoleKit2-$PKGVERSION.tar.bz2" +PKGDEPENDS="core/dbus lib/glib x11/libx11" +PKGOPTIONS="PAM POLKIT SELINUX UDEV" + +: ${CHOST:=$(uname -m)-linux-musl} +: ${CBUILD:=$(uname -m)-linux-musl} +: ${CC:=clang} +: ${CFLAGS:=-O2} +: ${LDFLAGS:=} +: ${LIBS:=} +: ${PAM:=yes} +: ${POLKIT:=yes} +: ${SELINUX:=no} +: ${UDEV:=yes} + +if [ "$PAM" = "yes" ]; then + PKGDEPENDS="security/linux-pam $PKGDEPENDS" + with_pam="--enable-pam-module --with-pam-module-dir=/usr/lib/security" +else + with_pam="--disable-pam-module" +fi + +if [ "$POLKIT" = "yes" ]; then + PKGDEPENDS="security/polkit $PKGDEPENDS" + with_polkit="--enable-polkit" +else + with_polkit="--disable-polkit" +fi + +if [ "$SELINUX" = "yes" ]; then + with_selinux="--enable-libselinux" +else + with_selinux="--disable-libselinux" +fi + +if [ "$UDEV" = "yes" ]; then + PKGDEPENDS="core/eudev $PKGDEPENDS" + with_udev="--enable-libudev" +else + with_udev="--disable-libudev" +fi + +build() +{ + rm -rf ConsoleKit2-$PKGVERSION + tar xvaf ConsoleKit2-$PKGVERSION.tar.bz2 + pushd ConsoleKit2-$PKGVERSION + + CC="$CC" \ + CFLAGS="$CFLAGS" \ + LDFLAGS="$LDFLAGS" \ + LIBS="$LIBS" \ + ./configure \ + --build=$CBUILD \ + --host=$CHOST \ + --prefix=/usr \ + --sysconfdir=/etc \ + --localstatedir=/var \ + --with-pid-file=/var/run/consolekit2.pid \ + $with_pam \ + $with_polkit \ + $with_selinux \ + $with_udev + make + make install DESTDIR=$DESTDIR + rm -f $DESTDIR/usr/lib/security/pam_ck_connector.la + rm -f $DESTDIR/usr/lib/libck-connector.la + rm -f $DESTDIR/usr/lib/libconsolekit.la + + popd + rm -rf ConsoleKit2-$PKGVERSION +}