]> git.ipfire.org Git - people/stevee/ipfire-3.x.git/blob - systemd/systemd.nm
a1c3677d056690061408a318537367b4fd11f97d
[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 = 2
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 setup < 3.0-13
267 upstart
268 end
269
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
286 %{create_groups}
287 end
288
289 script postin
290 # Reexec systemd daemon.
291 /usr/bin/systemctl daemon-reexec > /dev/null 2>&1 || :
292
293 # Make sure pam_systemd is enabled
294 if ! grep -q pam_systemd /etc/pam.d/system-auth-ac ; then
295 authconfig --update --nostart >/dev/null 2>&1 || :
296
297 # Try harder
298 grep -q pam_systemd /etc/pam.d/system-auth-ac || authconfig --updateall --nostart >/dev/null 2>&1 || :
299 fi
300
301 /usr/bin/systemctl enable \
302 getty@.service \
303 serial-getty@.service \
304 remote-fs.target \
305 systemd-readahead-replay.service \
306 systemd-readahead-collect.service \
307 >/dev/null 2>&1 || :
308 end
309
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 || :
314
315 %{create_groups}
316 end
317
318 script postup
319 # Re-exec systemd after update.
320 /usr/bin/systemctl daemon-reexec
321
322 # Restart login service after update
323 /usr/bin/systemctl daemon-reload >/dev/null 2>&1 || :
324 /usr/bin/systemctl try-restart systemd-logind.service >/dev/null 2>&1 || :
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
331
332 # Enable spawning getty's on serial devices.
333 systemctl enable serial-getty@.service >/dev/null 2>&1 || :
334 end
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
340 end
341
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
349
350 prerequires
351 /bin/sh
352 coreutils
353 end
354
355 provides
356 /bin/systemctl
357 end
358
359 conflicts
360 filesystem < 002
361 end
362
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.*
371 end
372
373 script postup
374 # Reload service files
375 /usr/bin/systemctl daemon-reload > /dev/null 2>&1 || :
376 end
377 end
378
379 package %{name}-libs
380 template LIBS
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
394 systemd-compat-libs < 230
395 end
396
397 conflicts
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
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