]> git.ipfire.org Git - ipfire-3.x.git/blame - systemd/systemd.nm
systemd: Conflict setup < 3.0-13 for /etc/environment
[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
dc322253 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
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
dc322253 266 setup < 3.0-13
6793fec1
MT
267 upstart
268 end
ef438375 269
2d01364a
SS
270 obsoletes
271 udev < 183
272 end
273
274 configfiles
275 /etc/locale.conf
276 /etc/machine-id
277 /etc/systemd/journald.conf
278 /etc/systemd/logind.conf
279 /etc/systemd/system.conf
280 /etc/systemd/user.conf
281 /etc/udev/udev.conf
282 /etc/vconsole.conf
283 end
284
285 script prein
8823e1f9 286 %{create_groups}
2d01364a
SS
287 end
288
1d40b321 289 script postin
1d40b321 290 # Reexec systemd daemon.
6793fec1 291 /usr/bin/systemctl daemon-reexec > /dev/null 2>&1 || :
1d40b321
SS
292
293 # Make sure pam_systemd is enabled
6793fec1
MT
294 if ! grep -q pam_systemd /etc/pam.d/system-auth-ac ; then
295 authconfig --update --nostart >/dev/null 2>&1 || :
1d40b321
SS
296
297 # Try harder
6793fec1 298 grep -q pam_systemd /etc/pam.d/system-auth-ac || authconfig --updateall --nostart >/dev/null 2>&1 || :
1d40b321 299 fi
5e462903
MT
300
301 /usr/bin/systemctl enable \
302 getty@.service \
2dfd22f3 303 serial-getty@.service \
50affca1 304 remote-fs.target \
5e462903
MT
305 systemd-readahead-replay.service \
306 systemd-readahead-collect.service \
307 >/dev/null 2>&1 || :
1d40b321
SS
308 end
309
2d01364a
SS
310 script preup
311 # Be sure to stop the old udev before updating.
312 /usr/bin/systemctl stop udev.service udev-trigger.service \
313 udev-control.socket udev-kernel.socket >/dev/null 2>&1 || :
8823e1f9
SS
314
315 %{create_groups}
2d01364a
SS
316 end
317
1d40b321 318 script postup
56f48716
SS
319 # Re-exec systemd after update.
320 /usr/bin/systemctl daemon-reexec
321
1d40b321 322 # Restart login service after update
5e462903 323 /usr/bin/systemctl daemon-reload >/dev/null 2>&1 || :
6793fec1 324 /usr/bin/systemctl try-restart systemd-logind.service >/dev/null 2>&1 || :
755fe986
SS
325
326 # Use the new journald configuration file and restart the service.
327 if ! grep -xq ImportKernel=yes /etc/systemd/journald.conf ; then
328 mv /etc/systemd/journald.conf.paknew /etc/systemd/journald.conf
329 /usr/bin/systemctl restart systemd-journald.service >/dev/null 2>&1 || :
330 fi
2dfd22f3
SS
331
332 # Enable spawning getty's on serial devices.
333 systemctl enable serial-getty@.service >/dev/null 2>&1 || :
1d40b321 334 end
2d01364a
SS
335
336 # Be sure to start the new udev after everything is done.
337 script posttransup
338 /usr/bin/systemctl start systemd-udev.service >/dev/null 2>&1 || :
339 end
802ea3af 340 end
1f9bc2f0 341
802ea3af
MT
342 # Package information for systemd-units
343 package %{name}-units
344 summary = Configuration files, directories and installation tool for systemd.
345 description
346 This package contains all needed configuration files, directories
347 and installation / configuration tool for systemd.
348 end
1f9bc2f0 349
5e38e9bb
SS
350 prerequires
351 /bin/sh
352 coreutils
353 end
354
6793fec1 355 provides
802ea3af 356 /bin/systemctl
802ea3af 357 end
1d40b321 358
6793fec1
MT
359 conflicts
360 filesystem < 002
1d40b321
SS
361 end
362
6793fec1
MT
363 files
364 %{sysconfdir}/etc/systemd/system
365 %{sysconfdir}/tmpfiles.d
366 %{sysconfdir}/bash_completion.d/systemctl-bash-completion.sh
367 %{unitdir}
368 %{bindir}/systemctl
369 %{bindir}/systemd-tmpfiles
370 %{mandir}/man1/systemctl.*
1d40b321
SS
371 end
372
373 script postup
374 # Reload service files
6793fec1 375 /usr/bin/systemctl daemon-reload > /dev/null 2>&1 || :
1d40b321 376 end
802ea3af 377 end
1f9bc2f0 378
1191e383
SS
379 package %{name}-libs
380 template LIBS
519776fd
SS
381
382 groups += Base
383
384 prerequires
385 /etc/nsswitch.conf
386 end
387
388 provides
389 nss-myhostname = %{thisver}
390 end
391
392 obsoletes
393 nss-myhostname <= 0.3-3
e52f3c8b 394 systemd-compat-libs < 230
519776fd
SS
395 end
396
397 conflicts
519776fd
SS
398 # Ensure that the version of systemd matches systemd-libs.
399 systemd > %{thisver}
400 systemd < %{thisver}
401 end
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
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