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