Magellan Linux

Contents of /branches/magellan-next/core/systemd/systemd-33-r4.smage2

Parent Directory Parent Directory | Revision Log Revision Log


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