Mercurial > vanilla
comparison core/consolekit2/consolekit2.sh @ 491:9deb4fcc5475
core/consolekit2: initial import, closes #1579
author | David Demelier <markand@malikania.fr> |
---|---|
date | Sun, 07 Apr 2019 14:44:40 +0200 |
parents | |
children | 014d018468fb |
comparison
equal
deleted
inserted
replaced
490:dbffca6c243e | 491:9deb4fcc5475 |
---|---|
1 #!/bin/sh | |
2 # | |
3 # Copyright (c) 2019 David Demelier <markand@malikania.fr> | |
4 # | |
5 # Permission to use, copy, modify, and/or distribute this software for any | |
6 # purpose with or without fee is hereby granted, provided that the above | |
7 # copyright notice and this permission notice appear in all copies. | |
8 # | |
9 # THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES | |
10 # WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF | |
11 # MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR | |
12 # ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES | |
13 # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN | |
14 # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF | |
15 # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | |
16 # | |
17 | |
18 PKGNAME=consolekit2 | |
19 PKGVERSION=1.2.1 | |
20 PKGREVISION=1 | |
21 PKGLICENSE="GPLv2" | |
22 PKGSUMMARY="framework for defining and tracking user sessions" | |
23 PKGDOWNLOAD="https://github.com/ConsoleKit2/ConsoleKit2/releases/download/$PKGVERSION/ConsoleKit2-$PKGVERSION.tar.bz2" | |
24 PKGDEPENDS="core/dbus lib/glib x11/libx11" | |
25 PKGOPTIONS="PAM POLKIT SELINUX UDEV" | |
26 | |
27 : ${CHOST:=$(uname -m)-linux-musl} | |
28 : ${CBUILD:=$(uname -m)-linux-musl} | |
29 : ${CC:=clang} | |
30 : ${CFLAGS:=-O2} | |
31 : ${LDFLAGS:=} | |
32 : ${LIBS:=} | |
33 : ${PAM:=yes} | |
34 : ${POLKIT:=yes} | |
35 : ${SELINUX:=no} | |
36 : ${UDEV:=yes} | |
37 | |
38 if [ "$PAM" = "yes" ]; then | |
39 PKGDEPENDS="security/linux-pam $PKGDEPENDS" | |
40 with_pam="--enable-pam-module --with-pam-module-dir=/usr/lib/security" | |
41 else | |
42 with_pam="--disable-pam-module" | |
43 fi | |
44 | |
45 if [ "$POLKIT" = "yes" ]; then | |
46 PKGDEPENDS="security/polkit $PKGDEPENDS" | |
47 with_polkit="--enable-polkit" | |
48 else | |
49 with_polkit="--disable-polkit" | |
50 fi | |
51 | |
52 if [ "$SELINUX" = "yes" ]; then | |
53 with_selinux="--enable-libselinux" | |
54 else | |
55 with_selinux="--disable-libselinux" | |
56 fi | |
57 | |
58 if [ "$UDEV" = "yes" ]; then | |
59 PKGDEPENDS="core/eudev $PKGDEPENDS" | |
60 with_udev="--enable-libudev" | |
61 else | |
62 with_udev="--disable-libudev" | |
63 fi | |
64 | |
65 build() | |
66 { | |
67 rm -rf ConsoleKit2-$PKGVERSION | |
68 tar xvaf ConsoleKit2-$PKGVERSION.tar.bz2 | |
69 pushd ConsoleKit2-$PKGVERSION | |
70 | |
71 CC="$CC" \ | |
72 CFLAGS="$CFLAGS" \ | |
73 LDFLAGS="$LDFLAGS" \ | |
74 LIBS="$LIBS" \ | |
75 ./configure \ | |
76 --build=$CBUILD \ | |
77 --host=$CHOST \ | |
78 --prefix=/usr \ | |
79 --sysconfdir=/etc \ | |
80 --localstatedir=/var \ | |
81 --with-pid-file=/var/run/consolekit2.pid \ | |
82 $with_pam \ | |
83 $with_polkit \ | |
84 $with_selinux \ | |
85 $with_udev | |
86 make | |
87 make install DESTDIR=$DESTDIR | |
88 rm -f $DESTDIR/usr/lib/security/pam_ck_connector.la | |
89 rm -f $DESTDIR/usr/lib/libck-connector.la | |
90 rm -f $DESTDIR/usr/lib/libconsolekit.la | |
91 | |
92 popd | |
93 rm -rf ConsoleKit2-$PKGVERSION | |
94 } |