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