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