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