]> git.ipfire.org Git - people/stevee/ipfire-3.x.git/blame - systemd/systemd.nm
systemd: Enable sysusers subsystem
[people/stevee/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
0b0c2be2 7version = 253
20943f41 8release = 2
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
c9dd9f9b 21source_dl = https://github.com/%{name}/%{name}/archive/v%{version}.tar.gz#/
802ea3af
MT
22
23build
6793fec1
MT
24 unitdir = %{prefix}/lib/systemd/system
25
557068de
SS
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
802ea3af 31 requires
c9dd9f9b
SS
32 # Testsuite
33 /usr/bin/getfacl
34 /usr/bin/mount
35 /usr/bin/tree
36 /usr/bin/umount
37
b329a155 38 attr-devel
2d01364a 39 cryptsetup-luks-devel >= 1.4.2
802ea3af 40 dbus-devel
fe6e3719
SS
41 docbook-utils
42 docbook-xsl
8823e1f9 43 elfutils-devel
bfabb323 44 gettext-devel
2d01364a
SS
45 glib2-devel
46 gobject-introspection-devel >= 1.31
47 gperf
48 hwdata
c9dd9f9b 49 intltool >= 0.51.0
884e7dc4 50 kbd
7e97512a 51 kmod-devel >= 15
2a824e90 52 libacl-devel
2d01364a 53 libblkid-devel
802ea3af 54 libcap-devel
4990bf7f 55 libgcrypt-devel
cefc1a9b 56 libmount-devel >= 2.34-2
cbaab290 57 libseccomp-devel
cefc1a9b 58 libuuid-devel >= 2.34-2
c1bf5bac 59 libxcrypt-devel
8823e1f9 60 m4
cefc1a9b
SS
61 meson >= 0.50.1
62 ninja >= 1.9.0
802ea3af 63 pam-devel
2d01364a 64 pciutils-devel
63af7a71 65 python3-devel
884e7dc4 66 python3-jinja2
63af7a71 67 python3-lxml
cefc1a9b 68 setup >= 3.0-13
2d01364a 69 usbutils
53a325cb 70 vala
6793fec1 71 xz-devel
8823e1f9 72 zlib-devel
802ea3af
MT
73 end
74
c9dd9f9b
SS
75 export LD_LIBRARY_PATH = %{DIR_APP}/.libs
76
aaa616e7
SS
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 \
aaa616e7
SS
91 -Dtimesyncd=false \
92 -Dtimedated=false \
884e7dc4 93 -Dpolkit=false
802ea3af
MT
94
95 prepare_cmds
8823e1f9 96 %{create_groups}
aaa616e7
SS
97 end
98
99 build
100 # Call meson and pass configure options.
cefc1a9b 101 %{meson} %{configure_options}
c9dd9f9b 102
aaa616e7 103 # Call ninja to start build
cefc1a9b 104 %{meson_build}
c9dd9f9b
SS
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.
aaa616e7 112 ninja test -v %{PARALLELISMFLAGS} -C build || true
802ea3af
MT
113 end
114
aaa616e7 115 install
cefc1a9b
SS
116 # Install systemd.
117 %{meson_install}
aaa616e7 118
755fe986
SS
119 # Create folder in log to store the journal.
120 mkdir -pv %{BUILDROOT}/var/log/journal
121
802ea3af 122 # Create sysv compatible symlinks.
6793fec1
MT
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
802ea3af
MT
130
131 # Create empty machine-id file.
132 touch %{BUILDROOT}/etc/machine-id
133
134 # Copy locale and console settings
6793fec1
MT
135 mkdir -pv %{BUILDROOT}%{sysconfdir}
136 cp -vf %{DIR_SOURCE}/{locale,vconsole}.conf %{BUILDROOT}%{sysconfdir}
802ea3af
MT
137
138 # Recreate all targets
0976fbe4
SS
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
6793fec1 143 done
802ea3af
MT
144
145 # Remove runlevel targets and graphical.target
6793fec1
MT
146 rm -rfv %{BUILDROOT}%{unitdir}/runlevel*
147 rm -rfv %{BUILDROOT}%{unitdir}/graphical.target
802ea3af 148
2d01364a
SS
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
802ea3af 153 # Set default target to multi-user
6793fec1 154 ln -svf multi-user.target %{BUILDROOT}%{unitdir}/default.target
802ea3af
MT
155
156 # Replace absolute symlinks by relative ones.
6793fec1 157 cd %{BUILDROOT}%{unitdir}/../user
7f84cbd5 158 for i in bluetooth local-fs paths printer remote-fs shutdown smartcard sockets sound swap timers; do
6793fec1
MT
159 ln -svf ../system/${i}.target ${i}.target || exit 1
160 done
161
e52f3c8b
SS
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
802ea3af
MT
165 # Remove tmpfile for X11
166 rm -rfv %{BUILDROOT}/usr/lib/tmpfiles.d/x11.conf
167
e52f3c8b
SS
168 # Drop X11 related config files
169 rm -rvf %{BUILDROOT}%{sysconfdir}/X11
170
7f84cbd5
SS
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
8823e1f9 176 rm -rvf %{BUILDROOT}/usr/lib/rpm
755fe986 177
e52f3c8b
SS
178 # Drop ZSH related files
179 rm -rvf %{BUILDROOT}%{datadir}/zsh
180
755fe986
SS
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
f2ada565 187
4f209325
MT
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
8823e1f9 191
c4296a3d
MT
192 # Don't let udev set up any networking
193 rm -vf %{BUILDROOT}/usr/lib/udev/rules.d/80-net-setup-link.rules
194
8823e1f9
SS
195 mkdir -pv %{BUILDROOT}/var/log/journal
196 chown root:systemd-journal %{BUILDROOT}/var/log/journal
20bbeabf
SS
197
198 # Create empty environment file.
199 touch %{BUILDROOT}%{sysconfdir}/environment
802ea3af
MT
200 end
201end
202
8823e1f9
SS
203create_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 || :
747db4fd
SS
209 getent group input >/dev/null || groupadd -r input || :
210 getent group utmp >/dev/null || groupadd -r -g 22 utmp || :
8823e1f9
SS
211
212 # Create group for journald.
213 getent group systemd-journal >/dev/null || /usr/sbin/groupadd -r systemd-journal
214end
215
557068de
SS
216quality-agent
217 whitelist_rpath
218 %{prefix}/lib/systemd
219 end
220end
221
802ea3af
MT
222packages
223 package %{name}
514357ad
SS
224 requires
225 dbus
2d01364a 226 hwdata
c1bf5bac
MT
227 python3-cairo
228 python3-dbus
229 python3-gobject3
230 %{name}-libs = %{thisver}
231 util-linux >= 2.19
514357ad 232 end
1d40b321 233
216fde50 234 provides
884e7dc4 235 /bin/systemctl
216fde50
SS
236 /bin/systemd
237 /sbin/halt
238 /sbin/init
239 /sbin/poweroff
240 /sbin/reboot
241 /sbin/shutdown
2d01364a
SS
242
243 udev = %{thisver}
884e7dc4
MT
244 systemd-units = %{thisver}
245
246 syslog
216fde50
SS
247 end
248
6793fec1 249 conflicts
7f84cbd5 250 bash-completion < 2.1
2d01364a 251 dracut < 019
6793fec1 252 filesystem < 002
755fe986 253 rsyslog < 5.8.6-4
dc322253 254 setup < 3.0-13
6793fec1
MT
255 upstart
256 end
ef438375 257
2d01364a
SS
258 obsoletes
259 udev < 183
cefc1a9b 260 systemd-units <= 242
2d01364a
SS
261 end
262
263 configfiles
264 /etc/locale.conf
265 /etc/machine-id
266 /etc/systemd/journald.conf
267 /etc/systemd/logind.conf
268 /etc/systemd/system.conf
269 /etc/systemd/user.conf
270 /etc/udev/udev.conf
271 /etc/vconsole.conf
272 end
273
274 script prein
8823e1f9 275 %{create_groups}
2d01364a
SS
276 end
277
1d40b321 278 script postin
1d40b321 279 # Reexec systemd daemon.
6793fec1 280 /usr/bin/systemctl daemon-reexec > /dev/null 2>&1 || :
1d40b321 281
56a7990e
SS
282 # Automatically spawn a getty on TTY1
283 /usr/bin/systemctl enable getty@.service >/dev/null 2>&1 || :
284
285 # Enable targed to mount all remote filesystems.
286 /usr/bin/systemctl enable remote-fs.target >/dev/null 2>&1 || :
1d40b321
SS
287 end
288
2d01364a
SS
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 || :
8823e1f9
SS
293
294 %{create_groups}
2d01364a
SS
295 end
296
1d40b321 297 script postup
56f48716 298 # Re-exec systemd after update.
e296cea0 299 /usr/bin/systemctl daemon-reexec >/dev/null 2>&1 || :
56f48716 300
1d40b321 301 # Restart login service after update
5e462903 302 /usr/bin/systemctl daemon-reload >/dev/null 2>&1 || :
6793fec1 303 /usr/bin/systemctl try-restart systemd-logind.service >/dev/null 2>&1 || :
755fe986
SS
304
305 # Use the new journald configuration file and restart the service.
306 if ! grep -xq ImportKernel=yes /etc/systemd/journald.conf ; then
e296cea0 307 mv /etc/systemd/journald.conf.paknew /etc/systemd/journald.conf >/dev/null 2>&1 || :
755fe986
SS
308 /usr/bin/systemctl restart systemd-journald.service >/dev/null 2>&1 || :
309 fi
1d40b321 310 end
2d01364a
SS
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
802ea3af 316 end
1f9bc2f0 317
1191e383
SS
318 package %{name}-libs
319 template LIBS
519776fd
SS
320
321 groups += Base
322
323 prerequires
324 /etc/nsswitch.conf
325 end
326
327 provides
328 nss-myhostname = %{thisver}
329 end
330
331 obsoletes
332 nss-myhostname <= 0.3-3
e52f3c8b 333 systemd-compat-libs < 230
519776fd
SS
334 end
335
336 conflicts
519776fd
SS
337 # Ensure that the version of systemd matches systemd-libs.
338 systemd > %{thisver}
339 systemd < %{thisver}
340 end
341
342 # Add myhostname to the hosts line of /etc/nsswitch.conf
343 script postin
344 if [ -f "/etc/nsswitch.conf" ]; then
345 sed -i.bak -e '
346 /^hosts:/ !b
347 /\<myhostname\>/ b
348 s/[[:blank:]]*$/ myhostname/
349 ' /etc/nsswitch.conf
350 fi
351 end
352
353 # Remove myhostname from the hosts line of /etc/nsswitch.conf
354 script postun
355 if [ -f "/etc/nsswitch.conf" ]; then
356 sed -i.bak -e '
357 /^hosts:/ !b
358 s/[[:blank:]]\+myhostname\>//
359 ' /etc/nsswitch.conf
360 fi
361 end
1191e383
SS
362 end
363
802ea3af
MT
364 package %{name}-devel
365 template DEVEL
6793fec1
MT
366
367 files += %{prefix}/lib/pakfire/macros/
802ea3af 368 end
1f9bc2f0 369
2d01364a
SS
370 package libudev
371 summary = Libraries for adding libudev support to applications.
372 description
373 This package contains the libraries that make it easier to use libudev
374 functionality from applications.
375 end
376 license = LGPLv2+
377
378 conflicts
379 filesystem < 002
380 end
381
382 files
1191e383 383 %{libdir}/lib*udev*.so.*
2d01364a
SS
384 %{libidr}/girepository*/
385 end
386 end
387
388 package libudev-devel
389 summary = Header files for adding libudev support to applications.
390 description
391 This package contains the header and pkg-config files for developing
392 applications using libudev functionality.
393 end
394 license = LGPLv2+
395
396 conflicts
397 filesystem < 002
398 end
399
400 files
a8aa3ead 401 %{libdir}/lib*udev*.so
73eb4724 402 %{libdir}/pkgconfig/lib*udev.pc
2d01364a 403 %{libdir}/pkgconfig/gudev*
a8aa3ead 404 %{includedir}/lib*udev.h
2d01364a
SS
405 %{includedir}/gudev*
406 %{datadir}/gir-*
407 %{datadir}/gtk-doc/html/gudev
408 end
409 end
410
1f9bc2f0
MT
411 package %{name}-debuginfo
412 template DEBUGINFO
413 end
802ea3af 414end