Magellan Linux

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

Parent Directory Parent Directory | Revision Log Revision Log


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