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