Magellan Linux

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 10887 - (show annotations) (download)
Sat Feb 4 13:58:25 2012 UTC (12 years, 4 months ago) by niro
File size: 7077 byte(s)
-enable gtk tools
1 # $Id$
2
3 PNAME="systemd"
4 PVER="39"
5 PBUILD="r1"
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=1
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
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 cd ${SRCDIR}
94
95 # apply our magellan patch
96 mpatch ${PNAME}-38-magellan.patch || die
97
98 # magellan-only: use a configurable getty
99 mpatch ${PNAME}-38-magellan-configurable-getty.patch || die
100
101 # regen configure
102 mautoreconf || die
103 }
104
105 src_compile()
106 {
107 cd ${SRCDIR}
108
109 mconfigure \
110 --with-distro=magellan \
111 --libexecdir=/usr/$(mlibdir)/${PNAME} \
112 --with-pamlibdir=/$(mlibdir)/security \
113 --with-rootdir=/ \
114 --disable-gtk \
115 --enable-pam \
116 --enable-tcpwrap \
117 --enable-xz \
118 --enable-acl \
119 --enable-libcryptsetup \
120 --enable-plymouth \
121 --disable-audit \
122 --disable-selinux \
123 || die
124
125 mmake || die
126 }
127
128 src_install_systemd()
129 {
130 cd ${SRCDIR}
131 mmake DESTDIR=${BINDIR} install || die
132
133 # omit for now as pretty_print works
134 # # install os-release file
135 # cat > ${BINDIR}/etc/os-release << EOF
136 # NAME="Magellan Linux"
137 # ID=magellan
138 # PRETTY_NAME="Magellan Linux"
139 # ANSI_COLOR="1;34"
140 # EOF
141
142 # keep some directories
143 mkeepdir /run || die
144 mkeepdir /etc/modules-load.d || die
145
146 if [[ ${SYSVINIT_SUPPORT} != 1 ]]
147 then
148 echo "Include SysV init Compat symlinks"
149 # create SysV compatibility symlinks. systemctl/systemd are smart
150 # enough to detect in which way they are called.
151 minstalldir /sbin || die
152 mlink ../bin/systemd /sbin/init || die
153 local i
154 for i in reboot halt poweroff shutdown telinit runlevel
155 do
156 mlink ../bin/systemctl /sbin/${i} || die
157 done
158 else
159 echo "Using sysvinit package for SysV compat"
160 fi
161
162 # we create all wants links manually at installation time to make sure
163 # they are not owned and hence overriden by mage after the user deleted
164 # them.
165 rm -r ${BINDIR}/etc/systemd/system/*.target.wants || die
166 # but make sure these directories are properly owned
167 mkeepdir /lib/systemd/system/basic.target.wants || die
168 mkeepdir /lib/systemd/system/default.target.wants || die
169 mkeepdir /lib/systemd/system/dbus.target.wants || die
170 mkeepdir /lib/systemd/system/syslog.target.wants || die
171
172 # login-manager pam policy - force register kdm, gdm etc with pam_systemd
173 minstallpam login-manager.pamd login-manager || die
174
175 minstalldocs DISTRO_PORTING LICENSE README TODO || die
176
177 # remove files which are owned by other packages
178 if [[ ${ENABLE_GTK} = 1 ]]
179 then
180 rm ${BINDIR}/usr/bin/systemadm || die
181 rm ${BINDIR}/usr/bin/systemd-gnome-ask-password-agent || die
182 rm ${BINDIR}/usr/share/man/man1/systemadm.* || die
183 fi
184 rm ${BINDIR}/usr/bin/systemd-analyze || die
185 }
186
187 src_install_systemd-tools()
188 {
189 cd ${SRCDIR}
190 if [[ ${ENABLE_GTK} = 1 ]]
191 then
192 minstallexec systemadm || die
193 minstallexec systemd-gnome-ask-password-agent || die
194 minstallman man/systemadm.1 || die
195 fi
196 minstallexec src/systemd-analyze || die
197 }
198
199 preinstall_systemd()
200 {
201 # if [[ ${SYSVINIT_SUPPORT} = 1 ]]
202 # then
203 # if [[ ! -z $(magequery -n sysvinit) ]]
204 # then
205 # echo -e ${COLRED}
206 # echo -e "Error: sys-apps/sysvinit is installed!!"
207 # echo -e "sysvinit is now replaced by systemd which is the new default init system."
208 # echo -e "Please uninstall sys-apps/sysvinit first!"
209 # echo -e ${COLDEFAULT}
210 # die "sys-apps/sysvinit found!"
211 # fi
212 # fi
213
214 # adding lock group
215 ${MLIBDIR}/mgroupadd -o "-g 54" lock
216 }
217
218 postinstall_systemd()
219 {
220 # try to read default runlevel from the old inittab if it exists
221 local runlevel
222 runlevel=$(awk -F ':' '$3 == "initdefault" && $1 !~ "^#" { print $2 }' ${MROOT}/etc/inittab 2> /dev/null)
223 local target
224 if [[ -z ${runlevel} ]]
225 then
226 target="/lib/systemd/system/graphical.target"
227 else
228 target="/lib/systemd/system/runlevel${runlevel}.target"
229 fi
230 # and symlink what we found to the new-style default.target
231 ln -snf ${target} ${MROOT}/etc/systemd/system/default.target
232
233 # convert modules.autoload
234 if [ -f ${MROOT}/etc/modules.autoload ]
235 then
236 local modules
237 # get only lines which are not commented or empty;
238 # if we get any items than the modules.autoload is in use
239 modules=$(sed -e '/^#/d' -e '/^$/d' ${MROOT}/etc/modules.autoload)
240 if [[ ! -z ${modules} ]]
241 then
242 [ ! -d ${MROOT}/etc/modules-load.d ] && install -d ${MROOT}/etc/modules-load.d
243 echo -e "# Converted by systemd install from /etc/modules.autoload\n#\n#" \
244 > ${MROOT}/etc/modules-load.d/modules.autoload.conf
245 cat ${MROOT}/etc/modules.autoload \
246 >> ${MROOT}/etc/modules-load.d/modules.autoload.conf
247 fi
248 fi
249
250 # check mtab, and replace with a symlink if required
251 if [[ ! -L ${MROOT}/etc/mtab ]] || \
252 [[ $(readlink ${MROOT}/etc/mtab) != /proc/self/mounts ]]
253 then
254 ln -snf /proc/self/mounts ${MROOT}/etc/mtab
255 fi
256
257 if [[ -z ${MROOT} ]] || [[ ${MROOT} = / ]]
258 then
259 # create machine-id
260 if [ ! -f /etc/machine-id ]
261 then
262 systemd-machine-id-setup
263 fi
264
265 # restart systemd daemon
266 systemctl daemon-reexec
267
268 # restart systemd-logind daemon
269 systemctl try-restart systemd-logind.service
270
271 # enable the services we install by default.
272 systemctl enable \
273 getty@.service \
274 remote-fs.target \
275 systemd-readahead-replay.service \
276 systemd-readahead-collect.service
277 fi
278
279 echo
280 echo "systemd has been installed to /bin/systemd. Please ensure you append"
281 echo "init=/bin/systemd to your kernel command line in your bootloader."
282 echo
283 }