Magellan Linux

Contents of /trunk/core/systemd/systemd-39-r4.smage2

Parent Directory Parent Directory | Revision Log Revision Log


Revision 11066 - (show annotations) (download)
Thu Feb 16 10:03:24 2012 UTC (12 years, 7 months ago) by niro
File size: 7118 byte(s)
-install files for all multilib abis
1 # $Id$
2
3 PNAME="systemd"
4 PVER="39"
5 PBUILD="r4"
6
7 SPLIT_PACKAGES="systemd systemd-tools"
8
9 PCAT="sys-apps"
10 HOMEPAGE="http://www.freedesktop.org/wiki/Software/systemd"
11
12 # enable sysvinit support atm for compatibility reasons
13 # 1=yes, 0=no
14 SYSVINIT_SUPPORT=0
15
16 # disable gtk until build with libgee is fixed
17 # 1=yes, 0=no
18 ENABLE_GTK=0
19
20 COMMON_DEPEND=">= sys-apps/dbus-1.5
21 >= sys-fs/udev-172
22 >= sys-fs/cryptsetup-1.4
23 >= dev-libs/dbus-glib-0.98
24 >= dev-libs/libgee-0.7
25 >= net-dns/nss-myhostname-0.3
26 >= app-arch/xz-utils-5
27 >= sys-apps/acl-2.2
28 >= sys-apps/tcp-wrappers-7.6
29 >= sys-libs/pam-1.1
30 >= sys-libs/libcap-2.20
31 >= sys-apps/util-linux-2.20
32 >= sys-apps/shadow-4.1
33 >= sys-apps/sysvinit-tools-2.88"
34
35 TOOLS_DEPEND=">= dev-python/dbus-python-0.84
36 >= sys-apps/polkit-0.102"
37
38 if [[ ${ENABLE_GTK} = 1 ]]
39 then
40 TOOLS_DEPEND="${TOOLS_DEPEND}
41 >= x11-libs/gtk2+-2.24"
42 fi
43
44 if [[ ${SYSVINIT_SUPPORT} = 1 ]]
45 then
46 DEPEND="${DEPEND}
47 >= sys-apps/sysvinit-2.88"
48 fi
49
50 SDEPEND=">= app-text/docbook-xsl-stylesheets-1.76
51 >= dev-libs/libcgroup-0.37
52 >= dev-libs/libxslt-1.1.26
53 >= dev-lang/vala-0.12
54 >= dev-util/intltool-0.41
55 >= dev-util/gperf-3
56 >= virtual/kernel-headers
57 >= x11-libs/libnotify-0.7.3"
58
59 SRCFILE="${PNAME}-${PVER}.tar.xz"
60 SRCDIR="${BUILDDIR}/${PNAME}-${PVER}"
61
62 sminclude mtools multilib
63
64 SRC_URI=(
65 http://www.freedesktop.org/software/${PNAME}/${SRCFILE}
66 mirror://${PNAME}/${SRCFILE}
67 mirror://${PNAME}/${PNAME}-38-magellan.patch
68 mirror://${PNAME}/${PNAME}-38-magellan-configurable-getty.patch
69 mirror://${PNAME}/login-manager.pamd
70 )
71
72 UP2DATE="updatecmd http://www.freedesktop.org/software/systemd/ | lasttarball xz"
73
74 split_info_systemd()
75 {
76 DESCRIPTION="System and Session Manager."
77 DEPEND="${COMMON_DEPEND}"
78 }
79
80 split_info_systemd-tools()
81 {
82 local gtkdesc
83 [[ ${ENABLE_GTK} = 1 ]] && gtkdesc="for gtk2/gnome and "
84
85 DESCRIPTION="Systemd utilites ${gtkdesc}for analysing the boot process."
86 DEPEND="== sys-apps/systemd-${PVER}
87 ${TOOLS_DEPEND}"
88 }
89
90 src_prepare()
91 {
92 munpack ${SRCFILE} || die
93
94 # apply our magellan patch
95 mpatch ${PNAME}-38-magellan.patch || die
96
97 # magellan-only: use a configurable getty
98 mpatch ${PNAME}-38-magellan-configurable-getty.patch || die
99
100 # regen configure
101 mautoreconf || die
102 }
103
104 src_compile()
105 {
106 mconfigure \
107 --with-distro=magellan \
108 --libexecdir=/usr/'$(mlibdir)'/${PNAME} \
109 --with-pamlibdir=/'$(mlibdir)'/security \
110 --with-rootdir=/ \
111 --disable-gtk \
112 --enable-pam \
113 --enable-tcpwrap \
114 --enable-xz \
115 --enable-acl \
116 --enable-libcryptsetup \
117 --enable-plymouth \
118 --disable-audit \
119 --disable-selinux \
120 || die
121
122 mmake || die
123 }
124
125 src_install_systemd()
126 {
127 mmake DESTDIR=${BINDIR} install || die
128
129 # omit for now as pretty_print works
130 # # install os-release file
131 # cat > ${BINDIR}/etc/os-release << EOF
132 # NAME="Magellan Linux"
133 # ID=magellan
134 # PRETTY_NAME="Magellan Linux"
135 # ANSI_COLOR="1;34"
136 # EOF
137
138 # keep some directories
139 mkeepdir /run || die
140 mkeepdir /etc/modules-load.d || die
141
142 if [[ ${SYSVINIT_SUPPORT} != 1 ]]
143 then
144 echo "Include SysV init Compat symlinks"
145 # create SysV compatibility symlinks. systemctl/systemd are smart
146 # enough to detect in which way they are called.
147 minstalldir /sbin || die
148 mlink ../usr/bin/systemd /sbin/init || die
149 local i
150 for i in reboot halt poweroff shutdown telinit runlevel
151 do
152 mlink ../usr/bin/systemctl /sbin/${i} || die
153 done
154 else
155 echo "Using sysvinit package for SysV compat"
156 fi
157
158 # we create all wants links manually at installation time to make sure
159 # they are not owned and hence overriden by mage after the user deleted
160 # them.
161 rm -r ${BINDIR}/etc/systemd/system/*.target.wants || die
162 # but make sure these directories are properly owned
163 mkeepdir /usr/lib/systemd/system/basic.target.wants || die
164 mkeepdir /usr/lib/systemd/system/default.target.wants || die
165 mkeepdir /usr/lib/systemd/system/dbus.target.wants || die
166 mkeepdir /usr/lib/systemd/system/syslog.target.wants || die
167
168 # login-manager pam policy - force register kdm, gdm etc with pam_systemd
169 all-abis minstallpam login-manager.pamd login-manager || die
170
171 minstalldocs DISTRO_PORTING LICENSE README TODO || die
172
173 # remove files which are owned by other packages
174 if [[ ${ENABLE_GTK} = 1 ]]
175 then
176 rm ${BINDIR}/usr/bin/systemadm || die
177 rm ${BINDIR}/usr/bin/systemd-gnome-ask-password-agent || die
178 rm ${BINDIR}/usr/share/man/man1/systemadm.* || die
179 fi
180 rm ${BINDIR}/usr/bin/systemd-analyze || die
181 }
182
183 src_install_systemd-tools()
184 {
185 if [[ ${ENABLE_GTK} = 1 ]]
186 then
187 all-abis minstallexec systemadm || die
188 all-abis minstallexec systemd-gnome-ask-password-agent || die
189 all-abis minstallman man/systemadm.1 || die
190 fi
191 all-abis minstallexec src/systemd-analyze || die
192 }
193
194 preinstall_systemd()
195 {
196 # if [[ ${SYSVINIT_SUPPORT} = 1 ]]
197 # then
198 # if [[ ! -z $(magequery -n sysvinit) ]]
199 # then
200 # echo -e ${COLRED}
201 # echo -e "Error: sys-apps/sysvinit is installed!!"
202 # echo -e "sysvinit is now replaced by systemd which is the new default init system."
203 # echo -e "Please uninstall sys-apps/sysvinit first!"
204 # echo -e ${COLDEFAULT}
205 # die "sys-apps/sysvinit found!"
206 # fi
207 # fi
208
209 # adding lock group
210 ${MLIBDIR}/mgroupadd -o "-g 54" lock
211 }
212
213 postinstall_systemd()
214 {
215 # try to read default runlevel from the old inittab if it exists
216 local runlevel
217 runlevel=$(awk -F ':' '$3 == "initdefault" && $1 !~ "^#" { print $2 }' ${MROOT}/etc/inittab 2> /dev/null)
218 local target
219 if [[ -z ${runlevel} ]]
220 then
221 target="/usr/lib/systemd/system/graphical.target"
222 else
223 target="/usr/lib/systemd/system/runlevel${runlevel}.target"
224 fi
225 # and symlink what we found to the new-style default.target
226 ln -snf ${target} ${MROOT}/etc/systemd/system/default.target
227
228 # convert modules.autoload
229 if [ -f ${MROOT}/etc/modules.autoload ]
230 then
231 local modules
232 # get only lines which are not commented or empty;
233 # if we get any items than the modules.autoload is in use
234 modules=$(sed -e '/^#/d' -e '/^$/d' ${MROOT}/etc/modules.autoload)
235 if [[ ! -z ${modules} ]]
236 then
237 [ ! -d ${MROOT}/etc/modules-load.d ] && install -d ${MROOT}/etc/modules-load.d
238 echo -e "# Converted by systemd install from /etc/modules.autoload\n#\n#" \
239 > ${MROOT}/etc/modules-load.d/modules.autoload.conf
240 cat ${MROOT}/etc/modules.autoload \
241 >> ${MROOT}/etc/modules-load.d/modules.autoload.conf
242 fi
243 fi
244
245 # check mtab, and replace with a symlink if required
246 if [[ ! -L ${MROOT}/etc/mtab ]] || \
247 [[ $(readlink ${MROOT}/etc/mtab) != /proc/self/mounts ]]
248 then
249 ln -snf /proc/self/mounts ${MROOT}/etc/mtab
250 fi
251
252 if [[ -z ${MROOT} ]] || [[ ${MROOT} = / ]]
253 then
254 # create machine-id
255 if [ ! -f /etc/machine-id ]
256 then
257 systemd-machine-id-setup
258 fi
259
260 # restart systemd daemon
261 systemctl daemon-reexec
262
263 # restart systemd-logind daemon
264 systemctl try-restart systemd-logind.service
265
266 # enable the services we install by default.
267 systemctl enable \
268 getty@.service \
269 remote-fs.target \
270 systemd-readahead-replay.service \
271 systemd-readahead-collect.service
272 fi
273
274 echo
275 echo "systemd has been installed to /usr/bin/systemd. Please ensure you append"
276 echo "init=/usr/bin/systemd to your kernel command line in your bootloader."
277 echo
278 }