Magellan Linux

Contents of /branches/magellan-next/core/systemd/systemd-30-r1.smage2

Parent Directory Parent Directory | Revision Log Revision Log


Revision 8417 - (show annotations) (download)
Mon Jul 18 17:43:02 2011 UTC (12 years, 9 months ago) by niro
File size: 5123 byte(s)
auto added: ver bump to 30-r1
1 # $Id$
2
3 PNAME="systemd"
4 PVER="30"
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 >= 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}-30-magellan.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}-30-magellan.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 be 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 # convert modules.autoload
158 if [ -f ${MROOT}/etc/modules.autoload ]
159 then
160 local modules
161 # get only lines which are not commented or empty;
162 # if we get any items than the modules.autoload is in use
163 modules=$(sed -e '/^#/d' -e '/^$/d' ${MROOT}/etc/modules.autoload)
164 if [[ ! -z ${modules} ]]
165 then
166 [ ! -d ${MROOT}/etc/modules-load.d ] && install -d ${MROOT}/etc/modules-load.d
167 echo -e "# Converted by systemd install from /etc/modules.autoload\n#\n#" \
168 > ${MROOT}/etc/modules-load.d/modules.autoload.conf
169 cat ${MROOT}/etc/modules.autoload \
170 >> ${MROOT}/etc/modules-load.d/modules.autoload.conf
171 fi
172 fi
173
174 # check mtab, and replace with a symlink if requiered
175 if [[ ! -L ${MROOT}/etc/mtab ]] || \
176 [[ $(readlink ${MROOT}/etc/mtab) != /proc/self/mounts ]]
177 then
178 ln -snf /proc/self/mounts ${MROOT}/etc/mtab
179 fi
180
181 if [[ -z ${MROOT} ]] || [[ ${MROOT} = / ]]
182 then
183 # create machine-id
184 if [ ! -f /etc/machine-id ]
185 then
186 systemd-machine-id-setup
187 fi
188
189 # restart systemd daemon
190 systemctl daemon-reexec
191
192 # enable the services we install by default.
193 systemctl enable \
194 getty@.service \
195 remote-fs.target \
196 systemd-readahead-replay.service \
197 systemd-readahead-collect.service
198 fi
199
200 echo
201 echo "systemd has been installed to /bin/systemd. Please ensure you append"
202 echo "init=/bin/systemd to your kernel command line in your bootloader."
203 echo
204 }