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