Magellan Linux

Contents of /branches/magellan-next/core/systemd/systemd-28-r2.smage2

Parent Directory Parent Directory | Revision Log Revision Log


Revision 7871 - (show annotations) (download)
Thu Jun 2 19:45:33 2011 UTC (12 years, 11 months ago) by niro
File size: 4239 byte(s)
-fixed missing include
1 # $Id$
2
3 PNAME="systemd"
4 PVER="28"
5 PBUILD="r2"
6
7 PCATEGORIE="sys-apps"
8 STATE="unstable"
9
10 DESCRIPTION="System and Session Manager."
11 HOMEPAGE="http://www.freedesktop.org/wiki/Software/systemd"
12
13 # enable sysvinit support atm for compatibility reasons
14 # y=yes, n=no
15 SYSVINIT_SUPPORT="y"
16
17 DEPEND=">= sys-apps/dbus-1.4
18 >= sys-fs/udev-170
19 >= dev-libs/dbus-glib-0.92
20 >= sys-apps/tcp-wrappers-7.6
21 >= sys-libs/pam-1.1
22 >= sys-libs/libcap-2.20
23 >= sys-apps/util-linux-2.19"
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}-${PVER}-magellan-2.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}-${PVER}-magellan-2.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 # install os-release file
89 cat > ${BINDIR}/etc/os-release << EOF
90 NAME="Magellan Linux"
91 ID=magellan
92 PRETTY_NAME="Magellan Linux"
93 ANSI_COLOR="1;34"
94 EOF
95
96 # keep some directories
97 mkeepdir /run || die
98 mkeepdir /etc/modules-load.d || die
99
100 # remove tty1 from getty targets to use tty1 as systemd logger
101 # and to fix graphical glitches
102 # will by integrated in the magellan patch!
103 sed -i 's:getty.target.wants/getty@tty1.service\ ::' \
104 ${BINDIR}/lib/systemd/system/getty@.service || die
105
106 if [[ ${SYSVINIT_SUPPORT} != y ]]
107 then
108 echo "Include SysV init Compat symlinks"
109 # create SysV compatibility symlinks. systemctl/systemd are smart
110 # enough to detect in which way they are called.
111 minstalldir /sbin || die
112 mlink ../bin/systemd /sbin/init || die
113 local i
114 for i in reboot halt poweroff shutdown telinit runlevel
115 do
116 mlink ../bin/systemctl /sbin/${i} || die
117 done
118 else
119 echo "Using sysvinit package for SysV compat"
120 fi
121
122 # we create all wants links manually at installation time to make sure
123 # they are not owned and hence overriden by rpm after the used deleted
124 # them.
125 rm -r ${BINDIR}/etc/systemd/system/*.target.wants || die
126 # but make sure these directories are properly owned
127 mkeepdir /lib/systemd/system/basic.target.wants || die
128 mkeepdir /lib/systemd/system/default.target.wants || die
129 mkeepdir /lib/systemd/system/dbus.target.wants || die
130 mkeepdir /lib/systemd/system/syslog.target.wants || die
131
132 minstalldocs DISTRO_PORTING LICENSE README TODO || die
133 }
134
135 preinstall()
136 {
137 # adding lock group
138 ${MLIBDIR}/mgroupadd -o "-g 54" lock
139 }
140
141 postinstall()
142 {
143 # try to read default runlevel from the old inittab if it exists
144 local runlevel
145 runlevel=$(awk -F ':' '$3 == "initdefault" && $1 !~ "^#" { print $2 }' ${MROOT}/etc/inittab 2> /dev/null)
146 local target
147 if [[ -z ${runlevel} ]]
148 then
149 target="/lib/systemd/system/graphical.target"
150 else
151 target="/lib/systemd/system/runlevel${runlevel}.target"
152 fi
153 # and symlink what we found to the new-style default.target
154 ln -snf ${target} ${MROOT}/etc/systemd/system/default.target
155
156 if [[ -z ${MROOT} ]] || [[ ${MROOT} = / ]]
157 then
158 # create machine-id
159 if [ ! -f /etc/machine-id ]
160 then
161 systemd-machine-id-setup
162 fi
163
164 # restart systemd daemon
165 systemctl daemon-reexec
166
167 # enable the services we install by default.
168 systemctl enable \
169 getty@.service \
170 remote-fs.target \
171 systemd-readahead-replay.service \
172 systemd-readahead-collect.service
173 fi
174
175 echo
176 echo "systemd has been installed to /bin/systemd. Please ensure you append"
177 echo "init=/bin/systemd to your kernel command line in your bootloader."
178 echo
179 }