Magellan Linux

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

Parent Directory Parent Directory | Revision Log Revision Log


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