]>
Commit | Line | Data |
---|---|---|
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 | 6 | name = systemd |
5fde2a87 MT |
7 | version = 254 |
8 | release = 1 | |
c8ef6def | 9 | |
802ea3af MT |
10 | maintainer = Stefan Schantl <stefan.schantl@ipfire.org> |
11 | groups = System/Base | |
12 | url = http://www.freedesktop.org/wiki/Software/systemd | |
13 | license = GPLv2+ | |
5fde2a87 | 14 | summary = A System and Service Manager |
c8ef6def | 15 | |
802ea3af MT |
16 | description |
17 | systemd is a system and service manager for Linux, compatible with | |
c8ef6def | 18 | SysV and LSB init scripts. |
802ea3af MT |
19 | end |
20 | ||
c9dd9f9b | 21 | source_dl = https://github.com/%{name}/%{name}/archive/v%{version}.tar.gz#/ |
802ea3af MT |
22 | |
23 | build | |
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= \ | |
da4f96f1 SS |
80 | -Dnobody-user=nobody \ |
81 | -Dnobody-group=nobody \ | |
82 | -Dfallback-hostname="localhost" \ | |
aaa616e7 | 83 | -Dzlib=true \ |
e4b39d70 | 84 | -Dman=true \ |
aaa616e7 SS |
85 | -Dsmack=false \ |
86 | -Dbacklight=false \ | |
87 | -Dfirstboot=false \ | |
88 | -Dhibernate=false \ | |
89 | -Dimportd=false \ | |
90 | -Dlibiptc=false \ | |
91 | -Dmachined=false \ | |
92 | -Dnetworkd=false \ | |
93 | -Dresolve=false \ | |
94 | -Dportabled=false \ | |
aaa616e7 SS |
95 | -Dtimesyncd=false \ |
96 | -Dtimedated=false \ | |
884e7dc4 | 97 | -Dpolkit=false |
802ea3af | 98 | |
da4f96f1 SS |
99 | # Assign group ids |
100 | configure_options += \ | |
101 | -Dadm-gid=4 \ | |
102 | -Dtty-gid=5 \ | |
103 | -Ddisk-gid=6 \ | |
104 | -Dlp-gid=7 \ | |
105 | -Dkmem-gid=9 \ | |
106 | -Dwheel-gid=10 \ | |
107 | -Dcdrom-gid=11 \ | |
108 | -Ddialout-gid=18 \ | |
109 | -Dutmp-gid=22 \ | |
110 | -Dtape-gid=33 \ | |
111 | -Dkvm-gid=36 \ | |
112 | -Dvideo-gid=39 \ | |
113 | -Daudio-gid=63 \ | |
114 | -Dusers-gid=100 \ | |
115 | -Dinput-gid=104 \ | |
116 | -Drender-gid=105 \ | |
117 | -Dsgx-gid=106 \ | |
118 | -Dsystemd-journal-gid=190 | |
aaa616e7 SS |
119 | |
120 | build | |
121 | # Call meson and pass configure options. | |
cefc1a9b | 122 | %{meson} %{configure_options} |
c9dd9f9b | 123 | |
aaa616e7 | 124 | # Call ninja to start build |
cefc1a9b | 125 | %{meson_build} |
c9dd9f9b SS |
126 | end |
127 | ||
128 | test | |
129 | # Create dummy machine-id file, which is required for some tests. | |
130 | touch %{sysconfdir}/machine-id | |
131 | ||
132 | # Run the testsuite. | |
aaa616e7 | 133 | ninja test -v %{PARALLELISMFLAGS} -C build || true |
802ea3af MT |
134 | end |
135 | ||
aaa616e7 | 136 | install |
cefc1a9b SS |
137 | # Install systemd. |
138 | %{meson_install} | |
aaa616e7 | 139 | |
da4f96f1 SS |
140 | # Use the installed files to create all users and groups |
141 | # in one shot. | |
142 | %{create_groups} | |
143 | ||
755fe986 SS |
144 | # Create folder in log to store the journal. |
145 | mkdir -pv %{BUILDROOT}/var/log/journal | |
146 | ||
802ea3af | 147 | # Create sysv compatible symlinks. |
6793fec1 MT |
148 | mkdir -pv %{BUILDROOT}%{sbindir} |
149 | ln -svf ../lib/systemd/systemd %{BUILDROOT}/%{sbindir}/init | |
150 | ln -svf ../lib/systemd/systemd %{BUILDROOT}/%{bindir}/systemd | |
151 | ln -svf ../bin/systemctl %{BUILDROOT}/%{sbindir}/reboot | |
152 | ln -svf ../bin/systemctl %{BUILDROOT}/%{sbindir}/halt | |
153 | ln -svf ../bin/systemctl %{BUILDROOT}/%{sbindir}/poweroff | |
154 | ln -svf ../bin/systemctl %{BUILDROOT}/%{sbindir}/shutdown | |
802ea3af MT |
155 | |
156 | # Create empty machine-id file. | |
157 | touch %{BUILDROOT}/etc/machine-id | |
158 | ||
159 | # Copy locale and console settings | |
6793fec1 MT |
160 | mkdir -pv %{BUILDROOT}%{sysconfdir} |
161 | cp -vf %{DIR_SOURCE}/{locale,vconsole}.conf %{BUILDROOT}%{sysconfdir} | |
802ea3af MT |
162 | |
163 | # Recreate all targets | |
0976fbe4 SS |
164 | rm -rfv %{BUILDROOT}/%{sysconfdir}/systemd/system/*.target.wants |
165 | for i in basic.target.wants default.target.wants dbus.target.wants getty.target.wants \ | |
166 | multi-user.target.wants syslog.target.wants; do | |
167 | mkdir -pv %{BUILDROOT}/%{sysconfdir}/systemd/system/${i} || exit 1 | |
6793fec1 | 168 | done |
802ea3af MT |
169 | |
170 | # Remove runlevel targets and graphical.target | |
6793fec1 MT |
171 | rm -rfv %{BUILDROOT}%{unitdir}/runlevel* |
172 | rm -rfv %{BUILDROOT}%{unitdir}/graphical.target | |
802ea3af | 173 | |
2d01364a SS |
174 | # Remove service files for utmp update. |
175 | rm -rvf %{BUILDROOT}%{unitdir}/systemd-update-utmp-*.service | |
176 | rm -rvf %{BUILDROOT}%{unitdir}/shutdown.target.wants/systemd-update-utmp-*.service | |
177 | ||
802ea3af | 178 | # Set default target to multi-user |
6793fec1 | 179 | ln -svf multi-user.target %{BUILDROOT}%{unitdir}/default.target |
802ea3af MT |
180 | |
181 | # Replace absolute symlinks by relative ones. | |
6793fec1 | 182 | cd %{BUILDROOT}%{unitdir}/../user |
7f84cbd5 | 183 | for i in bluetooth local-fs paths printer remote-fs shutdown smartcard sockets sound swap timers; do |
6793fec1 MT |
184 | ln -svf ../system/${i}.target ${i}.target || exit 1 |
185 | done | |
186 | ||
e52f3c8b SS |
187 | # Remove .so file for the shared library, it's not supposed to be used for anything. |
188 | rm -rvf %{BUILDROOT}%{prefix}/lib/systemd/libsystemd-shared.so | |
189 | ||
802ea3af MT |
190 | # Remove tmpfile for X11 |
191 | rm -rfv %{BUILDROOT}/usr/lib/tmpfiles.d/x11.conf | |
192 | ||
e52f3c8b SS |
193 | # Drop X11 related config files |
194 | rm -rvf %{BUILDROOT}%{sysconfdir}/X11 | |
195 | ||
7f84cbd5 SS |
196 | # Remove unneeded stuff for xdg |
197 | rm -rfv %{BUILDROOT}/etc/xdg | |
198 | ||
199 | # Remove unneeded stuff for rpm. | |
200 | rm -rvf %{BUILDROOT}/etc/rpm | |
8823e1f9 | 201 | rm -rvf %{BUILDROOT}/usr/lib/rpm |
755fe986 | 202 | |
e52f3c8b SS |
203 | # Drop ZSH related files |
204 | rm -rvf %{BUILDROOT}%{datadir}/zsh | |
205 | ||
755fe986 SS |
206 | # Use journald. Enable the import of kernel messages. |
207 | # Stop forwarding to a syslog daemon. | |
208 | sed \ | |
209 | -e "s/^#ForwardToSyslog=.*$/ForwardToSyslog=no/" \ | |
210 | -e "s/^#ImportKernel=.*$/ImportKernel=yes/" \ | |
211 | -i %{BUILDROOT}/etc/systemd/journald.conf | |
f2ada565 | 212 | |
4f209325 MT |
213 | # Remove udev rules for "predictable" network device renaming. |
214 | # http://www.freedesktop.org/wiki/Software/systemd/PredictableNetworkInterfaceNames/ | |
215 | rm -vf %{BUILDROOT}/usr/lib/udev/rules.d/80-net-name-slot.rules | |
8823e1f9 | 216 | |
c4296a3d MT |
217 | # Don't let udev set up any networking |
218 | rm -vf %{BUILDROOT}/usr/lib/udev/rules.d/80-net-setup-link.rules | |
219 | ||
8823e1f9 SS |
220 | mkdir -pv %{BUILDROOT}/var/log/journal |
221 | chown root:systemd-journal %{BUILDROOT}/var/log/journal | |
20bbeabf SS |
222 | |
223 | # Create empty environment file. | |
224 | touch %{BUILDROOT}%{sysconfdir}/environment | |
802ea3af MT |
225 | end |
226 | end | |
227 | ||
8823e1f9 | 228 | create_groups |
da4f96f1 SS |
229 | # Create the sysusers folder in the jail. |
230 | mkdir -pv %{sysusersdir} | |
8823e1f9 | 231 | |
da4f96f1 SS |
232 | # Copy all sysusers files from BUILDROOT into the jail's sysusers directory. |
233 | install -v -m 644 %{BUILDROOT}%{sysusersdir}/*.conf %{sysusersdir} | |
234 | ||
235 | # We do not have a libsystemd or systemd-sysusers binary, so | |
236 | # call the installed one inside BUILDROOT to create all users and | |
237 | # groups in one shot. | |
238 | LD_LIBRARY_PATH="%{BUILDROOT}%{libdir}/systemd/" \ | |
239 | %{BUILDROOT}%{bindir}/systemd-sysusers | |
557068de SS |
240 | end |
241 | ||
802ea3af MT |
242 | packages |
243 | package %{name} | |
514357ad SS |
244 | requires |
245 | dbus | |
2d01364a | 246 | hwdata |
c1bf5bac MT |
247 | python3-cairo |
248 | python3-dbus | |
249 | python3-gobject3 | |
2d448045 | 250 | %{name}-basetools = %{thisver} |
c1bf5bac MT |
251 | %{name}-libs = %{thisver} |
252 | util-linux >= 2.19 | |
514357ad | 253 | end |
1d40b321 | 254 | |
216fde50 | 255 | provides |
884e7dc4 | 256 | /bin/systemctl |
216fde50 SS |
257 | /bin/systemd |
258 | /sbin/halt | |
259 | /sbin/init | |
260 | /sbin/poweroff | |
261 | /sbin/reboot | |
262 | /sbin/shutdown | |
2d01364a SS |
263 | |
264 | udev = %{thisver} | |
884e7dc4 MT |
265 | systemd-units = %{thisver} |
266 | ||
267 | syslog | |
216fde50 SS |
268 | end |
269 | ||
6793fec1 | 270 | conflicts |
7f84cbd5 | 271 | bash-completion < 2.1 |
2d01364a | 272 | dracut < 019 |
6793fec1 | 273 | filesystem < 002 |
755fe986 | 274 | rsyslog < 5.8.6-4 |
dc322253 | 275 | setup < 3.0-13 |
6793fec1 MT |
276 | upstart |
277 | end | |
ef438375 | 278 | |
2d01364a SS |
279 | obsoletes |
280 | udev < 183 | |
cefc1a9b | 281 | systemd-units <= 242 |
2d01364a SS |
282 | end |
283 | ||
284 | configfiles | |
285 | /etc/locale.conf | |
286 | /etc/machine-id | |
287 | /etc/systemd/journald.conf | |
288 | /etc/systemd/logind.conf | |
289 | /etc/systemd/system.conf | |
290 | /etc/systemd/user.conf | |
291 | /etc/udev/udev.conf | |
292 | /etc/vconsole.conf | |
293 | end | |
294 | ||
1d40b321 | 295 | script postin |
1d40b321 | 296 | # Reexec systemd daemon. |
6793fec1 | 297 | /usr/bin/systemctl daemon-reexec > /dev/null 2>&1 || : |
1d40b321 | 298 | |
56a7990e SS |
299 | # Automatically spawn a getty on TTY1 |
300 | /usr/bin/systemctl enable getty@.service >/dev/null 2>&1 || : | |
301 | ||
302 | # Enable targed to mount all remote filesystems. | |
303 | /usr/bin/systemctl enable remote-fs.target >/dev/null 2>&1 || : | |
1d40b321 SS |
304 | end |
305 | ||
2d01364a SS |
306 | script preup |
307 | # Be sure to stop the old udev before updating. | |
308 | /usr/bin/systemctl stop udev.service udev-trigger.service \ | |
309 | udev-control.socket udev-kernel.socket >/dev/null 2>&1 || : | |
8823e1f9 SS |
310 | |
311 | %{create_groups} | |
2d01364a SS |
312 | end |
313 | ||
1d40b321 | 314 | script postup |
56f48716 | 315 | # Re-exec systemd after update. |
e296cea0 | 316 | /usr/bin/systemctl daemon-reexec >/dev/null 2>&1 || : |
56f48716 | 317 | |
1d40b321 | 318 | # Restart login service after update |
5e462903 | 319 | /usr/bin/systemctl daemon-reload >/dev/null 2>&1 || : |
6793fec1 | 320 | /usr/bin/systemctl try-restart systemd-logind.service >/dev/null 2>&1 || : |
755fe986 SS |
321 | |
322 | # Use the new journald configuration file and restart the service. | |
323 | if ! grep -xq ImportKernel=yes /etc/systemd/journald.conf ; then | |
e296cea0 | 324 | mv /etc/systemd/journald.conf.paknew /etc/systemd/journald.conf >/dev/null 2>&1 || : |
755fe986 SS |
325 | /usr/bin/systemctl restart systemd-journald.service >/dev/null 2>&1 || : |
326 | fi | |
1d40b321 | 327 | end |
2d01364a SS |
328 | |
329 | # Be sure to start the new udev after everything is done. | |
330 | script posttransup | |
331 | /usr/bin/systemctl start systemd-udev.service >/dev/null 2>&1 || : | |
332 | end | |
802ea3af | 333 | end |
1f9bc2f0 | 334 | |
2d448045 SS |
335 | package %{name}-basetools |
336 | summary = Basetools from the systemd package, like sysuses and tmpfiles. | |
337 | description | |
338 | This package contains some very basic tools from systemd like | |
339 | systemd-sysusers and systemd-tmpfiles. | |
340 | ||
341 | They mostly are required in a very early stage and shipping them | |
342 | in an own package allows us to handle this properly. | |
343 | end | |
344 | ||
345 | provides | |
346 | systemd-sysusers = %{thisver} | |
347 | systemd-tmpfiles = %{thisver} | |
348 | end | |
349 | ||
350 | requires | |
351 | %{name}-libs = %{thisver} | |
352 | end | |
353 | ||
354 | files | |
355 | %{bindir}/%{name}-sysusers | |
356 | %{bindir}/%{name}-tmpfiles | |
357 | %{mandir}/man1/%{name}-sysusers* | |
358 | %{mandir}/man1/%{name}-tmpfiles* | |
359 | ||
360 | # Only ship the sysusers.d folder without | |
361 | # any config files. | |
da4f96f1 SS |
362 | %{sysusersdir} |
363 | !%{sysusersdir}/*.conf | |
2d448045 SS |
364 | end |
365 | end | |
366 | ||
1191e383 SS |
367 | package %{name}-libs |
368 | template LIBS | |
519776fd SS |
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 | |
e52f3c8b | 382 | systemd-compat-libs < 230 |
519776fd SS |
383 | end |
384 | ||
385 | conflicts | |
519776fd SS |
386 | # Ensure that the version of systemd matches systemd-libs. |
387 | systemd > %{thisver} | |
388 | systemd < %{thisver} | |
389 | end | |
390 | ||
2d448045 SS |
391 | files += \ |
392 | %{libdir}/%{name} | |
393 | ||
519776fd SS |
394 | # Add myhostname to the hosts line of /etc/nsswitch.conf |
395 | script postin | |
396 | if [ -f "/etc/nsswitch.conf" ]; then | |
397 | sed -i.bak -e ' | |
398 | /^hosts:/ !b | |
399 | /\<myhostname\>/ b | |
400 | s/[[:blank:]]*$/ myhostname/ | |
401 | ' /etc/nsswitch.conf | |
402 | fi | |
403 | end | |
404 | ||
405 | # Remove myhostname from the hosts line of /etc/nsswitch.conf | |
406 | script postun | |
407 | if [ -f "/etc/nsswitch.conf" ]; then | |
408 | sed -i.bak -e ' | |
409 | /^hosts:/ !b | |
410 | s/[[:blank:]]\+myhostname\>// | |
411 | ' /etc/nsswitch.conf | |
412 | fi | |
413 | end | |
1191e383 SS |
414 | end |
415 | ||
802ea3af MT |
416 | package %{name}-devel |
417 | template DEVEL | |
6793fec1 MT |
418 | |
419 | files += %{prefix}/lib/pakfire/macros/ | |
802ea3af | 420 | end |
1f9bc2f0 | 421 | |
2d01364a SS |
422 | package libudev |
423 | summary = Libraries for adding libudev support to applications. | |
424 | description | |
425 | This package contains the libraries that make it easier to use libudev | |
426 | functionality from applications. | |
427 | end | |
428 | license = LGPLv2+ | |
429 | ||
430 | conflicts | |
431 | filesystem < 002 | |
432 | end | |
433 | ||
434 | files | |
1191e383 | 435 | %{libdir}/lib*udev*.so.* |
2d01364a SS |
436 | %{libidr}/girepository*/ |
437 | end | |
438 | end | |
439 | ||
440 | package libudev-devel | |
441 | summary = Header files for adding libudev support to applications. | |
442 | description | |
443 | This package contains the header and pkg-config files for developing | |
444 | applications using libudev functionality. | |
445 | end | |
446 | license = LGPLv2+ | |
447 | ||
448 | conflicts | |
449 | filesystem < 002 | |
450 | end | |
451 | ||
452 | files | |
a8aa3ead | 453 | %{libdir}/lib*udev*.so |
73eb4724 | 454 | %{libdir}/pkgconfig/lib*udev.pc |
2d01364a | 455 | %{libdir}/pkgconfig/gudev* |
a8aa3ead | 456 | %{includedir}/lib*udev.h |
2d01364a SS |
457 | %{includedir}/gudev* |
458 | %{datadir}/gir-* | |
459 | %{datadir}/gtk-doc/html/gudev | |
460 | end | |
461 | end | |
462 | ||
1f9bc2f0 MT |
463 | package %{name}-debuginfo |
464 | template DEBUGINFO | |
465 | end | |
802ea3af | 466 | end |