]> git.ipfire.org Git - people/amarx/ipfire-3.x.git/blame - systemd/systemd.nm
systemd: Reexec systemd after update.
[people/amarx/ipfire-3.x.git] / systemd / systemd.nm
CommitLineData
c8ef6def 1###############################################################################
802ea3af
MT
2# IPFire.org - An Open Source Firewall Solution #
3# Copyright (C) - IPFire Development Team <info@ipfire.org> #
c8ef6def
SS
4###############################################################################
5
802ea3af 6name = systemd
7e97512a 7version = 215
56f48716 8release = 2
c8ef6def 9
802ea3af
MT
10maintainer = Stefan Schantl <stefan.schantl@ipfire.org>
11groups = System/Base
12url = http://www.freedesktop.org/wiki/Software/systemd
13license = GPLv2+
14summary = A System and Service Manager.
c8ef6def 15
802ea3af
MT
16description
17 systemd is a system and service manager for Linux, compatible with
c8ef6def 18 SysV and LSB init scripts.
802ea3af
MT
19end
20
5e38e9bb 21source_dl = http://cgit.freedesktop.org/systemd/systemd/snapshot/
802ea3af
MT
22
23build
6793fec1
MT
24 unitdir = %{prefix}/lib/systemd/system
25
802ea3af 26 requires
b329a155 27 attr-devel
802ea3af
MT
28 audit-devel
29 automake
30 autoconf
2d01364a 31 cryptsetup-luks-devel >= 1.4.2
802ea3af 32 dbus-devel
fe6e3719
SS
33 docbook-utils
34 docbook-xsl
bfabb323 35 gettext-devel
2d01364a
SS
36 glib2-devel
37 gobject-introspection-devel >= 1.31
38 gperf
39 hwdata
802ea3af 40 intltool
7e97512a 41 kmod-devel >= 15
2a824e90 42 libacl-devel
2d01364a 43 libblkid-devel
802ea3af 44 libcap-devel
4990bf7f 45 libgcrypt-devel
802ea3af
MT
46 libselinux-devel
47 libtool
4990bf7f 48 libuuid-devel
802ea3af 49 pam-devel
2d01364a
SS
50 pciutils-devel
51 usbutils
53a325cb 52 vala
6793fec1 53 xz-devel
802ea3af
MT
54 end
55
56 configure_options += \
7f84cbd5
SS
57 --with-sysvinit-path= \
58 --with-sysvrcnd-path= \
59 --enable-introspection=yes \
7e97512a
SS
60 --disable-networkd \
61 --disable-resolvd \
62 --disable-sysusers \
63 --disable-timesyncd \
2d01364a 64 --disable-static
802ea3af
MT
65
66 prepare_cmds
67 ./autogen.sh ac
68 end
69
802ea3af 70 install_cmds
755fe986
SS
71 # Create folder in log to store the journal.
72 mkdir -pv %{BUILDROOT}/var/log/journal
73
802ea3af 74 # Create sysv compatible symlinks.
6793fec1
MT
75 mkdir -pv %{BUILDROOT}%{sbindir}
76 ln -svf ../lib/systemd/systemd %{BUILDROOT}/%{sbindir}/init
77 ln -svf ../lib/systemd/systemd %{BUILDROOT}/%{bindir}/systemd
78 ln -svf ../bin/systemctl %{BUILDROOT}/%{sbindir}/reboot
79 ln -svf ../bin/systemctl %{BUILDROOT}/%{sbindir}/halt
80 ln -svf ../bin/systemctl %{BUILDROOT}/%{sbindir}/poweroff
81 ln -svf ../bin/systemctl %{BUILDROOT}/%{sbindir}/shutdown
802ea3af
MT
82
83 # Create empty machine-id file.
84 touch %{BUILDROOT}/etc/machine-id
85
86 # Copy locale and console settings
6793fec1
MT
87 mkdir -pv %{BUILDROOT}%{sysconfdir}
88 cp -vf %{DIR_SOURCE}/{locale,vconsole}.conf %{BUILDROOT}%{sysconfdir}
802ea3af
MT
89
90 # Recreate all targets
0976fbe4
SS
91 rm -rfv %{BUILDROOT}/%{sysconfdir}/systemd/system/*.target.wants
92 for i in basic.target.wants default.target.wants dbus.target.wants getty.target.wants \
93 multi-user.target.wants syslog.target.wants; do
94 mkdir -pv %{BUILDROOT}/%{sysconfdir}/systemd/system/${i} || exit 1
6793fec1 95 done
802ea3af
MT
96
97 # Remove runlevel targets and graphical.target
6793fec1
MT
98 rm -rfv %{BUILDROOT}%{unitdir}/runlevel*
99 rm -rfv %{BUILDROOT}%{unitdir}/graphical.target
802ea3af 100
2d01364a
SS
101 # Remove service files for utmp update.
102 rm -rvf %{BUILDROOT}%{unitdir}/systemd-update-utmp-*.service
103 rm -rvf %{BUILDROOT}%{unitdir}/shutdown.target.wants/systemd-update-utmp-*.service
104
802ea3af 105 # Set default target to multi-user
6793fec1 106 ln -svf multi-user.target %{BUILDROOT}%{unitdir}/default.target
802ea3af
MT
107
108 # Replace absolute symlinks by relative ones.
6793fec1 109 cd %{BUILDROOT}%{unitdir}/../user
7f84cbd5 110 for i in bluetooth local-fs paths printer remote-fs shutdown smartcard sockets sound swap timers; do
6793fec1
MT
111 ln -svf ../system/${i}.target ${i}.target || exit 1
112 done
113
802ea3af
MT
114 # Remove tmpfile for X11
115 rm -rfv %{BUILDROOT}/usr/lib/tmpfiles.d/x11.conf
116
7f84cbd5
SS
117 # Remove unneeded stuff for xdg
118 rm -rfv %{BUILDROOT}/etc/xdg
119
120 # Remove unneeded stuff for rpm.
121 rm -rvf %{BUILDROOT}/etc/rpm
755fe986
SS
122
123 # Use journald. Enable the import of kernel messages.
124 # Stop forwarding to a syslog daemon.
125 sed \
126 -e "s/^#ForwardToSyslog=.*$/ForwardToSyslog=no/" \
127 -e "s/^#ImportKernel=.*$/ImportKernel=yes/" \
128 -i %{BUILDROOT}/etc/systemd/journald.conf
f2ada565
SS
129
130 # Install legacy tmpfile to autocreate /run/lock on startup.
131 install -v -m 644 %{DIR_APP}/tmpfiles.d/legacy.conf %{BUILDROOT}%{prefix}/lib/tmpfiles.d/
4f209325
MT
132
133 # Remove udev rules for "predictable" network device renaming.
134 # http://www.freedesktop.org/wiki/Software/systemd/PredictableNetworkInterfaceNames/
135 rm -vf %{BUILDROOT}/usr/lib/udev/rules.d/80-net-name-slot.rules
802ea3af
MT
136 end
137end
138
139packages
140 package %{name}
2d01364a
SS
141 groups += Base
142
6793fec1
MT
143 prerequires += authconfig
144
514357ad
SS
145 requires
146 dbus
2d01364a 147 hwdata
514357ad 148 python-cairo
1d40b321 149 python-dbus
7f84cbd5 150 python-gobject3
519776fd 151 %{name}-libs=%{thisver}
214d8f27 152 %{name}-units=%{thisver}
514357ad
SS
153 util-linux>=2.19
154 end
1d40b321 155
216fde50
SS
156 provides
157 /bin/systemd
158 /sbin/halt
159 /sbin/init
160 /sbin/poweroff
161 /sbin/reboot
162 /sbin/shutdown
2d01364a 163
755fe986 164 syslog
2d01364a 165 udev = %{thisver}
216fde50
SS
166 end
167
6793fec1 168 conflicts
7f84cbd5 169 bash-completion < 2.1
2d01364a 170 dracut < 019
6793fec1 171 filesystem < 002
755fe986 172 rsyslog < 5.8.6-4
6793fec1
MT
173 upstart
174 end
ef438375 175
2d01364a
SS
176 obsoletes
177 udev < 183
178 end
179
180 configfiles
181 /etc/locale.conf
182 /etc/machine-id
183 /etc/systemd/journald.conf
184 /etc/systemd/logind.conf
185 /etc/systemd/system.conf
186 /etc/systemd/user.conf
187 /etc/udev/udev.conf
188 /etc/vconsole.conf
189 end
190
191 script prein
192 # Create groups for udev.
193 getent group cdrom >/dev/null || groupadd -g 11 cdrom || :
194 getent group tape >/dev/null || groupadd -g 33 tape || :
195 getent group dialout >/dev/null || groupadd -g 18 dialout || :
196 getent group floppy >/dev/null || groupadd -g 19 floppy || :
197 end
198
1d40b321
SS
199 script postin
200 # Generate Machine ID.
6793fec1 201 /usr/bin/systemd-machine-id-setup > /dev/null 2>&1 || :
1d40b321
SS
202
203 # Reexec systemd daemon.
6793fec1 204 /usr/bin/systemctl daemon-reexec > /dev/null 2>&1 || :
1d40b321
SS
205
206 # Make sure pam_systemd is enabled
6793fec1
MT
207 if ! grep -q pam_systemd /etc/pam.d/system-auth-ac ; then
208 authconfig --update --nostart >/dev/null 2>&1 || :
1d40b321
SS
209
210 # Try harder
6793fec1 211 grep -q pam_systemd /etc/pam.d/system-auth-ac || authconfig --updateall --nostart >/dev/null 2>&1 || :
1d40b321 212 fi
5e462903
MT
213
214 /usr/bin/systemctl enable \
215 getty@.service \
50affca1 216 remote-fs.target \
5e462903
MT
217 systemd-readahead-replay.service \
218 systemd-readahead-collect.service \
219 >/dev/null 2>&1 || :
1d40b321
SS
220 end
221
2d01364a
SS
222 script preup
223 # Be sure to stop the old udev before updating.
224 /usr/bin/systemctl stop udev.service udev-trigger.service \
225 udev-control.socket udev-kernel.socket >/dev/null 2>&1 || :
226 end
227
1d40b321 228 script postup
56f48716
SS
229 # Re-exec systemd after update.
230 /usr/bin/systemctl daemon-reexec
231
1d40b321 232 # Restart login service after update
5e462903 233 /usr/bin/systemctl daemon-reload >/dev/null 2>&1 || :
6793fec1 234 /usr/bin/systemctl try-restart systemd-logind.service >/dev/null 2>&1 || :
755fe986
SS
235
236 # Use the new journald configuration file and restart the service.
237 if ! grep -xq ImportKernel=yes /etc/systemd/journald.conf ; then
238 mv /etc/systemd/journald.conf.paknew /etc/systemd/journald.conf
239 /usr/bin/systemctl restart systemd-journald.service >/dev/null 2>&1 || :
240 fi
1d40b321 241 end
2d01364a
SS
242
243 # Be sure to start the new udev after everything is done.
244 script posttransup
245 /usr/bin/systemctl start systemd-udev.service >/dev/null 2>&1 || :
246 end
802ea3af 247 end
1f9bc2f0 248
802ea3af
MT
249 # Package information for systemd-units
250 package %{name}-units
251 summary = Configuration files, directories and installation tool for systemd.
252 description
253 This package contains all needed configuration files, directories
254 and installation / configuration tool for systemd.
255 end
1f9bc2f0 256
5e38e9bb
SS
257 prerequires
258 /bin/sh
259 coreutils
260 end
261
6793fec1 262 provides
802ea3af 263 /bin/systemctl
802ea3af 264 end
1d40b321 265
6793fec1
MT
266 conflicts
267 filesystem < 002
1d40b321
SS
268 end
269
6793fec1
MT
270 files
271 %{sysconfdir}/etc/systemd/system
272 %{sysconfdir}/tmpfiles.d
273 %{sysconfdir}/bash_completion.d/systemctl-bash-completion.sh
274 %{unitdir}
275 %{bindir}/systemctl
276 %{bindir}/systemd-tmpfiles
277 %{mandir}/man1/systemctl.*
1d40b321
SS
278 end
279
280 script postup
281 # Reload service files
6793fec1 282 /usr/bin/systemctl daemon-reload > /dev/null 2>&1 || :
1d40b321 283 end
802ea3af 284 end
1f9bc2f0 285
1191e383
SS
286 package %{name}-libs
287 template LIBS
519776fd
SS
288
289 groups += Base
290
291 prerequires
292 /etc/nsswitch.conf
293 end
294
295 provides
296 nss-myhostname = %{thisver}
297 end
298
299 obsoletes
300 nss-myhostname <= 0.3-3
301 end
302
303 conflicts
519776fd
SS
304 # Ensure that the version of systemd matches systemd-libs.
305 systemd > %{thisver}
306 systemd < %{thisver}
307 end
308
309 # Add myhostname to the hosts line of /etc/nsswitch.conf
310 script postin
311 if [ -f "/etc/nsswitch.conf" ]; then
312 sed -i.bak -e '
313 /^hosts:/ !b
314 /\<myhostname\>/ b
315 s/[[:blank:]]*$/ myhostname/
316 ' /etc/nsswitch.conf
317 fi
318 end
319
320 # Remove myhostname from the hosts line of /etc/nsswitch.conf
321 script postun
322 if [ -f "/etc/nsswitch.conf" ]; then
323 sed -i.bak -e '
324 /^hosts:/ !b
325 s/[[:blank:]]\+myhostname\>//
326 ' /etc/nsswitch.conf
327 fi
328 end
1191e383
SS
329 end
330
802ea3af
MT
331 package %{name}-devel
332 template DEVEL
6793fec1
MT
333
334 files += %{prefix}/lib/pakfire/macros/
802ea3af 335 end
1f9bc2f0 336
2d01364a
SS
337 package libudev
338 summary = Libraries for adding libudev support to applications.
339 description
340 This package contains the libraries that make it easier to use libudev
341 functionality from applications.
342 end
343 license = LGPLv2+
344
345 conflicts
346 filesystem < 002
347 end
348
349 files
1191e383 350 %{libdir}/lib*udev*.so.*
2d01364a
SS
351 %{libidr}/girepository*/
352 end
353 end
354
355 package libudev-devel
356 summary = Header files for adding libudev support to applications.
357 description
358 This package contains the header and pkg-config files for developing
359 applications using libudev functionality.
360 end
361 license = LGPLv2+
362
363 conflicts
364 filesystem < 002
365 end
366
367 files
a8aa3ead 368 %{libdir}/lib*udev*.so
73eb4724 369 %{libdir}/pkgconfig/lib*udev.pc
2d01364a 370 %{libdir}/pkgconfig/gudev*
a8aa3ead 371 %{includedir}/lib*udev.h
2d01364a
SS
372 %{includedir}/gudev*
373 %{datadir}/gir-*
374 %{datadir}/gtk-doc/html/gudev
375 end
376 end
377
1f9bc2f0
MT
378 package %{name}-debuginfo
379 template DEBUGINFO
380 end
802ea3af 381end