Magellan Linux

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

Parent Directory Parent Directory | Revision Log Revision Log


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