Magellan Linux

Annotation of /branches/magellan-next/core/systemd/systemd-34-r1.smage2

Parent Directory Parent Directory | Revision Log Revision Log


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