-
Notifications
You must be signed in to change notification settings - Fork 0
/
ConsoleKit.build
executable file
·165 lines (128 loc) · 3.97 KB
/
ConsoleKit.build
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
#!/bin/bash
#
. build_funcs
TARNAME=ConsoleKit2
TARNAMEEXTRA=
TARSEP="-"
TARDIR=${SOURCE}/c
#TAR_EXT=.tar.gz
VERSION=1.2.1
VERSIONEXTRA=
BUILD=6
WEBPAGE="https://github.com/ConsoleKit2/ConsoleKit2"
#WEBPAGE="http://www.freedesktop.org/wiki/Software/ConsoleKit"
#TAR_PROG=
#TAR_OPTS=
#PKGNAME=ConsoleKit
#PKGVERSION=
#BUILD_SUFFIX=
#ARCH=noarch
FULL_TARNAME=${TARDIR}/${TARNAME}${TARNAMEEXTRA}${TARSEP}${VERSION}${VERSIONEXTRA}${TAR_EXT}
pre_unpack
PKG=/tmp/package-${PKGNAME}
if [ ! -f ${FULL_TARNAME} ]
then
echo Can\'t find ${FULL_TARNAME}
exit
fi
if [ ! -d ${TARNAME}-${VERSION} ]
then
${TAR_PROG} ${TAR_OPTS} ${FULL_TARNAME}
#mv ${TARNAME}-${VERSION} ${TARNAME}-${VERSION}
if [ ! -d ${TARNAME}-${VERSION} ]
then
echo "${TARNAME}-${VERSION} directory not found"
exit
fi
(cd ${TARNAME}-${VERSION}
#patch -p1 < ${CWD}/consolekit-0.2.10-cleanup_console_tags.patch
#patch -p1 < ${CWD}/consolekit-0.4.2-revert.patch
# patch -p1 < ${CWD}/ConsoleKit-0001-Revert-Minor-code-refactoring.patch
# patch -p1 < ${CWD}/ConsoleKit-0002-Fix-some-libdir-scripts-stuff-missed-in-4d87a25ea0af.patch
# patch -p1 < ${CWD}/ConsoleKit-0003-Filter-out-the-kdm-user.patch
# patch -p1 < ${CWD}/ConsoleKit-0004-Apply-overlooked-prefix-lib-libdir-substitution.patch
patch -p1 < ${CWD}/ConsoleKit2-fix-is-local.diff
patch -p1 < ${CWD}/ConsoleKit2-crash_fix.diff
# Apply a reasonable maximum size for the user's XDG_RUNTIME_DIR:
sed -i "s/mode=0700,uid=%d/mode=0700,$XDG_RUNTIME_QUOTA,uid=%d/g" src/ck-sysdeps-linux.c
if [ ! -e ./configure ]
then
./autogen.sh
fi
)
fi
pre_configure
cd ${TARNAME}-${VERSION}
fix_perms
# Choose correct options depending on whether PAM is installed:
if [ -L /lib${LIBDIRSUFFIX}/libpam.so.? ]; then
PAM_OPTIONS="--enable-pam-module=yes --with-pam-module-dir=/lib${LIBDIRSUFFIX}/security --disable-libcgmanager"
unset SHADOW_OPTIONS
else
unset PAM_OPTIONS
SHADOW_OPTIONS="--enable-pam-module=no"
fi
if [ ${DO_CONFIGURE} == "yes" ]
then
CFLAGS="${SLKCFLAGS} -g" \
CXXFLAGS="${SLKCFLAGS} -g" \
LDFLAGS="-g" \
./configure --prefix=/usr \
--sysconfdir=/etc \
--libdir=/usr/lib${LIBDIRSUFFIX} \
--localstatedir=/var \
--mandir=/usr/man \
--docdir=/usr/doc/${TARNAME}-${VERSION} \
--with-rundir=/var/run \
--with-pid-file=/var/run/ConsoleKit/pid \
--enable-docbook-docs \
--disable-static \
--enable-udev-acl \
--enable-debug=minimum \
--enable-tests \
$PAM_OPTIONS \
$SHADOW_OPTIONS \
--enable-polkit \
--disable-static
fi
if [ ${DO_MAKE} == "yes" ]
then
make ${NUM_JOBS} || exit
fi
if [ ${DO_INSTALL} != "yes" ]
then
exit
fi
make install DESTDIR=${PKG}
mkdir -p $PKG/usr/lib${LIBDIRSUFFIX}/ConsoleKit/run-session.d
cat $CWD/ConsoleKit-pam-foreground-compat.ck > \
$PKG/usr/lib${LIBDIRSUFFIX}/ConsoleKit/run-session.d/pam-foreground-compat.ck
chmod 0755 $PKG/usr/lib${LIBDIRSUFFIX}/ConsoleKit/run-session.d/pam-foreground-compat.ck
# Let's not clobber config files
mv $PKG/etc/ConsoleKit/seats.d/00-primary.seat \
$PKG/etc/ConsoleKit/seats.d/00-primary.seat.new
doinst_config etc/ConsoleKit/seats.d/00-primary.seat.new
# Add an init script
mkdir -p $PKG/etc/rc.d
cat $CWD/ConsoleKit-rc.consolekit > $PKG/etc/rc.d/rc.consolekit.new
chmod 0755 $PKG/etc/rc.d/rc.consolekit.new
doinst_config etc/rc.d/rc.consolekit.new
#strip_binaries
fix_links
compress_manpages
compress_info
cp -a \
AUTHORS COPYING* INSTALL NEWS PLANS README* TODO \
${PKG}/usr/doc/${TARNAME}-${VERSION}
fix_docs
#-----handy-ruler-for-slack-desc-width-------------------------------|
make_slack_desc << EOF "users, sessions and seats tracking framework"
ConsoleKit provides a D-Bus API for programs to obtain information
about the users, sessions, and seats that are present on a system.
EOF
post_install
cd ${PKG}
su -c "chown -R root:root ${PKG}; \
find . -type d -exec chmod 755 {} \; ; \
makepkg -l y -c n ${PKGDIR}${PKGNAME}-${PKGVERSION}-${ARCH}-${BUILD}${BUILD_SUFFIX}.tgz; \
chown -R ${USERNAME}:${GROUP} ${PKG}"