]> git.ipfire.org Git - ipfire-3.x.git/blob - systemd/systemd.nm
json-c: Update to version 0.17-20230812
[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 = 254
8 release = 3
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 kbd
51 kmod-devel >= 15
52 libacl-devel
53 libbpf-devel
54 libblkid-devel
55 libcap-devel
56 libcurl-devel
57 libfdisk-devel
58 libgcrypt-devel
59 libidn-devel
60 libidn2-devel
61 libmount-devel >= 2.34-2
62 libpwquality-devel
63 libseccomp-devel
64 libuuid-devel >= 2.34-2
65 libxcrypt-devel
66 lz4-devel
67 m4
68 meson >= 0.50.1
69 ninja >= 1.9.0
70 openssl-devel
71 p11-kit-devel
72 pam-devel
73 pciutils-devel
74 python3-devel
75 python3-jinja2
76 python3-lxml
77 setup >= 3.0-13
78 usbutils
79 vala
80 xz-devel
81 zlib-devel
82 end
83
84 export LD_LIBRARY_PATH = %{DIR_APP}/.libs
85
86 configure_options = \
87 -Dsysvinit-path= \
88 -Dsysvrcnd-path= \
89 -Dnobody-user=nobody \
90 -Dnobody-group=nobody \
91 -Dfallback-hostname="localhost" \
92 -Dzlib=true \
93 -Dman=true \
94 -Dsmack=false \
95 -Dbacklight=false \
96 -Dfirstboot=false \
97 -Dhibernate=false \
98 -Dimportd=false \
99 -Dlibiptc=false \
100 -Dmachined=false \
101 -Dnetworkd=false \
102 -Dresolve=false \
103 -Dportabled=false \
104 -Dtimesyncd=false \
105 -Dtimedated=false \
106 -Dpolkit=false
107
108 # Assign group ids
109 configure_options += \
110 -Dadm-gid=4 \
111 -Dtty-gid=5 \
112 -Ddisk-gid=6 \
113 -Dlp-gid=7 \
114 -Dkmem-gid=9 \
115 -Dwheel-gid=10 \
116 -Dcdrom-gid=11 \
117 -Ddialout-gid=18 \
118 -Dutmp-gid=22 \
119 -Dtape-gid=33 \
120 -Dkvm-gid=36 \
121 -Dvideo-gid=39 \
122 -Daudio-gid=63 \
123 -Dusers-gid=100 \
124 -Dinput-gid=104 \
125 -Drender-gid=105 \
126 -Dsgx-gid=106 \
127 -Dsystemd-journal-gid=190
128
129 build
130 # Call meson and pass configure options.
131 %{meson} %{configure_options}
132
133 # Call ninja to start build
134 %{meson_build}
135 end
136
137 test
138 # Create dummy machine-id file, which is required for some tests.
139 touch %{sysconfdir}/machine-id
140
141 # Run the testsuite.
142 %{meson_test} || true
143 end
144
145 install
146 # Install systemd.
147 %{meson_install}
148
149 # Use the installed files to create all users and groups
150 # in one shot.
151 %{create_groups}
152
153 # Create folder in log to store the journal.
154 mkdir -pv %{BUILDROOT}/var/log/journal
155
156 # Create sysv compatible symlinks.
157 mkdir -pv %{BUILDROOT}%{sbindir}
158 ln -svf ../lib/systemd/systemd %{BUILDROOT}/%{sbindir}/init
159 ln -svf ../lib/systemd/systemd %{BUILDROOT}/%{bindir}/systemd
160 ln -svf ../bin/systemctl %{BUILDROOT}/%{sbindir}/reboot
161 ln -svf ../bin/systemctl %{BUILDROOT}/%{sbindir}/halt
162 ln -svf ../bin/systemctl %{BUILDROOT}/%{sbindir}/poweroff
163 ln -svf ../bin/systemctl %{BUILDROOT}/%{sbindir}/shutdown
164
165 # Create empty machine-id file.
166 touch %{BUILDROOT}/etc/machine-id
167
168 # Copy locale and console settings
169 mkdir -pv %{BUILDROOT}%{sysconfdir}
170 cp -vf %{DIR_SOURCE}/{locale,vconsole}.conf %{BUILDROOT}%{sysconfdir}
171
172 # Recreate all targets
173 rm -rfv %{BUILDROOT}/%{sysconfdir}/systemd/system/*.target.wants
174 for i in basic.target.wants default.target.wants dbus.target.wants getty.target.wants \
175 multi-user.target.wants syslog.target.wants; do
176 mkdir -pv %{BUILDROOT}/%{sysconfdir}/systemd/system/${i} || exit 1
177 done
178
179 # Remove runlevel targets and graphical.target
180 rm -rfv %{BUILDROOT}%{unitdir}/runlevel*
181 rm -rfv %{BUILDROOT}%{unitdir}/graphical.target
182
183 # Remove service files for utmp update.
184 rm -rvf %{BUILDROOT}%{unitdir}/systemd-update-utmp-*.service
185 rm -rvf %{BUILDROOT}%{unitdir}/shutdown.target.wants/systemd-update-utmp-*.service
186
187 # Set default target to multi-user
188 ln -svf multi-user.target %{BUILDROOT}%{unitdir}/default.target
189
190 # Replace absolute symlinks by relative ones.
191 cd %{BUILDROOT}%{unitdir}/../user
192 for i in bluetooth local-fs paths printer remote-fs shutdown smartcard sockets sound swap timers; do
193 ln -svf ../system/${i}.target ${i}.target || exit 1
194 done
195
196 # Remove .so file for the shared library, it's not supposed to be used for anything.
197 rm -rvf %{BUILDROOT}%{prefix}/lib/systemd/libsystemd-shared.so
198
199 # Remove tmpfile for X11
200 rm -rfv %{BUILDROOT}/usr/lib/tmpfiles.d/x11.conf
201
202 # Drop X11 related config files
203 rm -rvf %{BUILDROOT}%{sysconfdir}/X11
204
205 # Remove unneeded stuff for xdg
206 rm -rfv %{BUILDROOT}/etc/xdg
207
208 # Remove unneeded stuff for rpm.
209 rm -rvf %{BUILDROOT}/etc/rpm
210 rm -rvf %{BUILDROOT}/usr/lib/rpm
211
212 # Drop ZSH related files
213 rm -rvf %{BUILDROOT}%{datadir}/zsh
214
215 # Use journald. Enable the import of kernel messages.
216 # Stop forwarding to a syslog daemon.
217 sed \
218 -e "s/^#ForwardToSyslog=.*$/ForwardToSyslog=no/" \
219 -e "s/^#ImportKernel=.*$/ImportKernel=yes/" \
220 -i %{BUILDROOT}/etc/systemd/journald.conf
221
222 # Remove udev rules for "predictable" network device renaming.
223 # http://www.freedesktop.org/wiki/Software/systemd/PredictableNetworkInterfaceNames/
224 rm -vf %{BUILDROOT}/usr/lib/udev/rules.d/80-net-name-slot.rules
225
226 # Don't let udev set up any networking
227 rm -vf %{BUILDROOT}/usr/lib/udev/rules.d/80-net-setup-link.rules
228
229 mkdir -pv %{BUILDROOT}/var/log/journal
230 chown root:systemd-journal %{BUILDROOT}/var/log/journal
231
232 # Create empty environment file.
233 touch %{BUILDROOT}%{sysconfdir}/environment
234 end
235 end
236
237 create_groups
238 # Create the sysusers folder in the jail.
239 mkdir -pv %{sysusersdir}
240
241 # Copy all sysusers files from BUILDROOT into the jail's sysusers directory.
242 install -v -m 644 %{BUILDROOT}%{sysusersdir}/*.conf %{sysusersdir}
243
244 # We do not have a libsystemd or systemd-sysusers binary, so
245 # call the installed one inside BUILDROOT to create all users and
246 # groups in one shot.
247 LD_LIBRARY_PATH="%{BUILDROOT}%{libdir}/systemd/" \
248 %{BUILDROOT}%{bindir}/systemd-sysusers
249 end
250
251 packages
252 package %{name}
253 requires
254 dbus
255 hwdata
256 python3-cairo
257 python3-dbus
258 python3-gobject3
259 %{name}-basetools = %{thisver}
260 %{name}-libs = %{thisver}
261 util-linux >= 2.19
262 end
263
264 provides
265 /bin/systemctl
266 /bin/systemd
267 /sbin/halt
268 /sbin/init
269 /sbin/poweroff
270 /sbin/reboot
271 /sbin/shutdown
272
273 udev = %{thisver}
274 systemd-units = %{thisver}
275
276 syslog
277 end
278
279 conflicts
280 bash-completion < 2.1
281 dracut < 019
282 filesystem < 002
283 rsyslog < 5.8.6-4
284 setup < 3.0-13
285 upstart
286 end
287
288 obsoletes
289 udev < 183
290 systemd-units <= 242
291 end
292
293 configfiles
294 /etc/locale.conf
295 /etc/machine-id
296 /etc/systemd/journald.conf
297 /etc/systemd/logind.conf
298 /etc/systemd/system.conf
299 /etc/systemd/user.conf
300 /etc/udev/udev.conf
301 /etc/vconsole.conf
302 end
303
304 script postin
305 # Reexec systemd daemon.
306 /usr/bin/systemctl daemon-reexec > /dev/null 2>&1 || :
307
308 # Automatically spawn a getty on TTY1
309 /usr/bin/systemctl enable getty@.service >/dev/null 2>&1 || :
310
311 # Enable targed to mount all remote filesystems.
312 /usr/bin/systemctl enable remote-fs.target >/dev/null 2>&1 || :
313 end
314
315 script preup
316 # Be sure to stop the old udev before updating.
317 /usr/bin/systemctl stop udev.service udev-trigger.service \
318 udev-control.socket udev-kernel.socket >/dev/null 2>&1 || :
319
320 %{create_groups}
321 end
322
323 script postup
324 # Re-exec systemd after update.
325 /usr/bin/systemctl daemon-reexec >/dev/null 2>&1 || :
326
327 # Restart login service after update
328 /usr/bin/systemctl daemon-reload >/dev/null 2>&1 || :
329 /usr/bin/systemctl try-restart systemd-logind.service >/dev/null 2>&1 || :
330
331 # Use the new journald configuration file and restart the service.
332 if ! grep -xq ImportKernel=yes /etc/systemd/journald.conf ; then
333 mv /etc/systemd/journald.conf.paknew /etc/systemd/journald.conf >/dev/null 2>&1 || :
334 /usr/bin/systemctl restart systemd-journald.service >/dev/null 2>&1 || :
335 fi
336 end
337
338 # Be sure to start the new udev after everything is done.
339 script posttransup
340 /usr/bin/systemctl start systemd-udev.service >/dev/null 2>&1 || :
341 end
342 end
343
344 package %{name}-basetools
345 summary = Basetools from the systemd package, like sysuses and tmpfiles.
346 description
347 This package contains some very basic tools from systemd like
348 systemd-sysusers and systemd-tmpfiles.
349
350 They mostly are required in a very early stage and shipping them
351 in an own package allows us to handle this properly.
352 end
353
354 provides
355 systemd-sysusers = %{thisver}
356 systemd-tmpfiles = %{thisver}
357 end
358
359 requires
360 %{name}-libs = %{thisver}
361 end
362
363 files
364 %{bindir}/%{name}-sysusers
365 %{bindir}/%{name}-tmpfiles
366 %{mandir}/man1/%{name}-sysusers*
367 %{mandir}/man1/%{name}-tmpfiles*
368
369 # Only ship the sysusers.d folder without
370 # any config files.
371 %{sysusersdir}
372 !%{sysusersdir}/*.conf
373 end
374 end
375
376 package %{name}-libs
377 template LIBS
378
379 groups += Base
380
381 prerequires
382 /etc/nsswitch.conf
383 end
384
385 provides
386 nss-myhostname = %{thisver}
387 end
388
389 obsoletes
390 nss-myhostname <= 0.3-3
391 systemd-compat-libs < 230
392 end
393
394 conflicts
395 # Ensure that the version of systemd matches systemd-libs.
396 systemd > %{thisver}
397 systemd < %{thisver}
398 end
399
400 files += \
401 %{libdir}/%{name}
402
403 # Add myhostname to the hosts line of /etc/nsswitch.conf
404 script postin
405 if [ -f "/etc/nsswitch.conf" ]; then
406 sed -i.bak -e '
407 /^hosts:/ !b
408 /\<myhostname\>/ b
409 s/[[:blank:]]*$/ myhostname/
410 ' /etc/nsswitch.conf
411 fi
412 end
413
414 # Remove myhostname from the hosts line of /etc/nsswitch.conf
415 script postun
416 if [ -f "/etc/nsswitch.conf" ]; then
417 sed -i.bak -e '
418 /^hosts:/ !b
419 s/[[:blank:]]\+myhostname\>//
420 ' /etc/nsswitch.conf
421 fi
422 end
423 end
424
425 package %{name}-devel
426 template DEVEL
427
428 files += %{prefix}/lib/pakfire/macros/
429 end
430
431 package libudev
432 summary = Libraries for adding libudev support to applications.
433 description
434 This package contains the libraries that make it easier to use libudev
435 functionality from applications.
436 end
437 license = LGPLv2+
438
439 conflicts
440 filesystem < 002
441 end
442
443 files
444 %{libdir}/lib*udev*.so.*
445 %{libidr}/girepository*/
446 end
447 end
448
449 package libudev-devel
450 summary = Header files for adding libudev support to applications.
451 description
452 This package contains the header and pkg-config files for developing
453 applications using libudev functionality.
454 end
455 license = LGPLv2+
456
457 conflicts
458 filesystem < 002
459 end
460
461 files
462 %{libdir}/lib*udev*.so
463 %{libdir}/pkgconfig/lib*udev.pc
464 %{libdir}/pkgconfig/gudev*
465 %{includedir}/lib*udev.h
466 %{includedir}/gudev*
467 %{datadir}/gir-*
468 %{datadir}/gtk-doc/html/gudev
469 end
470 end
471
472 package %{name}-debuginfo
473 template DEBUGINFO
474 end
475 end