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