]> git.ipfire.org Git - ipfire-3.x.git/blame - systemd/systemd.nm
json-c: Update to version 0.17-20230812
[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
5fde2a87 7version = 254
fdc5bfe8 8release = 3
c8ef6def 9
802ea3af
MT
10maintainer = Stefan Schantl <stefan.schantl@ipfire.org>
11groups = System/Base
12url = http://www.freedesktop.org/wiki/Software/systemd
13license = GPLv2+
5fde2a87 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
884e7dc4 50 kbd
7e97512a 51 kmod-devel >= 15
2a824e90 52 libacl-devel
fdc5bfe8 53 libbpf-devel
2d01364a 54 libblkid-devel
802ea3af 55 libcap-devel
fdc5bfe8
MT
56 libcurl-devel
57 libfdisk-devel
4990bf7f 58 libgcrypt-devel
fdc5bfe8
MT
59 libidn-devel
60 libidn2-devel
cefc1a9b 61 libmount-devel >= 2.34-2
fdc5bfe8 62 libpwquality-devel
cbaab290 63 libseccomp-devel
cefc1a9b 64 libuuid-devel >= 2.34-2
c1bf5bac 65 libxcrypt-devel
fdc5bfe8 66 lz4-devel
8823e1f9 67 m4
cefc1a9b
SS
68 meson >= 0.50.1
69 ninja >= 1.9.0
fdc5bfe8
MT
70 openssl-devel
71 p11-kit-devel
802ea3af 72 pam-devel
2d01364a 73 pciutils-devel
63af7a71 74 python3-devel
884e7dc4 75 python3-jinja2
63af7a71 76 python3-lxml
cefc1a9b 77 setup >= 3.0-13
2d01364a 78 usbutils
53a325cb 79 vala
6793fec1 80 xz-devel
8823e1f9 81 zlib-devel
802ea3af
MT
82 end
83
c9dd9f9b
SS
84 export LD_LIBRARY_PATH = %{DIR_APP}/.libs
85
aaa616e7
SS
86 configure_options = \
87 -Dsysvinit-path= \
88 -Dsysvrcnd-path= \
da4f96f1
SS
89 -Dnobody-user=nobody \
90 -Dnobody-group=nobody \
91 -Dfallback-hostname="localhost" \
aaa616e7 92 -Dzlib=true \
e4b39d70 93 -Dman=true \
aaa616e7
SS
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 \
aaa616e7
SS
104 -Dtimesyncd=false \
105 -Dtimedated=false \
884e7dc4 106 -Dpolkit=false
802ea3af 107
da4f96f1
SS
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
aaa616e7
SS
128
129 build
130 # Call meson and pass configure options.
cefc1a9b 131 %{meson} %{configure_options}
c9dd9f9b 132
aaa616e7 133 # Call ninja to start build
cefc1a9b 134 %{meson_build}
c9dd9f9b
SS
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.
fdc5bfe8 142 %{meson_test} || true
802ea3af
MT
143 end
144
aaa616e7 145 install
cefc1a9b
SS
146 # Install systemd.
147 %{meson_install}
aaa616e7 148
da4f96f1
SS
149 # Use the installed files to create all users and groups
150 # in one shot.
151 %{create_groups}
152
755fe986
SS
153 # Create folder in log to store the journal.
154 mkdir -pv %{BUILDROOT}/var/log/journal
155
802ea3af 156 # Create sysv compatible symlinks.
6793fec1
MT
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
802ea3af
MT
164
165 # Create empty machine-id file.
166 touch %{BUILDROOT}/etc/machine-id
167
168 # Copy locale and console settings
6793fec1
MT
169 mkdir -pv %{BUILDROOT}%{sysconfdir}
170 cp -vf %{DIR_SOURCE}/{locale,vconsole}.conf %{BUILDROOT}%{sysconfdir}
802ea3af
MT
171
172 # Recreate all targets
0976fbe4
SS
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
6793fec1 177 done
802ea3af
MT
178
179 # Remove runlevel targets and graphical.target
6793fec1
MT
180 rm -rfv %{BUILDROOT}%{unitdir}/runlevel*
181 rm -rfv %{BUILDROOT}%{unitdir}/graphical.target
802ea3af 182
2d01364a
SS
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
802ea3af 187 # Set default target to multi-user
6793fec1 188 ln -svf multi-user.target %{BUILDROOT}%{unitdir}/default.target
802ea3af
MT
189
190 # Replace absolute symlinks by relative ones.
6793fec1 191 cd %{BUILDROOT}%{unitdir}/../user
7f84cbd5 192 for i in bluetooth local-fs paths printer remote-fs shutdown smartcard sockets sound swap timers; do
6793fec1
MT
193 ln -svf ../system/${i}.target ${i}.target || exit 1
194 done
195
e52f3c8b
SS
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
802ea3af
MT
199 # Remove tmpfile for X11
200 rm -rfv %{BUILDROOT}/usr/lib/tmpfiles.d/x11.conf
201
e52f3c8b
SS
202 # Drop X11 related config files
203 rm -rvf %{BUILDROOT}%{sysconfdir}/X11
204
7f84cbd5
SS
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
8823e1f9 210 rm -rvf %{BUILDROOT}/usr/lib/rpm
755fe986 211
e52f3c8b
SS
212 # Drop ZSH related files
213 rm -rvf %{BUILDROOT}%{datadir}/zsh
214
755fe986
SS
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
f2ada565 221
4f209325
MT
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
8823e1f9 225
c4296a3d
MT
226 # Don't let udev set up any networking
227 rm -vf %{BUILDROOT}/usr/lib/udev/rules.d/80-net-setup-link.rules
228
8823e1f9
SS
229 mkdir -pv %{BUILDROOT}/var/log/journal
230 chown root:systemd-journal %{BUILDROOT}/var/log/journal
20bbeabf
SS
231
232 # Create empty environment file.
233 touch %{BUILDROOT}%{sysconfdir}/environment
802ea3af
MT
234 end
235end
236
8823e1f9 237create_groups
da4f96f1
SS
238 # Create the sysusers folder in the jail.
239 mkdir -pv %{sysusersdir}
8823e1f9 240
da4f96f1
SS
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
557068de
SS
249end
250
802ea3af
MT
251packages
252 package %{name}
514357ad
SS
253 requires
254 dbus
2d01364a 255 hwdata
c1bf5bac
MT
256 python3-cairo
257 python3-dbus
258 python3-gobject3
2d448045 259 %{name}-basetools = %{thisver}
c1bf5bac
MT
260 %{name}-libs = %{thisver}
261 util-linux >= 2.19
514357ad 262 end
1d40b321 263
216fde50 264 provides
884e7dc4 265 /bin/systemctl
216fde50
SS
266 /bin/systemd
267 /sbin/halt
268 /sbin/init
269 /sbin/poweroff
270 /sbin/reboot
271 /sbin/shutdown
2d01364a
SS
272
273 udev = %{thisver}
884e7dc4
MT
274 systemd-units = %{thisver}
275
276 syslog
216fde50
SS
277 end
278
6793fec1 279 conflicts
7f84cbd5 280 bash-completion < 2.1
2d01364a 281 dracut < 019
6793fec1 282 filesystem < 002
755fe986 283 rsyslog < 5.8.6-4
dc322253 284 setup < 3.0-13
6793fec1
MT
285 upstart
286 end
ef438375 287
2d01364a
SS
288 obsoletes
289 udev < 183
cefc1a9b 290 systemd-units <= 242
2d01364a
SS
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
1d40b321 304 script postin
1d40b321 305 # Reexec systemd daemon.
6793fec1 306 /usr/bin/systemctl daemon-reexec > /dev/null 2>&1 || :
1d40b321 307
56a7990e
SS
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 || :
1d40b321
SS
313 end
314
2d01364a
SS
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 || :
8823e1f9
SS
319
320 %{create_groups}
2d01364a
SS
321 end
322
1d40b321 323 script postup
56f48716 324 # Re-exec systemd after update.
e296cea0 325 /usr/bin/systemctl daemon-reexec >/dev/null 2>&1 || :
56f48716 326
1d40b321 327 # Restart login service after update
5e462903 328 /usr/bin/systemctl daemon-reload >/dev/null 2>&1 || :
6793fec1 329 /usr/bin/systemctl try-restart systemd-logind.service >/dev/null 2>&1 || :
755fe986
SS
330
331 # Use the new journald configuration file and restart the service.
332 if ! grep -xq ImportKernel=yes /etc/systemd/journald.conf ; then
e296cea0 333 mv /etc/systemd/journald.conf.paknew /etc/systemd/journald.conf >/dev/null 2>&1 || :
755fe986
SS
334 /usr/bin/systemctl restart systemd-journald.service >/dev/null 2>&1 || :
335 fi
1d40b321 336 end
2d01364a
SS
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
802ea3af 342 end
1f9bc2f0 343
2d448045
SS
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.
da4f96f1
SS
371 %{sysusersdir}
372 !%{sysusersdir}/*.conf
2d448045
SS
373 end
374 end
375
1191e383
SS
376 package %{name}-libs
377 template LIBS
519776fd
SS
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
e52f3c8b 391 systemd-compat-libs < 230
519776fd
SS
392 end
393
394 conflicts
519776fd
SS
395 # Ensure that the version of systemd matches systemd-libs.
396 systemd > %{thisver}
397 systemd < %{thisver}
398 end
399
2d448045
SS
400 files += \
401 %{libdir}/%{name}
402
519776fd
SS
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
1191e383
SS
423 end
424
802ea3af
MT
425 package %{name}-devel
426 template DEVEL
6793fec1
MT
427
428 files += %{prefix}/lib/pakfire/macros/
802ea3af 429 end
1f9bc2f0 430
2d01364a
SS
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
1191e383 444 %{libdir}/lib*udev*.so.*
2d01364a
SS
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
a8aa3ead 462 %{libdir}/lib*udev*.so
73eb4724 463 %{libdir}/pkgconfig/lib*udev.pc
2d01364a 464 %{libdir}/pkgconfig/gudev*
a8aa3ead 465 %{includedir}/lib*udev.h
2d01364a
SS
466 %{includedir}/gudev*
467 %{datadir}/gir-*
468 %{datadir}/gtk-doc/html/gudev
469 end
470 end
471
1f9bc2f0
MT
472 package %{name}-debuginfo
473 template DEBUGINFO
474 end
802ea3af 475end