Contents of /branches/magellan-next/core/systemd/systemd-32-r1.smage2
Parent Directory | Revision Log
Revision 8818 -
(show annotations)
(download)
Mon Aug 1 13:23:14 2011 UTC (13 years, 1 month ago) by niro
File size: 5149 byte(s)
Mon Aug 1 13:23:14 2011 UTC (13 years, 1 month ago) by niro
File size: 5149 byte(s)
-fixed patch to install missing plymouth services
1 | # $Id$ |
2 | |
3 | PNAME="systemd" |
4 | PVER="32" |
5 | PBUILD="r1" |
6 | |
7 | PCATEGORIE="sys-apps" |
8 | |
9 | DESCRIPTION="System and Session Manager." |
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="y" |
15 | |
16 | DEPEND=">= sys-apps/dbus-1.4 |
17 | >= sys-fs/udev-170 |
18 | >= dev-libs/dbus-glib-0.92 |
19 | >= sys-apps/tcp-wrappers-7.6 |
20 | >= sys-libs/pam-1.1 |
21 | >= sys-libs/libcap-2.20 |
22 | >= sys-apps/util-linux-2.19 |
23 | >= sys-apps/shadow-4.1" |
24 | |
25 | if [[ ${SYSVINIT_SUPPORT} = y ]] |
26 | then |
27 | DEPEND="${DEPEND} |
28 | >= sys-apps/sysvinit-2.88" |
29 | fi |
30 | |
31 | SDEPEND=">= app-text/docbook-xsl-stylesheets-1.76 |
32 | >= x11-libs/gtk2+-2.24 |
33 | >= dev-libs/libcgroup-0.37 |
34 | >= dev-libs/libxslt-1.1.26 |
35 | >= dev-lang/vala-0.12 |
36 | >= dev-util/intltool-0.41 |
37 | >= virtual/kernel-headers |
38 | >= x11-libs/libnotify-0.7.3" |
39 | |
40 | SRCFILE="${PNAME}-${PVER}.tar.bz2" |
41 | SRCDIR="${BUILDDIR}/${PNAME}-${PVER}" |
42 | |
43 | sminclude mtools |
44 | |
45 | SRC_URI=( |
46 | http://www.freedesktop.org/software/${PNAME}/${SRCFILE} |
47 | mirror://${PNAME}/${SRCFILE} |
48 | mirror://${PNAME}/${PNAME}-32-magellan.patch |
49 | ) |
50 | |
51 | UP2DATE="updatecmd http://www.freedesktop.org/software/systemd/ | lasttarball" |
52 | |
53 | src_prepare() |
54 | { |
55 | munpack ${SRCFILE} || die |
56 | cd ${SRCDIR} |
57 | |
58 | # apply our magellan patch |
59 | mpatch ${PNAME}-32-magellan.patch || die |
60 | |
61 | # regen configure |
62 | mautoreconf || die |
63 | } |
64 | |
65 | src_compile() |
66 | { |
67 | cd ${SRCDIR} |
68 | |
69 | mconfigure \ |
70 | --with-distro=magellan \ |
71 | --libexecdir=/usr/$(mlibdir)/${PNAME} \ |
72 | --with-pamlibdir=/$(mlibdir)/security \ |
73 | --with-rootdir=/ \ |
74 | --enable-gtk \ |
75 | --enable-pam \ |
76 | --enable-tcpwrap \ |
77 | --disable-audit \ |
78 | --disable-selinux \ |
79 | || die |
80 | |
81 | mmake || die |
82 | } |
83 | |
84 | src_install() |
85 | { |
86 | cd ${SRCDIR} |
87 | mmake DESTDIR=${BINDIR} install || die |
88 | |
89 | # omit for now as pretty_print works |
90 | # # install os-release file |
91 | # cat > ${BINDIR}/etc/os-release << EOF |
92 | # NAME="Magellan Linux" |
93 | # ID=magellan |
94 | # PRETTY_NAME="Magellan Linux" |
95 | # ANSI_COLOR="1;34" |
96 | # EOF |
97 | |
98 | # keep some directories |
99 | mkeepdir /run || die |
100 | mkeepdir /etc/modules-load.d || die |
101 | |
102 | # remove tty1 from getty targets to use tty1 as systemd logger |
103 | # and to fix graphical glitches |
104 | # will be integrated in the magellan patch! |
105 | sed -i 's:getty.target.wants/getty@tty1.service\ ::' \ |
106 | ${BINDIR}/lib/systemd/system/getty@.service || die |
107 | |
108 | if [[ ${SYSVINIT_SUPPORT} != y ]] |
109 | then |
110 | echo "Include SysV init Compat symlinks" |
111 | # create SysV compatibility symlinks. systemctl/systemd are smart |
112 | # enough to detect in which way they are called. |
113 | minstalldir /sbin || die |
114 | mlink ../bin/systemd /sbin/init || die |
115 | local i |
116 | for i in reboot halt poweroff shutdown telinit runlevel |
117 | do |
118 | mlink ../bin/systemctl /sbin/${i} || die |
119 | done |
120 | else |
121 | echo "Using sysvinit package for SysV compat" |
122 | fi |
123 | |
124 | # we create all wants links manually at installation time to make sure |
125 | # they are not owned and hence overriden by rpm after the used deleted |
126 | # them. |
127 | rm -r ${BINDIR}/etc/systemd/system/*.target.wants || die |
128 | # but make sure these directories are properly owned |
129 | mkeepdir /lib/systemd/system/basic.target.wants || die |
130 | mkeepdir /lib/systemd/system/default.target.wants || die |
131 | mkeepdir /lib/systemd/system/dbus.target.wants || die |
132 | mkeepdir /lib/systemd/system/syslog.target.wants || die |
133 | |
134 | minstalldocs DISTRO_PORTING LICENSE README TODO || die |
135 | } |
136 | |
137 | preinstall() |
138 | { |
139 | # adding lock group |
140 | ${MLIBDIR}/mgroupadd -o "-g 54" lock |
141 | } |
142 | |
143 | postinstall() |
144 | { |
145 | # try to read default runlevel from the old inittab if it exists |
146 | local runlevel |
147 | runlevel=$(awk -F ':' '$3 == "initdefault" && $1 !~ "^#" { print $2 }' ${MROOT}/etc/inittab 2> /dev/null) |
148 | local target |
149 | if [[ -z ${runlevel} ]] |
150 | then |
151 | target="/lib/systemd/system/graphical.target" |
152 | else |
153 | target="/lib/systemd/system/runlevel${runlevel}.target" |
154 | fi |
155 | # and symlink what we found to the new-style default.target |
156 | ln -snf ${target} ${MROOT}/etc/systemd/system/default.target |
157 | |
158 | # convert modules.autoload |
159 | if [ -f ${MROOT}/etc/modules.autoload ] |
160 | then |
161 | local modules |
162 | # get only lines which are not commented or empty; |
163 | # if we get any items than the modules.autoload is in use |
164 | modules=$(sed -e '/^#/d' -e '/^$/d' ${MROOT}/etc/modules.autoload) |
165 | if [[ ! -z ${modules} ]] |
166 | then |
167 | [ ! -d ${MROOT}/etc/modules-load.d ] && install -d ${MROOT}/etc/modules-load.d |
168 | echo -e "# Converted by systemd install from /etc/modules.autoload\n#\n#" \ |
169 | > ${MROOT}/etc/modules-load.d/modules.autoload.conf |
170 | cat ${MROOT}/etc/modules.autoload \ |
171 | >> ${MROOT}/etc/modules-load.d/modules.autoload.conf |
172 | fi |
173 | fi |
174 | |
175 | # check mtab, and replace with a symlink if required |
176 | if [[ ! -L ${MROOT}/etc/mtab ]] || \ |
177 | [[ $(readlink ${MROOT}/etc/mtab) != /proc/self/mounts ]] |
178 | then |
179 | ln -snf /proc/self/mounts ${MROOT}/etc/mtab |
180 | fi |
181 | |
182 | if [[ -z ${MROOT} ]] || [[ ${MROOT} = / ]] |
183 | then |
184 | # create machine-id |
185 | if [ ! -f /etc/machine-id ] |
186 | then |
187 | systemd-machine-id-setup |
188 | fi |
189 | |
190 | # restart systemd daemon |
191 | systemctl daemon-reexec |
192 | |
193 | # enable the services we install by default. |
194 | systemctl enable \ |
195 | getty@.service \ |
196 | remote-fs.target \ |
197 | systemd-readahead-replay.service \ |
198 | systemd-readahead-collect.service |
199 | fi |
200 | |
201 | echo |
202 | echo "systemd has been installed to /bin/systemd. Please ensure you append" |
203 | echo "init=/bin/systemd to your kernel command line in your bootloader." |
204 | echo |
205 | } |