1 # TODO: - move %_libexecdir/tmpfiles.d/* to /etc/tmpfiles.d?
2 # - shouldn't ../bin/systemctl symlinks be absolute? -no they shouldn't (think browsing mounted as chroot and seeing all blink due invalid link targets when doing ls)
3 # - separate init subpackage (with symlink), one can switch to
4 # systemd using init=/bin/systemd with other one installed
5 # - verify %_sysconfdir usage vs literal '/etc'
6 # - %post systemd-sysv-convert
9 %bcond_without audit # without audit support
10 %bcond_without cryptsetup # without cryptsetup support
11 %bcond_without gtk # build gtk tools
12 %bcond_without pam # PAM authentication support
13 %bcond_without selinux # without SELinux support
14 %bcond_without tcpd # libwrap (tcp_wrappers) support
16 Summary: A System and Service Manager
17 Summary(pl.UTF-8): systemd - zarządca systemu i usług dla Linuksa
23 Source0: http://www.freedesktop.org/software/systemd/%{name}-%{version}.tar.bz2
24 # Source0-md5: 1435f23be79c8c38d1121c6b150510f3
25 Source1: %{name}-sysv-convert
26 Source2: systemd_booted.c
27 Patch0: target-pld.patch
28 Patch1: config-pld.patch
29 URL: http://www.freedesktop.org/wiki/Software/systemd
30 %{?with_audit:BuildRequires: audit-libs-devel}
31 BuildRequires: autoconf >= 2.63
32 BuildRequires: automake >= 1:1.11
33 %{?with_cryptsetup:BuildRequires: cryptsetup-luks-devel}
34 BuildRequires: dbus-devel >= 1.3.2
35 BuildRequires: docbook-style-xsl
37 BuildRequires: glib2-devel >= 1:2.26.1
38 BuildRequires: gtk+2-devel >= 2:2.24.0
39 BuildRequires: libnotify-devel >= 0.7.0
42 BuildRequires: libcap-devel
43 %{?with_selinux:BuildRequires: libselinux-devel}
44 BuildRequires: libtool >= 2:2.2
45 %{?with_tcpd:BuildRequires: libwrap-devel}
46 BuildRequires: libxslt-progs
48 %{?with_pam:BuildRequires: pam-devel}
49 BuildRequires: pkgconfig >= 0.9.0
50 BuildRequires: rpmbuild(macros) >= 1.527
51 BuildRequires: udev-devel >= 172
52 BuildRequires: vala >= 0.10.0
53 Requires: %{name}-libs = %{version}-%{release}
54 Requires: %{name}-units = %{version}-%{release}
55 Requires: SysVinit-tools
57 Requires: dbus >= 1.3.2
58 Requires: dbus-systemd
59 Requires: filesystem >= 4.0
61 Requires: setup >= 2.8.0-2
62 Requires: udev-core >= 1:172
63 Requires: udev-systemd >= 1:172
64 Requires: udev-libs >= 1:172
65 Suggests: ConsoleKit-systemd
66 Suggests: fsck >= 2.20
67 # python modules required by systemd-analyze
69 Suggests: python-modules
70 Suggests: rsyslog-systemd
71 Provides: readahead = 1:1.5.7-3
73 Provides: virtual(init-daemon)
75 Obsoletes: readahead < 1:1.5.7-3
76 Obsoletes: virtual(init-daemon)
77 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
79 %define _libexecdir %{_prefix}/lib
82 systemd is a system and service manager for Linux, compatible with
83 SysV and LSB init scripts. systemd provides aggressive parallelization
84 capabilities, uses socket and D-Bus activation for starting services,
85 offers on-demand starting of daemons, keeps track of processes using
86 Linux cgroups, supports snapshotting and restoring of the system
87 state, maintains mount and automount points and implements an
88 elaborate transactional dependency-based service control logic. It can
89 work as a drop-in replacement for sysvinit.
91 %description -l pl.UTF-8
92 systemd jest zarządcą systemu i usług dla Linuksa, kompatybilny ze
93 skryptami SysV i LSB. systemd udostępnia rozbudowane zdolności
94 paralelizacji, do uruchamiania usług używa socketów oraz D-Busa,
95 oferuje uruchamianie usług na życzenie, monitoruje procesy używając
96 linuksowych cgroups, wspomaga zapisywanie (snapshot) i odczytywanie
97 (restore) stanu systemu, zarządza (auto)mount pointami oraz
98 implementuje starannie opracowaną transakcjonalną, bazującą na
99 zależnościach logikę kontroli usług. Może pracować jako zastępca dla
103 Summary: Configuration files, directories and installation tool for systemd
105 Requires(post): coreutils
110 Basic configuration files, directories and installation tool for the
111 systemd system and service manager.
113 This is common config, use /etc/systemd/system to override.
116 Summary: Graphical frontend for systemd
118 Requires: %{name} = %{version}-%{release}
122 Graphical front-end for systemd.
124 %package -n bash-completion-systemd
125 Summary: bash-completion for systemd
126 Group: Applications/Shells
128 Requires: bash-completion
130 %description -n bash-completion-systemd
131 bash-completion for systemd.
134 Summary: Shared systemd library
138 Shared systemd library.
141 Summary: Header files for systemd libraries
142 Summary(pl.UTF-8): Pliki nagłówkowe bibliotek systemd
143 Group: Development/Libraries
144 Requires: %{name}-libs = %{version}-%{release}
147 Header files for systemd libraries.
149 %description devel -l pl.UTF-8
150 Pliki nagłówkowe bibliotek systemd.
156 cp -p %{SOURCE2} src/systemd_booted.c
164 %{__enable_disable audit} \
165 %{__enable_disable cryptsetup libcryptsetup} \
166 %{__enable_disable gtk} \
167 %{__enable_disable pam} \
168 %{__enable_disable selinux} \
169 %{__enable_disable tcpd tcpwrap} \
170 --disable-silent-rules \
175 ./libtool --mode=link --tag=CC %{__cc} %{rpmcppflags} %{rpmcflags} -o systemd_booted %{rpmldflags} src/systemd_booted.c -L. -lsystemd-daemon
178 rm -rf $RPM_BUILD_ROOT
181 DESTDIR=$RPM_BUILD_ROOT
183 ./libtool --mode=install install -m755 systemd_booted $RPM_BUILD_ROOT/bin/systemd_booted
185 for lib in libsystemd-daemon libsystemd-login; do
186 %{__mv} $RPM_BUILD_ROOT{%{_libdir}/$lib.so.*,/%{_lib}}
187 ln -sf /%{_lib}/$(basename $RPM_BUILD_ROOT/%{_lib}/$lib.so.*.*.*) $RPM_BUILD_ROOT%{_libdir}/$lib.so
190 # Create SysV compatibility symlinks. systemctl/systemd are smart
191 # enough to detect the way they were called
192 install -d $RPM_BUILD_ROOT/sbin
193 ln -s ../bin/systemd $RPM_BUILD_ROOT/sbin/init
194 ln -s ../bin/systemctl $RPM_BUILD_ROOT/sbin/halt
195 ln -s ../bin/systemctl $RPM_BUILD_ROOT/sbin/poweroff
196 ln -s ../bin/systemctl $RPM_BUILD_ROOT/sbin/reboot
197 ln -s ../bin/systemctl $RPM_BUILD_ROOT/sbin/runlevel
198 ln -s ../bin/systemctl $RPM_BUILD_ROOT/sbin/shutdown
199 ln -s ../bin/systemctl $RPM_BUILD_ROOT/sbin/telinit
201 ln -s ../modules $RPM_BUILD_ROOT%{_sysconfdir}/modules-load.d/modules.conf
203 # All wants links are created at %post to make sure they are not owned
204 # and hence overriden by rpm if the user deletes them (missingok?)
205 %{__rm} -r $RPM_BUILD_ROOT%{_sysconfdir}/systemd/system/*.target.wants
207 # do not cover /media (system-specific removable mountpoints) for now
208 # needs %post code to convert existing /media structure to tmpfiles
209 %{__rm} -f $RPM_BUILD_ROOT/lib/systemd/local-fs.target.wants/media.mount
210 # do not cover /var/run until packages need rpm-provided-only subdirectories
211 %{__rm} -f $RPM_BUILD_ROOT/lib/systemd/local-fs.target.wants/var-run.mount
213 # Make sure these directories are properly owned:
214 # - halt,kexec,poweroff,reboot: generic ones used by ConsoleKit-systemd,
215 # - syslog _might_ be used by some syslog implementation (none for now),
216 # - isn't dbus populated by dbus-systemd only (so to be moved there)?
217 # - default should be left intact by distro packages, shouldn't it?
218 install -d $RPM_BUILD_ROOT/lib/systemd/system/{dbus,default,halt,kexec,poweroff,reboot,syslog}.target.wants
220 # Create new-style configuration files so that we can ghost-own them
221 touch $RPM_BUILD_ROOT%{_sysconfdir}/{hostname,locale.conf,machine-id,machine-info,os-release,timezone,vconsole.conf}
223 # Install SysV conversion tool for systemd
224 install -p %{SOURCE1} $RPM_BUILD_ROOT%{_bindir}
226 install -d $RPM_BUILD_ROOT/var/log
227 > $RPM_BUILD_ROOT/var/log/btmp
228 > $RPM_BUILD_ROOT/var/log/wtmp
231 # to shut up check-files
232 rm -f $RPM_BUILD_ROOT%{_bindir}/systemadm
233 rm -f $RPM_BUILD_ROOT%{_bindir}/systemd-gnome-ask-password-agent
234 %{__rm} $RPM_BUILD_ROOT%{_mandir}/man1/systemadm.1*
237 %{__rm} -r $RPM_BUILD_ROOT%{_docdir}/%{name}
238 %{__rm} $RPM_BUILD_ROOT/%{_lib}/security/pam_systemd.la
239 %{__rm} $RPM_BUILD_ROOT%{_libdir}/*.la
242 rm -rf $RPM_BUILD_ROOT
245 /bin/systemd-machine-id-setup > /dev/null 2>&1 || :
246 /bin/systemctl daemon-reexec > /dev/null 2>&1 || :
249 if [ $1 -ge 1 ]; then
250 /bin/systemctl try-restart systemd-logind.service >/dev/null 2>&1 || :
253 %post libs -p /sbin/ldconfig
254 %postun libs -p /sbin/ldconfig
257 if [ $1 -eq 1 ]; then
258 # Try to read default runlevel from the old inittab if it exists
259 runlevel=$(/bin/awk -F ':' '$3 == "initdefault" && $1 !~ "^#" { print $2 }' /etc/inittab 2> /dev/null)
260 if [ -z "$runlevel" ] ; then
261 target="/lib/systemd/system/graphical.target"
263 target="/lib/systemd/system/runlevel$runlevel.target"
266 # And symlink what we found to the new-style default.target
267 ln -sf "$target" /etc/systemd/system/default.target >/dev/null 2>&1 || :
269 # Enable the services we install by default.
270 /bin/systemctl enable \
273 systemd-readahead-replay.service \
274 systemd-readahead-collect.service >/dev/null 2>&1 || :
278 if [ $1 -eq 0 ] ; then
279 /bin/systemctl disable \
282 systemd-readahead-replay.service \
283 systemd-readahead-collect.service >/dev/null 2>&1 || :
285 %{__rm} -f /etc/systemd/system/default.target >/dev/null 2>&1 || :
289 if [ $1 -ge 1 ]; then
290 /bin/systemctl daemon-reload > /dev/null 2>&1 || :
294 %defattr(644,root,root,755)
295 %doc DISTRO_PORTING README TODO
296 /etc/dbus-1/system.d/org.freedesktop.hostname1.conf
297 /etc/dbus-1/system.d/org.freedesktop.locale1.conf
298 /etc/dbus-1/system.d/org.freedesktop.login1.conf
299 /etc/dbus-1/system.d/org.freedesktop.systemd1.conf
300 /etc/dbus-1/system.d/org.freedesktop.timedate1.conf
301 %ghost %config(noreplace) %{_sysconfdir}/machine-id
302 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/hostname
303 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/locale.conf
304 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/machine-info
305 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/os-release
306 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/timezone
307 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/vconsole.conf
308 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/systemd/*.conf
309 %dir %{_sysconfdir}/systemd/user
311 %attr(755,root,root) /bin/systemd
312 %attr(755,root,root) /bin/systemd-ask-password
313 %attr(755,root,root) /bin/systemd-loginctl
314 %attr(755,root,root) /bin/systemd-machine-id-setup
315 %attr(755,root,root) /bin/systemd-notify
316 %attr(755,root,root) /bin/systemd-tty-ask-password-agent
317 %attr(755,root,root) %{_bindir}/systemd-analyze
318 %attr(755,root,root) %{_bindir}/systemd-cgls
319 %attr(755,root,root) %{_bindir}/systemd-nspawn
320 %attr(755,root,root) %{_bindir}/systemd-stdio-bridge
321 %attr(755,root,root) %{_bindir}/systemd-sysv-convert
322 %attr(755,root,root) /sbin/halt
323 %attr(755,root,root) /sbin/init
324 %attr(755,root,root) /sbin/poweroff
325 %attr(755,root,root) /sbin/reboot
326 %attr(755,root,root) /sbin/runlevel
327 %attr(755,root,root) /sbin/shutdown
328 %attr(755,root,root) /sbin/telinit
329 %attr(755,root,root) /lib/systemd/systemd-*
330 %dir /lib/systemd/system-generators
331 %attr(755,root,root) /lib/systemd/system-generators/systemd-*-generator
332 %dir /lib/systemd/system-shutdown
333 /lib/udev/rules.d/99-systemd.rules
334 /lib/udev/rules.d/70-uaccess.rules
335 /lib/udev/rules.d/71-seat.rules
336 /lib/udev/rules.d/73-seat-late.rules
337 %dir %{_libexecdir}/systemd
338 %{_libexecdir}/systemd/user
339 %dir %{_libexecdir}/systemd/user-generators
340 %config(noreplace,missingok) %{_libexecdir}/tmpfiles.d/*.conf
341 %{_datadir}/dbus-1/interfaces/org.freedesktop.hostname1.xml
342 %{_datadir}/dbus-1/interfaces/org.freedesktop.locale1.xml
343 %{_datadir}/dbus-1/interfaces/org.freedesktop.systemd1.*.xml
344 %{_datadir}/dbus-1/interfaces/org.freedesktop.timedate1.xml
345 %{_datadir}/dbus-1/services/org.freedesktop.systemd1.service
346 %{_datadir}/dbus-1/system-services/org.freedesktop.hostname1.service
347 %{_datadir}/dbus-1/system-services/org.freedesktop.locale1.service
348 %{_datadir}/dbus-1/system-services/org.freedesktop.login1.service
349 %{_datadir}/dbus-1/system-services/org.freedesktop.systemd1.service
350 %{_datadir}/dbus-1/system-services/org.freedesktop.timedate1.service
351 %{_datadir}/polkit-1/actions/org.freedesktop.hostname1.policy
352 %{_datadir}/polkit-1/actions/org.freedesktop.locale1.policy
353 %{_datadir}/polkit-1/actions/org.freedesktop.login1.policy
354 %{_datadir}/polkit-1/actions/org.freedesktop.systemd1.policy
355 %{_datadir}/polkit-1/actions/org.freedesktop.timedate1.policy
356 %dir %{_datadir}/systemd
357 %{_datadir}/systemd/kbd-model-map
358 %{_mandir}/man1/init.1
359 %{_mandir}/man1/systemd.1*
360 %{_mandir}/man1/systemd-*.1*
361 %{_mandir}/man3/sd_booted.3*
362 %{_mandir}/man3/sd_is_fifo.3*
363 %{_mandir}/man3/sd_is_socket.3
364 %{_mandir}/man3/sd_is_socket_inet.3
365 %{_mandir}/man3/sd_is_socket_unix.3
366 %{_mandir}/man3/sd_listen_fds.3*
367 %{_mandir}/man3/sd_notify.3*
368 %{_mandir}/man3/sd_notifyf.3
369 %{_mandir}/man3/sd_readahead.3*
370 %{_mandir}/man5/binfmt.d.5*
371 %{_mandir}/man5/hostname.5*
372 %{_mandir}/man5/locale.conf.5*
373 %{_mandir}/man5/machine-id.5*
374 %{_mandir}/man5/machine-info.5*
375 %{_mandir}/man5/modules-load.d.5*
376 %{_mandir}/man5/os-release.5*
377 %{_mandir}/man5/sysctl.d.5*
378 %{_mandir}/man5/systemd.*.5*
379 %{_mandir}/man5/systemd-logind.conf.5*
380 %{_mandir}/man5/timezone.5*
381 %{_mandir}/man5/vconsole.conf.5*
382 %{_mandir}/man7/daemon.7*
383 %{_mandir}/man7/sd-daemon.7*
384 %{_mandir}/man7/sd-readahead.7*
385 %{_mandir}/man7/systemd.special.7*
386 %{_mandir}/man8/halt.8*
387 %{_mandir}/man8/poweroff.8
388 %{_mandir}/man8/reboot.8
389 %{_mandir}/man8/runlevel.8*
390 %{_mandir}/man8/shutdown.8*
391 %{_mandir}/man8/telinit.8*
392 %attr(640,root,root) %ghost /var/log/btmp
393 %attr(664,root,utmp) %ghost /var/log/wtmp
396 %attr(755,root,root) /%{_lib}/security/pam_systemd.so
397 %{_mandir}/man8/pam_systemd.8*
401 %defattr(644,root,root,755)
402 %attr(755,root,root) /%{_lib}/libsystemd-daemon.so.*.*.*
403 %attr(755,root,root) %ghost /%{_lib}/libsystemd-daemon.so.0
404 %attr(755,root,root) /%{_lib}/libsystemd-login.so.*.*.*
405 %attr(755,root,root) %ghost /%{_lib}/libsystemd-login.so.0
408 %defattr(644,root,root,755)
409 %dir %{_sysconfdir}/binfmt.d
410 %dir %{_sysconfdir}/modules-load.d
411 %config(noreplace,missingok) %verify(not md5 mtime size) %{_sysconfdir}/modules-load.d/modules.conf
412 %dir %{_sysconfdir}/sysctl.d
413 %dir %{_sysconfdir}/systemd
414 %dir %{_sysconfdir}/systemd/system
415 %dir %{_sysconfdir}/tmpfiles.d
416 %dir %{_libexecdir}/binfmt.d
417 %dir %{_libexecdir}/modules-load.d
418 %dir %{_libexecdir}/sysctl.d
419 %attr(755,root,root) /bin/systemctl
420 %attr(755,root,root) /bin/systemd-tmpfiles
421 %attr(755,root,root) /bin/systemd_booted
422 %{_mandir}/man1/systemctl.1*
423 %{_mandir}/man5/tmpfiles.d.5*
424 %{_mandir}/man8/systemd-tmpfiles.8*
425 %{_npkgconfigdir}/systemd.pc
427 /lib/systemd/system/*.automount
428 /lib/systemd/system/*.mount
429 /lib/systemd/system/*.path
430 /lib/systemd/system/*.service
431 /lib/systemd/system/*.socket
432 /lib/systemd/system/*.target
433 /lib/systemd/system/*.timer
434 %config(noreplace,missingok) /lib/systemd/system/*.wants
438 %defattr(644,root,root,755)
439 %attr(755,root,root) %{_bindir}/systemadm
440 %attr(755,root,root) %{_bindir}/systemd-gnome-ask-password-agent
441 %{_mandir}/man1/systemadm.1*
444 %files -n bash-completion-systemd
445 %defattr(644,root,root,755)
446 /etc/bash_completion.d/systemctl-bash-completion.sh
449 %defattr(644,root,root,755)
450 %{_includedir}/%{name}
451 %attr(755,root,root) %{_libdir}/libsystemd-daemon.so
452 %attr(755,root,root) %{_libdir}/libsystemd-login.so
453 %{_pkgconfigdir}/libsystemd-daemon.pc
454 %{_pkgconfigdir}/libsystemd-login.pc