]> git.ipfire.org Git - people/stevee/ipfire-3.x.git/blob - systemd/systemd.nm
systemd: Update to 242
[people/stevee/ipfire-3.x.git] / systemd / systemd.nm
1 ###############################################################################
2 # IPFire.org - An Open Source Firewall Solution #
3 # Copyright (C) - IPFire Development Team <info@ipfire.org> #
4 ###############################################################################
5
6 name = systemd
7 version = 242
8 release = 1
9
10 maintainer = Stefan Schantl <stefan.schantl@ipfire.org>
11 groups = System/Base
12 url = http://www.freedesktop.org/wiki/Software/systemd
13 license = GPLv2+
14 summary = A System and Service Manager.
15
16 description
17 systemd is a system and service manager for Linux, compatible with
18 SysV and LSB init scripts.
19 end
20
21 source_dl = https://github.com/%{name}/%{name}/archive/v%{version}.tar.gz#/
22
23 build
24 unitdir = %{prefix}/lib/systemd/system
25
26 # The tools which are shipped by systemd requires an rpath to
27 # the libsystemd-shared binary to run properly. So the macro for
28 # removing any rpath's have to be disabled.
29 MACRO_FIX_LIBTOOL = # Do nothing
30
31 requires
32 # Testsuite
33 /usr/bin/getfacl
34 /usr/bin/mount
35 /usr/bin/tree
36 /usr/bin/umount
37
38 attr-devel
39 cryptsetup-luks-devel >= 1.4.2
40 dbus-devel
41 docbook-utils
42 docbook-xsl
43 elfutils-devel
44 gettext-devel
45 glib2-devel
46 gobject-introspection-devel >= 1.31
47 gperf
48 hwdata
49 intltool >= 0.51.0
50 kmod-devel >= 15
51 libacl-devel
52 libblkid-devel
53 libcap-devel
54 libgcrypt-devel
55 libmount-devel
56 libuuid-devel
57 m4
58 meson
59 ninja >= 1.5
60 pam-devel
61 pciutils-devel
62 python3-devel
63 python3-lxml
64 usbutils
65 vala
66 xz-devel
67 zlib-devel
68 end
69
70 export LD_LIBRARY_PATH = %{DIR_APP}/.libs
71
72 configure_options = \
73 -Dsysvinit-path= \
74 -Dsysvrcnd-path= \
75 -Dzlib=true \
76 -Dsmack=false \
77 -Dbacklight=false \
78 -Dfirstboot=false \
79 -Dhibernate=false \
80 -Dimportd=false \
81 -Dlibiptc=false \
82 -Dmachined=false \
83 -Dnetworkd=false \
84 -Dresolve=false \
85 -Dportabled=false \
86 -Dsysusers=false \
87 -Dtimesyncd=false \
88 -Dtimedated=false \
89 -Dpolkit=false \
90 -Dstatic=false
91
92 prepare_cmds
93 %{create_groups}
94 end
95
96 build
97 # Call meson and pass configure options.
98 meson --buildtype=plain %{configure_options} . build
99
100 # Call ninja to start build
101 ninja -v %{PARALLELISMFLAGS} -C build
102 end
103
104 test
105 # Create dummy machine-id file, which is required for some tests.
106 touch %{sysconfdir}/machine-id
107
108 # Generate temporary machine-id, which is required at least by the id128 test.
109 systemd-machine-id-setup
110
111 # Run the testsuite.
112 ninja test -v %{PARALLELISMFLAGS} -C build || true
113 end
114
115 install
116 # Export destdir.
117 export DESTDIR=%{BUILDROOT}
118
119 # Call ninja to perform installation
120 ninja install -v %{PARALLELISMFLAGS} -C build
121
122 # Create folder in log to store the journal.
123 mkdir -pv %{BUILDROOT}/var/log/journal
124
125 # Create sysv compatible symlinks.
126 mkdir -pv %{BUILDROOT}%{sbindir}
127 ln -svf ../lib/systemd/systemd %{BUILDROOT}/%{sbindir}/init
128 ln -svf ../lib/systemd/systemd %{BUILDROOT}/%{bindir}/systemd
129 ln -svf ../bin/systemctl %{BUILDROOT}/%{sbindir}/reboot
130 ln -svf ../bin/systemctl %{BUILDROOT}/%{sbindir}/halt
131 ln -svf ../bin/systemctl %{BUILDROOT}/%{sbindir}/poweroff
132 ln -svf ../bin/systemctl %{BUILDROOT}/%{sbindir}/shutdown
133
134 # Create empty machine-id file.
135 touch %{BUILDROOT}/etc/machine-id
136
137 # Copy locale and console settings
138 mkdir -pv %{BUILDROOT}%{sysconfdir}
139 cp -vf %{DIR_SOURCE}/{locale,vconsole}.conf %{BUILDROOT}%{sysconfdir}
140
141 # Recreate all targets
142 rm -rfv %{BUILDROOT}/%{sysconfdir}/systemd/system/*.target.wants
143 for i in basic.target.wants default.target.wants dbus.target.wants getty.target.wants \
144 multi-user.target.wants syslog.target.wants; do
145 mkdir -pv %{BUILDROOT}/%{sysconfdir}/systemd/system/${i} || exit 1
146 done
147
148 # Remove runlevel targets and graphical.target
149 rm -rfv %{BUILDROOT}%{unitdir}/runlevel*
150 rm -rfv %{BUILDROOT}%{unitdir}/graphical.target
151
152 # Remove service files for utmp update.
153 rm -rvf %{BUILDROOT}%{unitdir}/systemd-update-utmp-*.service
154 rm -rvf %{BUILDROOT}%{unitdir}/shutdown.target.wants/systemd-update-utmp-*.service
155
156 # Set default target to multi-user
157 ln -svf multi-user.target %{BUILDROOT}%{unitdir}/default.target
158
159 # Replace absolute symlinks by relative ones.
160 cd %{BUILDROOT}%{unitdir}/../user
161 for i in bluetooth local-fs paths printer remote-fs shutdown smartcard sockets sound swap timers; do
162 ln -svf ../system/${i}.target ${i}.target || exit 1
163 done
164
165 # Remove .so file for the shared library, it's not supposed to be used for anything.
166 rm -rvf %{BUILDROOT}%{prefix}/lib/systemd/libsystemd-shared.so
167
168 # Remove tmpfile for X11
169 rm -rfv %{BUILDROOT}/usr/lib/tmpfiles.d/x11.conf
170
171 # Drop X11 related config files
172 rm -rvf %{BUILDROOT}%{sysconfdir}/X11
173
174 # Remove unneeded stuff for xdg
175 rm -rfv %{BUILDROOT}/etc/xdg
176
177 # Remove unneeded stuff for rpm.
178 rm -rvf %{BUILDROOT}/etc/rpm
179 rm -rvf %{BUILDROOT}/usr/lib/rpm
180
181 # Drop ZSH related files
182 rm -rvf %{BUILDROOT}%{datadir}/zsh
183
184 # Use journald. Enable the import of kernel messages.
185 # Stop forwarding to a syslog daemon.
186 sed \
187 -e "s/^#ForwardToSyslog=.*$/ForwardToSyslog=no/" \
188 -e "s/^#ImportKernel=.*$/ImportKernel=yes/" \
189 -i %{BUILDROOT}/etc/systemd/journald.conf
190
191 # Install legacy tmpfile to autocreate /run/lock on startup.
192 install -v -m 644 %{DIR_APP}/tmpfiles.d/legacy.conf %{BUILDROOT}%{prefix}/lib/tmpfiles.d/
193
194 # Remove udev rules for "predictable" network device renaming.
195 # http://www.freedesktop.org/wiki/Software/systemd/PredictableNetworkInterfaceNames/
196 rm -vf %{BUILDROOT}/usr/lib/udev/rules.d/80-net-name-slot.rules
197
198 # Don't let udev set up any networking
199 rm -vf %{BUILDROOT}/usr/lib/udev/rules.d/80-net-setup-link.rules
200
201 # Create journald related folders.
202 mkdir -pv %{BUILDROOT}/run/log/journal
203 chown root:systemd-journal %{BUILDROOT}/run/log/journal
204
205 mkdir -pv %{BUILDROOT}/var/log/journal
206 chown root:systemd-journal %{BUILDROOT}/var/log/journal
207
208 # Create empty environment file.
209 touch %{BUILDROOT}%{sysconfdir}/environment
210 end
211 end
212
213 create_groups
214 # Create groups for udev.
215 getent group cdrom >/dev/null || groupadd -g 11 cdrom || :
216 getent group tape >/dev/null || groupadd -g 33 tape || :
217 getent group dialout >/dev/null || groupadd -g 18 dialout || :
218 getent group floppy >/dev/null || groupadd -g 19 floppy || :
219 getent group input >/dev/null || groupadd -r input || :
220 getent group utmp >/dev/null || groupadd -r -g 22 utmp || :
221
222 # Create group for journald.
223 getent group systemd-journal >/dev/null || /usr/sbin/groupadd -r systemd-journal
224 end
225
226 quality-agent
227 whitelist_rpath
228 %{prefix}/lib/systemd
229 end
230 end
231
232 packages
233 package %{name}
234 groups += Base
235
236 prerequires += authconfig
237
238 requires
239 dbus
240 hwdata
241 python-cairo
242 python-dbus
243 python-gobject3
244 %{name}-libs=%{thisver}
245 %{name}-units=%{thisver}
246 util-linux>=2.19
247 end
248
249 provides
250 /bin/systemd
251 /sbin/halt
252 /sbin/init
253 /sbin/poweroff
254 /sbin/reboot
255 /sbin/shutdown
256
257 syslog
258 udev = %{thisver}
259 end
260
261 conflicts
262 bash-completion < 2.1
263 dracut < 019
264 filesystem < 002
265 rsyslog < 5.8.6-4
266 upstart
267 end
268
269 obsoletes
270 udev < 183
271 end
272
273 configfiles
274 /etc/locale.conf
275 /etc/machine-id
276 /etc/systemd/journald.conf
277 /etc/systemd/logind.conf
278 /etc/systemd/system.conf
279 /etc/systemd/user.conf
280 /etc/udev/udev.conf
281 /etc/vconsole.conf
282 end
283
284 script prein
285 %{create_groups}
286 end
287
288 script postin
289 # Reexec systemd daemon.
290 /usr/bin/systemctl daemon-reexec > /dev/null 2>&1 || :
291
292 # Make sure pam_systemd is enabled
293 if ! grep -q pam_systemd /etc/pam.d/system-auth-ac ; then
294 authconfig --update --nostart >/dev/null 2>&1 || :
295
296 # Try harder
297 grep -q pam_systemd /etc/pam.d/system-auth-ac || authconfig --updateall --nostart >/dev/null 2>&1 || :
298 fi
299
300 /usr/bin/systemctl enable \
301 getty@.service \
302 serial-getty@.service \
303 remote-fs.target \
304 systemd-readahead-replay.service \
305 systemd-readahead-collect.service \
306 >/dev/null 2>&1 || :
307 end
308
309 script preup
310 # Be sure to stop the old udev before updating.
311 /usr/bin/systemctl stop udev.service udev-trigger.service \
312 udev-control.socket udev-kernel.socket >/dev/null 2>&1 || :
313
314 %{create_groups}
315 end
316
317 script postup
318 # Re-exec systemd after update.
319 /usr/bin/systemctl daemon-reexec
320
321 # Restart login service after update
322 /usr/bin/systemctl daemon-reload >/dev/null 2>&1 || :
323 /usr/bin/systemctl try-restart systemd-logind.service >/dev/null 2>&1 || :
324
325 # Use the new journald configuration file and restart the service.
326 if ! grep -xq ImportKernel=yes /etc/systemd/journald.conf ; then
327 mv /etc/systemd/journald.conf.paknew /etc/systemd/journald.conf
328 /usr/bin/systemctl restart systemd-journald.service >/dev/null 2>&1 || :
329 fi
330
331 # Enable spawning getty's on serial devices.
332 systemctl enable serial-getty@.service >/dev/null 2>&1 || :
333 end
334
335 # Be sure to start the new udev after everything is done.
336 script posttransup
337 /usr/bin/systemctl start systemd-udev.service >/dev/null 2>&1 || :
338 end
339 end
340
341 # Package information for systemd-units
342 package %{name}-units
343 summary = Configuration files, directories and installation tool for systemd.
344 description
345 This package contains all needed configuration files, directories
346 and installation / configuration tool for systemd.
347 end
348
349 prerequires
350 /bin/sh
351 coreutils
352 end
353
354 provides
355 /bin/systemctl
356 end
357
358 conflicts
359 filesystem < 002
360 end
361
362 files
363 %{sysconfdir}/etc/systemd/system
364 %{sysconfdir}/tmpfiles.d
365 %{sysconfdir}/bash_completion.d/systemctl-bash-completion.sh
366 %{unitdir}
367 %{bindir}/systemctl
368 %{bindir}/systemd-tmpfiles
369 %{mandir}/man1/systemctl.*
370 end
371
372 script postup
373 # Reload service files
374 /usr/bin/systemctl daemon-reload > /dev/null 2>&1 || :
375 end
376 end
377
378 package %{name}-libs
379 template LIBS
380
381 groups += Base
382
383 prerequires
384 /etc/nsswitch.conf
385 end
386
387 provides
388 nss-myhostname = %{thisver}
389 end
390
391 obsoletes
392 nss-myhostname <= 0.3-3
393 systemd-compat-libs < 230
394 end
395
396 conflicts
397 # Ensure that the version of systemd matches systemd-libs.
398 systemd > %{thisver}
399 systemd < %{thisver}
400 end
401
402 # Add myhostname to the hosts line of /etc/nsswitch.conf
403 script postin
404 if [ -f "/etc/nsswitch.conf" ]; then
405 sed -i.bak -e '
406 /^hosts:/ !b
407 /\<myhostname\>/ b
408 s/[[:blank:]]*$/ myhostname/
409 ' /etc/nsswitch.conf
410 fi
411 end
412
413 # Remove myhostname from the hosts line of /etc/nsswitch.conf
414 script postun
415 if [ -f "/etc/nsswitch.conf" ]; then
416 sed -i.bak -e '
417 /^hosts:/ !b
418 s/[[:blank:]]\+myhostname\>//
419 ' /etc/nsswitch.conf
420 fi
421 end
422 end
423
424 package %{name}-devel
425 template DEVEL
426
427 files += %{prefix}/lib/pakfire/macros/
428 end
429
430 package libudev
431 summary = Libraries for adding libudev support to applications.
432 description
433 This package contains the libraries that make it easier to use libudev
434 functionality from applications.
435 end
436 license = LGPLv2+
437
438 conflicts
439 filesystem < 002
440 end
441
442 files
443 %{libdir}/lib*udev*.so.*
444 %{libidr}/girepository*/
445 end
446 end
447
448 package libudev-devel
449 summary = Header files for adding libudev support to applications.
450 description
451 This package contains the header and pkg-config files for developing
452 applications using libudev functionality.
453 end
454 license = LGPLv2+
455
456 conflicts
457 filesystem < 002
458 end
459
460 files
461 %{libdir}/lib*udev*.so
462 %{libdir}/pkgconfig/lib*udev.pc
463 %{libdir}/pkgconfig/gudev*
464 %{includedir}/lib*udev.h
465 %{includedir}/gudev*
466 %{datadir}/gir-*
467 %{datadir}/gtk-doc/html/gudev
468 end
469 end
470
471 package %{name}-debuginfo
472 template DEBUGINFO
473 end
474 end