]> git.ipfire.org Git - people/stevee/ipfire-3.x.git/blame - systemd/systemd.nm
systemd: Update to 242
[people/stevee/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
afca1500 7version = 242
aaa616e7 8release = 1
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
c9dd9f9b 21source_dl = https://github.com/%{name}/%{name}/archive/v%{version}.tar.gz#/
802ea3af
MT
22
23build
6793fec1
MT
24 unitdir = %{prefix}/lib/systemd/system
25
557068de
SS
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
802ea3af 31 requires
c9dd9f9b
SS
32 # Testsuite
33 /usr/bin/getfacl
34 /usr/bin/mount
35 /usr/bin/tree
36 /usr/bin/umount
37
b329a155 38 attr-devel
2d01364a 39 cryptsetup-luks-devel >= 1.4.2
802ea3af 40 dbus-devel
fe6e3719
SS
41 docbook-utils
42 docbook-xsl
8823e1f9 43 elfutils-devel
bfabb323 44 gettext-devel
2d01364a
SS
45 glib2-devel
46 gobject-introspection-devel >= 1.31
47 gperf
48 hwdata
c9dd9f9b 49 intltool >= 0.51.0
7e97512a 50 kmod-devel >= 15
2a824e90 51 libacl-devel
2d01364a 52 libblkid-devel
802ea3af 53 libcap-devel
4990bf7f 54 libgcrypt-devel
8823e1f9 55 libmount-devel
4990bf7f 56 libuuid-devel
8823e1f9 57 m4
aaa616e7
SS
58 meson
59 ninja >= 1.5
802ea3af 60 pam-devel
2d01364a 61 pciutils-devel
63af7a71
SS
62 python3-devel
63 python3-lxml
2d01364a 64 usbutils
53a325cb 65 vala
6793fec1 66 xz-devel
8823e1f9 67 zlib-devel
802ea3af
MT
68 end
69
c9dd9f9b
SS
70 export LD_LIBRARY_PATH = %{DIR_APP}/.libs
71
aaa616e7
SS
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
802ea3af
MT
91
92 prepare_cmds
8823e1f9 93 %{create_groups}
aaa616e7
SS
94 end
95
96 build
97 # Call meson and pass configure options.
98 meson --buildtype=plain %{configure_options} . build
c9dd9f9b 99
aaa616e7
SS
100 # Call ninja to start build
101 ninja -v %{PARALLELISMFLAGS} -C build
c9dd9f9b
SS
102 end
103
104 test
105 # Create dummy machine-id file, which is required for some tests.
106 touch %{sysconfdir}/machine-id
107
20bbeabf
SS
108 # Generate temporary machine-id, which is required at least by the id128 test.
109 systemd-machine-id-setup
110
c9dd9f9b 111 # Run the testsuite.
aaa616e7 112 ninja test -v %{PARALLELISMFLAGS} -C build || true
802ea3af
MT
113 end
114
aaa616e7
SS
115 install
116 # Export destdir.
117 export DESTDIR=%{BUILDROOT}
118
119 # Call ninja to perform installation
120 ninja install -v %{PARALLELISMFLAGS} -C build
121
755fe986
SS
122 # Create folder in log to store the journal.
123 mkdir -pv %{BUILDROOT}/var/log/journal
124
802ea3af 125 # Create sysv compatible symlinks.
6793fec1
MT
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
802ea3af
MT
133
134 # Create empty machine-id file.
135 touch %{BUILDROOT}/etc/machine-id
136
137 # Copy locale and console settings
6793fec1
MT
138 mkdir -pv %{BUILDROOT}%{sysconfdir}
139 cp -vf %{DIR_SOURCE}/{locale,vconsole}.conf %{BUILDROOT}%{sysconfdir}
802ea3af
MT
140
141 # Recreate all targets
0976fbe4
SS
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
6793fec1 146 done
802ea3af
MT
147
148 # Remove runlevel targets and graphical.target
6793fec1
MT
149 rm -rfv %{BUILDROOT}%{unitdir}/runlevel*
150 rm -rfv %{BUILDROOT}%{unitdir}/graphical.target
802ea3af 151
2d01364a
SS
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
802ea3af 156 # Set default target to multi-user
6793fec1 157 ln -svf multi-user.target %{BUILDROOT}%{unitdir}/default.target
802ea3af
MT
158
159 # Replace absolute symlinks by relative ones.
6793fec1 160 cd %{BUILDROOT}%{unitdir}/../user
7f84cbd5 161 for i in bluetooth local-fs paths printer remote-fs shutdown smartcard sockets sound swap timers; do
6793fec1
MT
162 ln -svf ../system/${i}.target ${i}.target || exit 1
163 done
164
e52f3c8b
SS
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
802ea3af
MT
168 # Remove tmpfile for X11
169 rm -rfv %{BUILDROOT}/usr/lib/tmpfiles.d/x11.conf
170
e52f3c8b
SS
171 # Drop X11 related config files
172 rm -rvf %{BUILDROOT}%{sysconfdir}/X11
173
7f84cbd5
SS
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
8823e1f9 179 rm -rvf %{BUILDROOT}/usr/lib/rpm
755fe986 180
e52f3c8b
SS
181 # Drop ZSH related files
182 rm -rvf %{BUILDROOT}%{datadir}/zsh
183
755fe986
SS
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
f2ada565
SS
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/
4f209325
MT
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
8823e1f9 197
c4296a3d
MT
198 # Don't let udev set up any networking
199 rm -vf %{BUILDROOT}/usr/lib/udev/rules.d/80-net-setup-link.rules
200
8823e1f9
SS
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
20bbeabf
SS
207
208 # Create empty environment file.
209 touch %{BUILDROOT}%{sysconfdir}/environment
802ea3af
MT
210 end
211end
212
8823e1f9
SS
213create_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 || :
747db4fd
SS
219 getent group input >/dev/null || groupadd -r input || :
220 getent group utmp >/dev/null || groupadd -r -g 22 utmp || :
8823e1f9
SS
221
222 # Create group for journald.
223 getent group systemd-journal >/dev/null || /usr/sbin/groupadd -r systemd-journal
224end
225
557068de
SS
226quality-agent
227 whitelist_rpath
228 %{prefix}/lib/systemd
229 end
230end
231
802ea3af
MT
232packages
233 package %{name}
2d01364a
SS
234 groups += Base
235
6793fec1
MT
236 prerequires += authconfig
237
514357ad
SS
238 requires
239 dbus
2d01364a 240 hwdata
514357ad 241 python-cairo
1d40b321 242 python-dbus
7f84cbd5 243 python-gobject3
519776fd 244 %{name}-libs=%{thisver}
214d8f27 245 %{name}-units=%{thisver}
514357ad
SS
246 util-linux>=2.19
247 end
1d40b321 248
216fde50
SS
249 provides
250 /bin/systemd
251 /sbin/halt
252 /sbin/init
253 /sbin/poweroff
254 /sbin/reboot
255 /sbin/shutdown
2d01364a 256
755fe986 257 syslog
2d01364a 258 udev = %{thisver}
216fde50
SS
259 end
260
6793fec1 261 conflicts
7f84cbd5 262 bash-completion < 2.1
2d01364a 263 dracut < 019
6793fec1 264 filesystem < 002
755fe986 265 rsyslog < 5.8.6-4
6793fec1
MT
266 upstart
267 end
ef438375 268
2d01364a
SS
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
8823e1f9 285 %{create_groups}
2d01364a
SS
286 end
287
1d40b321 288 script postin
1d40b321 289 # Reexec systemd daemon.
6793fec1 290 /usr/bin/systemctl daemon-reexec > /dev/null 2>&1 || :
1d40b321
SS
291
292 # Make sure pam_systemd is enabled
6793fec1
MT
293 if ! grep -q pam_systemd /etc/pam.d/system-auth-ac ; then
294 authconfig --update --nostart >/dev/null 2>&1 || :
1d40b321
SS
295
296 # Try harder
6793fec1 297 grep -q pam_systemd /etc/pam.d/system-auth-ac || authconfig --updateall --nostart >/dev/null 2>&1 || :
1d40b321 298 fi
5e462903
MT
299
300 /usr/bin/systemctl enable \
301 getty@.service \
2dfd22f3 302 serial-getty@.service \
50affca1 303 remote-fs.target \
5e462903
MT
304 systemd-readahead-replay.service \
305 systemd-readahead-collect.service \
306 >/dev/null 2>&1 || :
1d40b321
SS
307 end
308
2d01364a
SS
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 || :
8823e1f9
SS
313
314 %{create_groups}
2d01364a
SS
315 end
316
1d40b321 317 script postup
56f48716
SS
318 # Re-exec systemd after update.
319 /usr/bin/systemctl daemon-reexec
320
1d40b321 321 # Restart login service after update
5e462903 322 /usr/bin/systemctl daemon-reload >/dev/null 2>&1 || :
6793fec1 323 /usr/bin/systemctl try-restart systemd-logind.service >/dev/null 2>&1 || :
755fe986
SS
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
2dfd22f3
SS
330
331 # Enable spawning getty's on serial devices.
332 systemctl enable serial-getty@.service >/dev/null 2>&1 || :
1d40b321 333 end
2d01364a
SS
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
802ea3af 339 end
1f9bc2f0 340
802ea3af
MT
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
1f9bc2f0 348
5e38e9bb
SS
349 prerequires
350 /bin/sh
351 coreutils
352 end
353
6793fec1 354 provides
802ea3af 355 /bin/systemctl
802ea3af 356 end
1d40b321 357
6793fec1
MT
358 conflicts
359 filesystem < 002
1d40b321
SS
360 end
361
6793fec1
MT
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.*
1d40b321
SS
370 end
371
372 script postup
373 # Reload service files
6793fec1 374 /usr/bin/systemctl daemon-reload > /dev/null 2>&1 || :
1d40b321 375 end
802ea3af 376 end
1f9bc2f0 377
1191e383
SS
378 package %{name}-libs
379 template LIBS
519776fd
SS
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
e52f3c8b 393 systemd-compat-libs < 230
519776fd
SS
394 end
395
396 conflicts
519776fd
SS
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
1191e383
SS
422 end
423
802ea3af
MT
424 package %{name}-devel
425 template DEVEL
6793fec1
MT
426
427 files += %{prefix}/lib/pakfire/macros/
802ea3af 428 end
1f9bc2f0 429
2d01364a
SS
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
1191e383 443 %{libdir}/lib*udev*.so.*
2d01364a
SS
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
a8aa3ead 461 %{libdir}/lib*udev*.so
73eb4724 462 %{libdir}/pkgconfig/lib*udev.pc
2d01364a 463 %{libdir}/pkgconfig/gudev*
a8aa3ead 464 %{includedir}/lib*udev.h
2d01364a
SS
465 %{includedir}/gudev*
466 %{datadir}/gir-*
467 %{datadir}/gtk-doc/html/gudev
468 end
469 end
470
1f9bc2f0
MT
471 package %{name}-debuginfo
472 template DEBUGINFO
473 end
802ea3af 474end