Magellan Linux

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

Parent Directory Parent Directory | Revision Log Revision Log


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