Magellan Linux

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 7870 - (show annotations) (download)
Thu Jun 2 19:43:51 2011 UTC (12 years, 11 months ago) by niro
File size: 4221 byte(s)
-added magellan patch with fixed pretty_print and removed tty1 from getty.target and plymouth units enabled, make external sysvinit-support variable and install unit targets after installation, to have mage  not to own the symlinks
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 SRC_URI=(
43 http://www.freedesktop.org/software/${PNAME}/${SRCFILE}
44 mirror://${PNAME}/${SRCFILE}
45 mirror://${PNAME}/${PNAME}-${PVER}-magellan-2.patch
46 )
47
48 UP2DATE="updatecmd http://www.freedesktop.org/software/systemd/ | lasttarball"
49
50 src_prepare()
51 {
52 munpack ${SRCFILE} || die
53 cd ${SRCDIR}
54
55 # apply our magellan patch
56 mpatch ${PNAME}-${PVER}-magellan-2.patch || die
57
58 # regen configure
59 mautoreconf || die
60 }
61
62 src_compile()
63 {
64 cd ${SRCDIR}
65
66 mconfigure \
67 --with-distro=magellan \
68 --libexecdir=/usr/$(mlibdir)/${PNAME} \
69 --with-pamlibdir=/$(mlibdir)/security \
70 --with-rootdir=/ \
71 --enable-gtk \
72 --enable-pam \
73 --enable-tcpwrap \
74 --disable-audit \
75 --disable-selinux \
76 || die
77
78 mmake || die
79 }
80
81 src_install()
82 {
83 cd ${SRCDIR}
84 mmake DESTDIR=${BINDIR} install || die
85
86 # install os-release file
87 cat > ${BINDIR}/etc/os-release << EOF
88 NAME="Magellan Linux"
89 ID=magellan
90 PRETTY_NAME="Magellan Linux"
91 ANSI_COLOR="1;34"
92 EOF
93
94 # keep some directories
95 mkeepdir /run || die
96 mkeepdir /etc/modules-load.d || die
97
98 # remove tty1 from getty targets to use tty1 as systemd logger
99 # and to fix graphical glitches
100 # will by integrated in the magellan patch!
101 sed -i 's:getty.target.wants/getty@tty1.service\ ::' \
102 ${BINDIR}/lib/systemd/system/getty@.service || die
103
104 if [[ ${SYSVINIT_SUPPORT} != y ]]
105 then
106 echo "Include SysV init Compat symlinks"
107 # create SysV compatibility symlinks. systemctl/systemd are smart
108 # enough to detect in which way they are called.
109 minstalldir /sbin || die
110 mlink ../bin/systemd /sbin/init || die
111 local i
112 for i in reboot halt poweroff shutdown telinit runlevel
113 do
114 mlink ../bin/systemctl /sbin/${i} || die
115 done
116 else
117 echo "Using sysvinit package for SysV compat"
118 fi
119
120 # we create all wants links manually at installation time to make sure
121 # they are not owned and hence overriden by rpm after the used deleted
122 # them.
123 rm -r ${BINDIR}/etc/systemd/system/*.target.wants || die
124 # but make sure these directories are properly owned
125 mkeepdir /lib/systemd/system/basic.target.wants || die
126 mkeepdir /lib/systemd/system/default.target.wants || die
127 mkeepdir /lib/systemd/system/dbus.target.wants || die
128 mkeepdir /lib/systemd/system/syslog.target.wants || die
129
130 minstalldocs DISTRO_PORTING LICENSE README TODO || die
131 }
132
133 preinstall()
134 {
135 # adding lock group
136 ${MLIBDIR}/mgroupadd -o "-g 54" lock
137 }
138
139 postinstall()
140 {
141 # try to read default runlevel from the old inittab if it exists
142 local runlevel
143 runlevel=$(awk -F ':' '$3 == "initdefault" && $1 !~ "^#" { print $2 }' ${MROOT}/etc/inittab 2> /dev/null)
144 local target
145 if [[ -z ${runlevel} ]]
146 then
147 target="/lib/systemd/system/graphical.target"
148 else
149 target="/lib/systemd/system/runlevel${runlevel}.target"
150 fi
151 # and symlink what we found to the new-style default.target
152 ln -snf ${target} ${MROOT}/etc/systemd/system/default.target
153
154 if [[ -z ${MROOT} ]] || [[ ${MROOT} = / ]]
155 then
156 # create machine-id
157 if [ ! -f /etc/machine-id ]
158 then
159 systemd-machine-id-setup
160 fi
161
162 # restart systemd daemon
163 systemctl daemon-reexec
164
165 # enable the services we install by default.
166 systemctl enable \
167 getty@.service \
168 remote-fs.target \
169 systemd-readahead-replay.service \
170 systemd-readahead-collect.service
171 fi
172
173 echo
174 echo "systemd has been installed to /bin/systemd. Please ensure you append"
175 echo "init=/bin/systemd to your kernel command line in your bootloader."
176 echo
177 }