]> git.pld-linux.org Git - packages/systemd.git/blob - systemd.spec
- drop P: SysVinit
[packages/systemd.git] / systemd.spec
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 #
7 # Conditional build:
8 %bcond_without  audit           # without audit support
9 %bcond_without  cryptsetup      # without cryptsetup support
10 %bcond_without  gtk             # build gtk tools
11 %bcond_without  pam             # PAM authentication support
12 %bcond_without  selinux         # without SELinux support
13 %bcond_without  tcpd            # libwrap (tcp_wrappers) support
14
15 Summary:        A System and Service Manager
16 Summary(pl.UTF-8):      systemd - zarządca systemu i usług dla Linuksa
17 Name:           systemd
18 Version:        37
19 Release:        2
20 License:        GPL v2+
21 Group:          Base
22 Source0:        http://www.freedesktop.org/software/systemd/%{name}-%{version}.tar.bz2
23 # Source0-md5:  1435f23be79c8c38d1121c6b150510f3
24 Source1:        %{name}-sysv-convert
25 Source2:        systemd_booted.c
26 Patch0:         target-pld.patch
27 Patch1:         config-pld.patch
28 URL:            http://www.freedesktop.org/wiki/Software/systemd
29 %{?with_audit:BuildRequires:    audit-libs-devel}
30 BuildRequires:  autoconf >= 2.63
31 BuildRequires:  automake >= 1:1.11
32 %{?with_cryptsetup:BuildRequires:       cryptsetup-luks-devel}
33 BuildRequires:  dbus-devel >= 1.3.2
34 BuildRequires:  docbook-style-xsl
35 %if %{with gtk}
36 BuildRequires:  glib2-devel >= 1:2.26.1
37 BuildRequires:  gtk+2-devel >= 2:2.24.0
38 BuildRequires:  libnotify-devel >= 0.7.0
39 %endif
40 BuildRequires:  gperf
41 BuildRequires:  libcap-devel
42 %{?with_selinux:BuildRequires:  libselinux-devel}
43 BuildRequires:  libtool >= 2:2.2
44 %{?with_tcpd:BuildRequires:     libwrap-devel}
45 BuildRequires:  libxslt-progs
46 BuildRequires:  m4
47 %{?with_pam:BuildRequires:      pam-devel}
48 BuildRequires:  pkgconfig >= 0.9.0
49 BuildRequires:  rpmbuild(macros) >= 1.527
50 BuildRequires:  udev-devel >= 172
51 BuildRequires:  vala >= 0.10.0
52 Requires:       %{name}-libs = %{version}-%{release}
53 Requires:       %{name}-units = %{version}-%{release}
54 Requires:       SysVinit-tools
55 Requires:       agetty
56 Requires:       dbus >= 1.3.2
57 Requires:       dbus-systemd
58 Requires:       filesystem >= 4.0
59 # python modules required by systemd-analyze
60 Requires:       python-dbus
61 Requires:       python-modules
62 Requires:       rc-scripts
63 Requires:       setup >= 2.8.0-2
64 Requires:       udev-core >= 1:172
65 Requires:       udev-systemd >= 1:172
66 Requires:       udev-libs >= 1:172
67 Suggests:       ConsoleKit-systemd
68 Suggests:       rsyslog-systemd
69 Provides:       readahead = 1:1.5.7-3
70 Provides:       virtual(init-daemon)
71 Provides:       udev-acl
72 Obsoletes:      SysVinit
73 Obsoletes:      readahead < 1:1.5.7-3
74 Obsoletes:      virtual(init-daemon)
75 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
76
77 %define         _libexecdir     %{_prefix}/lib
78
79 %description
80 systemd is a system and service manager for Linux, compatible with
81 SysV and LSB init scripts. systemd provides aggressive parallelization
82 capabilities, uses socket and D-Bus activation for starting services,
83 offers on-demand starting of daemons, keeps track of processes using
84 Linux cgroups, supports snapshotting and restoring of the system
85 state, maintains mount and automount points and implements an
86 elaborate transactional dependency-based service control logic. It can
87 work as a drop-in replacement for sysvinit.
88
89 %description -l pl.UTF-8
90 systemd jest zarządcą systemu i usług dla Linuksa, kompatybilny ze
91 skryptami SysV i LSB. systemd udostępnia rozbudowane zdolności
92 paralelizacji, do uruchamiania usług używa socketów oraz D-Busa,
93 oferuje uruchamianie usług na życzenie, monitoruje procesy używając
94 linuksowych cgroups, wspomaga zapisywanie (snapshot) i odczytywanie
95 (restore) stanu systemu, zarządza (auto)mount pointami oraz
96 implementuje starannie opracowaną transakcjonalną, bazującą na
97 zależnościach logikę kontroli usług. Może pracować jako zastępca dla
98 sysvinit.
99
100 %package units
101 Summary:        Configuration files, directories and installation tool for systemd
102 Group:          Base
103 Requires(post): coreutils
104 Requires(post): gawk
105 Requires:       pkgconfig
106
107 %description units
108 Basic configuration files, directories and installation tool for the
109 systemd system and service manager.
110
111 This is distro specific config, to override 
112 use /etc/systemd/system
113
114 %package gtk
115 Summary:        Graphical frontend for systemd
116 Group:          Base
117 Requires:       %{name} = %{version}-%{release}
118 Requires:       polkit
119
120 %description gtk
121 Graphical front-end for systemd.
122
123 %package -n bash-completion-systemd
124 Summary:        bash-completion for systemd
125 Group:          Applications/Shells
126 Requires:       %{name}
127 Requires:       bash-completion
128
129 %description -n bash-completion-systemd
130 bash-completion for systemd.
131
132 %package libs
133 Summary:        Shared systemd library
134 Group:          Libraries
135
136 %description libs
137 Shared systemd library.
138
139 %package devel
140 Summary:        Header files for systemd libraries
141 Summary(pl.UTF-8):      Pliki nagłówkowe bibliotek systemd
142 Group:          Development/Libraries
143 Requires:       %{name}-libs = %{version}-%{release}
144
145 %description devel
146 Header files for systemd libraries.
147
148 %description devel -l pl.UTF-8
149 Pliki nagłówkowe bibliotek systemd.
150
151 %prep
152 %setup -q
153 %patch0 -p1
154 %patch1 -p1
155 cp -p %{SOURCE2} src/systemd_booted.c
156
157 %build
158 %{__aclocal} -I m4
159 %{__autoconf}
160 %{__autoheader}
161 %{__automake}
162 %configure \
163         %{__enable_disable audit} \
164         %{__enable_disable cryptsetup libcryptsetup} \
165         %{__enable_disable gtk} \
166         %{__enable_disable pam} \
167         %{__enable_disable selinux} \
168         %{__enable_disable tcpd tcpwrap} \
169         --disable-silent-rules \
170         --disable-static \
171         --with-rootdir=
172
173 %{__make}
174 ./libtool --mode=link --tag=CC %{__cc} %{rpmcppflags} %{rpmcflags} -o systemd_booted %{rpmldflags} src/systemd_booted.c -L. -lsystemd-daemon
175
176 %install
177 rm -rf $RPM_BUILD_ROOT
178
179 %{__make} install \
180         DESTDIR=$RPM_BUILD_ROOT
181
182 ./libtool --mode=install install -m755 systemd_booted $RPM_BUILD_ROOT/bin/systemd_booted
183
184 for lib in libsystemd-daemon libsystemd-login; do
185         %{__mv} $RPM_BUILD_ROOT{%{_libdir}/$lib.so.*,/%{_lib}}
186         ln -sf /%{_lib}/$(basename $RPM_BUILD_ROOT/%{_lib}/$lib.so.*.*.*) $RPM_BUILD_ROOT%{_libdir}/$lib.so
187 done
188
189 # Create SysV compatibility symlinks. systemctl/systemd are smart
190 # enough to detect in which way they are called.
191 install -d $RPM_BUILD_ROOT/sbin
192 ln -s ../bin/systemd $RPM_BUILD_ROOT/sbin/init
193 ln -s ../bin/systemctl $RPM_BUILD_ROOT/sbin/halt
194 ln -s ../bin/systemctl $RPM_BUILD_ROOT/sbin/poweroff
195 ln -s ../bin/systemctl $RPM_BUILD_ROOT/sbin/reboot
196 ln -s ../bin/systemctl $RPM_BUILD_ROOT/sbin/runlevel
197 ln -s ../bin/systemctl $RPM_BUILD_ROOT/sbin/shutdown
198 ln -s ../bin/systemctl $RPM_BUILD_ROOT/sbin/telinit
199
200 ln -s ../modules $RPM_BUILD_ROOT%{_sysconfdir}/modules-load.d/modules.conf
201
202 # We create all wants links manually at installation time to make sure
203 # they are not owned and hence overriden by rpm after the used deleted
204 # them.
205 %{__rm} -r $RPM_BUILD_ROOT%{_sysconfdir}/systemd/system/*.target.wants
206
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
212
213 # Make sure these directories are properly owned
214 install -d $RPM_BUILD_ROOT/lib/systemd/system/{basic,dbus,default,halt,kexec,poweroff,reboot,syslog}.target.wants
215
216 # Create new-style configuration files so that we can ghost-own them
217 touch $RPM_BUILD_ROOT%{_sysconfdir}/{hostname,locale.conf,machine-id,machine-info,os-release,timezone,vconsole.conf}
218
219 # Install SysV conversion tool for systemd
220 install -p %{SOURCE1} $RPM_BUILD_ROOT%{_bindir}
221
222 install -d $RPM_BUILD_ROOT/var/log
223 > $RPM_BUILD_ROOT/var/log/btmp
224 > $RPM_BUILD_ROOT/var/log/wtmp
225
226 %if %{without gtk}
227 # to shut up check-files
228 %{__rm} $RPM_BUILD_ROOT%{_bindir}/systemadm
229 %{__rm} $RPM_BUILD_ROOT%{_bindir}/systemd-gnome-ask-password-agent
230 %{__rm} $RPM_BUILD_ROOT%{_mandir}/man1/systemadm.1*
231 %endif
232
233 %{__rm} -r $RPM_BUILD_ROOT%{_docdir}/%{name}
234 %{__rm} $RPM_BUILD_ROOT/%{_lib}/security/pam_systemd.la
235 %{__rm} $RPM_BUILD_ROOT%{_libdir}/*.la
236
237 %clean
238 rm -rf $RPM_BUILD_ROOT
239
240 %post
241 /bin/systemd-machine-id-setup > /dev/null 2>&1 || :
242 /bin/systemctl daemon-reexec > /dev/null 2>&1 || :
243
244 %postun
245 if [ $1 -ge 1 ]; then
246         /bin/systemctl try-restart systemd-logind.service >/dev/null 2>&1 || :
247 fi
248
249 %post   libs -p /sbin/ldconfig
250 %postun libs -p /sbin/ldconfig
251
252 %post units
253 if [ $1 -eq 1 ]; then
254         # Try to read default runlevel from the old inittab if it exists
255         runlevel=$(/bin/awk -F ':' '$3 == "initdefault" && $1 !~ "^#" { print $2 }' /etc/inittab 2> /dev/null)
256         if [ -z "$runlevel" ] ; then
257                 target="/lib/systemd/system/graphical.target"
258         else
259                 target="/lib/systemd/system/runlevel$runlevel.target"
260         fi
261
262         # And symlink what we found to the new-style default.target
263         ln -sf "$target" /etc/systemd/system/default.target >/dev/null 2>&1 || :
264
265         # Enable the services we install by default.
266         /bin/systemctl enable \
267                 getty@.service \
268                 remote-fs.target \
269                 systemd-readahead-replay.service \
270                 systemd-readahead-collect.service >/dev/null 2>&1 || :
271 fi
272
273 %preun units
274 if [ $1 -eq 0 ] ; then
275         /bin/systemctl disable \
276                 getty@.service \
277                 remote-fs.target \
278                 systemd-readahead-replay.service \
279                 systemd-readahead-collect.service >/dev/null 2>&1 || :
280
281         %{__rm} -f /etc/systemd/system/default.target >/dev/null 2>&1 || :
282 fi
283
284 %postun units
285 if [ $1 -ge 1 ]; then
286         /bin/systemctl daemon-reload > /dev/null 2>&1 || :
287 fi
288
289 %files
290 %defattr(644,root,root,755)
291 %doc DISTRO_PORTING README TODO
292 /etc/dbus-1/system.d/org.freedesktop.hostname1.conf
293 /etc/dbus-1/system.d/org.freedesktop.locale1.conf
294 /etc/dbus-1/system.d/org.freedesktop.login1.conf
295 /etc/dbus-1/system.d/org.freedesktop.systemd1.conf
296 /etc/dbus-1/system.d/org.freedesktop.timedate1.conf
297 %ghost %config(noreplace) %{_sysconfdir}/machine-id
298 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/hostname
299 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/locale.conf
300 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/machine-info
301 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/os-release
302 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/timezone
303 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/vconsole.conf
304 %dir %{_sysconfdir}/systemd
305 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/systemd/*.conf
306 /etc/xdg/systemd
307 %attr(755,root,root) /bin/systemd
308 %attr(755,root,root) /bin/systemd-ask-password
309 %attr(755,root,root) /bin/systemd-loginctl
310 %attr(755,root,root) /bin/systemd-machine-id-setup
311 %attr(755,root,root) /bin/systemd-notify
312 %attr(755,root,root) /bin/systemd-tty-ask-password-agent
313 %attr(755,root,root) %{_bindir}/systemd-analyze
314 %attr(755,root,root) %{_bindir}/systemd-cgls
315 %attr(755,root,root) %{_bindir}/systemd-nspawn
316 %attr(755,root,root) %{_bindir}/systemd-sysv-convert
317 %attr(755,root,root) %{_bindir}/systemd-stdio-bridge
318 %attr(755,root,root) /sbin/halt
319 %attr(755,root,root) /sbin/init
320 %attr(755,root,root) /sbin/poweroff
321 %attr(755,root,root) /sbin/reboot
322 %attr(755,root,root) /sbin/runlevel
323 %attr(755,root,root) /sbin/shutdown
324 %attr(755,root,root) /sbin/telinit
325 %attr(755,root,root) /lib/systemd/systemd-*
326 %dir /lib/systemd/system-generators
327 %attr(755,root,root) /lib/systemd/system-generators/systemd-*-generator
328 %dir /lib/systemd/system-shutdown
329 /lib/udev/rules.d/99-systemd.rules
330 /lib/udev/rules.d/70-uaccess.rules
331 /lib/udev/rules.d/71-seat.rules
332 /lib/udev/rules.d/73-seat-late.rules
333 %dir %{_libexecdir}/systemd
334 %{_libexecdir}/systemd/user
335 %config(noreplace,missingok) %{_libexecdir}/tmpfiles.d/*.conf
336 %{_datadir}/dbus-1/interfaces/org.freedesktop.hostname1.xml
337 %{_datadir}/dbus-1/interfaces/org.freedesktop.locale1.xml
338 %{_datadir}/dbus-1/interfaces/org.freedesktop.systemd1.*.xml
339 %{_datadir}/dbus-1/interfaces/org.freedesktop.timedate1.xml
340 %{_datadir}/dbus-1/services/org.freedesktop.systemd1.service
341 %{_datadir}/dbus-1/system-services/org.freedesktop.hostname1.service
342 %{_datadir}/dbus-1/system-services/org.freedesktop.locale1.service
343 %{_datadir}/dbus-1/system-services/org.freedesktop.login1.service
344 %{_datadir}/dbus-1/system-services/org.freedesktop.systemd1.service
345 %{_datadir}/dbus-1/system-services/org.freedesktop.timedate1.service
346 %{_datadir}/polkit-1/actions/org.freedesktop.hostname1.policy
347 %{_datadir}/polkit-1/actions/org.freedesktop.locale1.policy
348 %{_datadir}/polkit-1/actions/org.freedesktop.login1.policy
349 %{_datadir}/polkit-1/actions/org.freedesktop.systemd1.policy
350 %{_datadir}/polkit-1/actions/org.freedesktop.timedate1.policy
351 %dir %{_datadir}/systemd
352 %{_datadir}/systemd/kbd-model-map
353 %{_mandir}/man1/init.1
354 %{_mandir}/man1/systemd.1*
355 %{_mandir}/man1/systemd-ask-password.1*
356 %{_mandir}/man1/systemd-cgls.1*
357 %{_mandir}/man1/systemd-notify.1*
358 %{_mandir}/man1/systemd-nspawn.1*
359 %{_mandir}/man1/systemd-loginctl.1*
360 %{_mandir}/man3/sd_booted.3*
361 %{_mandir}/man3/sd_is_fifo.3*
362 %{_mandir}/man3/sd_is_socket.3
363 %{_mandir}/man3/sd_is_socket_inet.3
364 %{_mandir}/man3/sd_is_socket_unix.3
365 %{_mandir}/man3/sd_listen_fds.3*
366 %{_mandir}/man3/sd_notify.3*
367 %{_mandir}/man3/sd_notifyf.3
368 %{_mandir}/man3/sd_readahead.3*
369 %{_mandir}/man5/binfmt.d.5*
370 %{_mandir}/man5/hostname.5*
371 %{_mandir}/man5/locale.conf.5*
372 %{_mandir}/man5/machine-id.5*
373 %{_mandir}/man5/machine-info.5*
374 %{_mandir}/man5/modules-load.d.5*
375 %{_mandir}/man5/os-release.5*
376 %{_mandir}/man5/sysctl.d.5*
377 %{_mandir}/man5/systemd.*.5*
378 %{_mandir}/man5/systemd-logind.conf.5*
379 %{_mandir}/man5/timezone.5*
380 %{_mandir}/man5/vconsole.conf.5*
381 %{_mandir}/man7/daemon.7*
382 %{_mandir}/man7/sd-daemon.7*
383 %{_mandir}/man7/sd-readahead.7*
384 %{_mandir}/man7/systemd.special.7*
385 %{_mandir}/man8/halt.8*
386 %{_mandir}/man8/poweroff.8
387 %{_mandir}/man8/reboot.8
388 %{_mandir}/man8/runlevel.8*
389 %{_mandir}/man8/shutdown.8*
390 %{_mandir}/man8/telinit.8*
391 %attr(640,root,root) %ghost /var/log/btmp
392 %attr(664,root,utmp) %ghost /var/log/wtmp
393
394 %if %{with pam}
395 %attr(755,root,root) /%{_lib}/security/pam_systemd.so
396 %{_mandir}/man8/pam_systemd.8*
397 %endif
398
399 %files libs
400 %defattr(644,root,root,755)
401 %attr(755,root,root) /%{_lib}/libsystemd-daemon.so.*.*.*
402 %attr(755,root,root) %ghost /%{_lib}/libsystemd-daemon.so.0
403 %attr(755,root,root) /%{_lib}/libsystemd-login.so.*.*.*
404 %attr(755,root,root) %ghost /%{_lib}/libsystemd-login.so.0
405
406 %files units
407 %defattr(644,root,root,755)
408 %dir %{_sysconfdir}/binfmt.d
409 %dir %{_sysconfdir}/modules-load.d
410 %config(noreplace,missingok) %verify(not md5 mtime size) %{_sysconfdir}/modules-load.d/modules.conf
411 %dir %{_sysconfdir}/sysctl.d
412 %dir %{_sysconfdir}/systemd
413 %dir %{_sysconfdir}/systemd/system
414 %dir %{_sysconfdir}/tmpfiles.d
415 %dir %{_libexecdir}/binfmt.d
416 %dir %{_libexecdir}/modules-load.d
417 %dir %{_libexecdir}/sysctl.d
418 %attr(755,root,root) /bin/systemctl
419 %attr(755,root,root) /bin/systemd-tmpfiles
420 %attr(755,root,root) /bin/systemd_booted
421 %{_mandir}/man1/systemctl.1*
422 %{_mandir}/man5/tmpfiles.d.5*
423 %{_mandir}/man8/systemd-tmpfiles.8*
424 %{_npkgconfigdir}/systemd.pc
425
426 /lib/systemd/system/*.automount
427 /lib/systemd/system/*.mount
428 /lib/systemd/system/*.path
429 /lib/systemd/system/*.service
430 /lib/systemd/system/*.socket
431 /lib/systemd/system/*.target
432 /lib/systemd/system/*.timer
433 /lib/systemd/system/basic.target.wants
434 /lib/systemd/system/dbus.target.wants
435 /lib/systemd/system/default.target.wants
436 /lib/systemd/system/final.target.wants
437 /lib/systemd/system/graphical.target.wants
438 /lib/systemd/system/halt.target.wants
439 /lib/systemd/system/kexec.target.wants
440 /lib/systemd/system/local-fs.target.wants
441 /lib/systemd/system/multi-user.target.wants
442 /lib/systemd/system/poweroff.target.wants
443 /lib/systemd/system/reboot.target.wants
444 /lib/systemd/system/runlevel?.target.wants
445 /lib/systemd/system/shutdown.target.wants
446 /lib/systemd/system/sockets.target.wants
447 /lib/systemd/system/sysinit.target.wants
448 /lib/systemd/system/syslog.target.wants
449
450 %if %{with gtk}
451 %files gtk
452 %defattr(644,root,root,755)
453 %attr(755,root,root) %{_bindir}/systemadm
454 %attr(755,root,root) %{_bindir}/systemd-gnome-ask-password-agent
455 %{_mandir}/man1/systemadm.1*
456 %endif
457
458 %files -n bash-completion-systemd
459 %defattr(644,root,root,755)
460 /etc/bash_completion.d/systemctl-bash-completion.sh
461
462 %files devel
463 %defattr(644,root,root,755)
464 %{_includedir}/systemd
465 %attr(755,root,root) %{_libdir}/libsystemd-daemon.so
466 %attr(755,root,root) %{_libdir}/libsystemd-login.so
467 %{_pkgconfigdir}/libsystemd-daemon.pc
468 %{_pkgconfigdir}/libsystemd-login.pc
This page took 0.059658 seconds and 4 git commands to generate.