Add an Obsoletes/Provides for sysvinit
[external/systemd.git] / packaging / systemd.spec
1 %define _sbindir /sbin
2 Name:       systemd
3 Summary:    System and Session Manager
4 Version:    43
5 Release:    1
6 Group:      System/System Control
7 License:    GPLv2
8 URL:        http://www.freedesktop.org/wiki/Software/systemd
9 Source0:    http://www.freedesktop.org/software/systemd/%{name}-%{version}.tar.xz
10 Source1:    pamconsole-tmp.conf
11 Source1001: systemd.manifest
12 Patch1:     0002-systemd-fsck-disable-l-until-linux.patch
13 Patch2:     add-tmp.mount-as-tmpfs.patch
14 Patch3:     tizen-login-location.patch
15 Patch4:     tizen-service-file-workaround.patch
16
17 BuildRequires:  pkgconfig(dbus-1) >= 1.4.0
18 BuildRequires:  pkgconfig(dbus-glib-1)
19 BuildRequires:  pkgconfig(gio-unix-2.0)
20 BuildRequires:  pkgconfig(libudev) >= 174
21 BuildRequires:  libcap-devel
22 BuildRequires:  gperf
23 BuildRequires:  libxslt
24 BuildRequires:  docbook-dtds
25 BuildRequires:  docbook-xsl
26 BuildRequires:  pam-devel
27 BuildRequires:  intltool >= 0.40.0
28 BuildRequires:  libacl-devel
29 BuildRequires:  fdupes
30 BuildRequires:  pkgconfig(libkmod)
31 Requires(post): %{_sbindir}/ldconfig
32 Requires(postun): %{_sbindir}/ldconfig
33
34 %description
35 system and session manager for Linux, compatible with SysV and
36 LSB init scripts. systemd provides aggressive parallelization
37 capabilities, uses socket and D-Bus activation for starting
38 services, offers on-demand starting of daemons, keeps track of
39 processes using Linux cgroups, supports snapshotting and restoring
40 of the system state, maintains mount and automount points and
41 implements an elaborate transactional dependency-based service
42 control logic. It can work as a drop-in replacement for sysvinit.
43
44 %package tools
45 Summary:    Analyze systemd startup timing
46 Group:      Development/Tools
47 Requires:   pycairo
48 Requires:   python-xml
49 Requires:   %{name} = %{version}-%{release}
50
51 %description tools
52 This package installs the systemd-analyze tool, which allows one to
53 inspect and graph service startup timing in table or graph format.
54
55 %package devel
56 Summary:    Development tools for systemd
57 Group:      Development/Libraries
58 Requires:   %{name} = %{version}-%{release}
59 Requires(post): %{_sbindir}/ldconfig
60 Requires(postun): %{_sbindir}/ldconfig
61
62 %description devel
63 This package includes the libraries and header files you will need
64 to compile applications for systemd.
65
66 %package console-ttyS0
67 Summary:    Systemd console ttyS0
68 Group:      System/System Control
69 Requires:   %{name}
70
71 %description console-ttyS0
72 This package will setup a serial getty for ttyS0 is desired.
73
74
75 %package console-ttyS1
76 Summary:    Systemd console ttyS1
77 Group:      System/System Control
78 Requires:   %{name}
79
80 %description console-ttyS1
81 This package will setup a serial getty for ttyS1 is desired.
82
83
84 %package console-tty01
85 Summary:    Systemd console tty01
86 Group:      System/System Control
87 Requires:   %{name}
88
89 %description console-tty01
90 This package will setup a serial getty for tty01 is desired.
91
92
93 %package console-ttyO2
94 Summary:    Systemd console ttyO2
95 Group:      System/System Control
96 Requires:   %{name}
97
98 %description console-ttyO2
99 This package will setup a serial getty for ttyO2 is desired.
100
101 %package console-ttyMFD2
102 Summary:    Systemd console ttyMFD2
103 Group:      System/System Control
104 Requires:   %{name}
105
106 %description console-ttyMFD2
107 This package will setup a serial getty for ttyMFD2 is desired.
108
109 %package docs
110 Summary:   System and session manager man pages
111 Group:     Development/Libraries
112 Requires:  %{name} = %{version}-%{release}
113
114 %description docs
115 This package includes the man pages for systemd.
116
117
118 %package sysv-docs
119 Summary:   System and session manager man pages - SysV links
120 Group:     Development/Libraries
121 Requires:  %{name} = %{version}-%{release}
122
123 %description sysv-docs
124 This package provides the manual pages needed for systemd
125 to replace sysvinit.
126
127 %package sysv
128 Summary:   System and session manager - SysV links
129 Group:     System/Startup Services
130 Requires:  %{name} = %{version}-%{release}
131 Obsoletes: sysvinit
132 Provides:  sysvinit
133
134 %description sysv
135 Systemd is a replacement for sysvinit.  It is dependency-based and
136 able to read the LSB init script headers in addition to parsing rcN.d
137 links as hints.
138
139 It also provides process supervision using cgroups and the ability to
140 not only depend on other init script being started, but also
141 availability of a given mount point or dbus service.
142
143 This package provides the links needed for systemd
144 to replace sysvinit.
145
146
147 %prep
148 %setup -q -n %{name}-%{version}
149 %patch1 -p1
150 %patch2 -p1
151 %patch3 -p1
152 %patch4 -p1
153
154 %build
155 cp %{SOURCE1001} .
156 %configure --disable-static \
157     --with-rootdir="" \
158     --with-distro=meego \
159     --disable-gtk \
160     --disable-selinux \
161     --disable-tcpwrap \
162     --enable-manpages \
163     --with-pamlibdir="/%{_libdir}/security" \
164     --with-udevrulesdir="%{_libdir}/udev/rules.d"
165
166 make %{?_smp_mflags}
167
168 %install
169 %make_install
170
171 # Create SysV compatibility symlinks. systemctl/systemd are smart
172 # enough to detect in which way they are called.
173 install -d %{buildroot}%{_sbindir}/
174 ln -s ..%{_libdir}/systemd/systemd %{buildroot}%{_sbindir}/init
175 ln -s ..%{_bindir}/systemctl %{buildroot}%{_sbindir}/halt
176 ln -s ..%{_bindir}/systemctl %{buildroot}%{_sbindir}/poweroff
177 ln -s ..%{_bindir}/systemctl %{buildroot}%{_sbindir}/reboot
178 ln -s ..%{_bindir}/systemctl %{buildroot}%{_sbindir}/runlevel
179 ln -s ..%{_bindir}/systemctl %{buildroot}%{_sbindir}/shutdown
180 ln -s ..%{_bindir}/systemctl %{buildroot}%{_sbindir}/telinit
181
182 # /usr compat - delete when no longer needed
183 install -d %{buildroot}/bin/
184 ln -s ..%{_bindir}/systemctl %{buildroot}/bin/systemctl
185
186 mkdir %{buildroot}/run
187
188 # Make sure these directories are properly owned
189 mkdir -p %{buildroot}%{_libdir}/systemd/system/basic.target.wants
190 mkdir -p %{buildroot}%{_libdir}/systemd/system/dbus.target.wants
191
192 # enable readahead by default
193 ln -s ../systemd-readahead-collect.service %{buildroot}%{_libdir}/systemd/system/sysinit.target.wants/systemd-readahead-collect.service
194 ln -s ../systemd-readahead-replay.service %{buildroot}%{_libdir}/systemd/system/sysinit.target.wants/systemd-readahead-replay.service
195
196 # Don't ship documentation in the wrong place
197 rm %{buildroot}/%{_docdir}/systemd/*
198
199 mkdir -p %{buildroot}/etc/systemd/system/basic.target.wants
200
201 #console-ttyMFD2
202 ln -s ../serial-getty@.service %{buildroot}%{_libdir}/systemd/system/sysinit.target.wants/serial-getty@ttyMFD2.service
203
204 #console-ttyS0
205 ln -s ../serial-getty@.service %{buildroot}%{_libdir}/systemd/system/sysinit.target.wants/serial-getty@ttyS0.service
206
207 #console-ttyS1
208 ln -s ../serial-getty@.service %{buildroot}%{_libdir}/systemd/system/sysinit.target.wants/serial-getty@ttyS1.service
209
210 #console-tty01
211 ln -s ../serial-getty@.service %{buildroot}%{_libdir}/systemd/system/sysinit.target.wants/serial-getty@tty01.service
212
213 #console-ttyO2
214 ln -s ../serial-getty@.service %{buildroot}%{_libdir}/systemd/system/sysinit.target.wants/serial-getty@ttyO2.service
215
216 %fdupes  %{buildroot}/%{_datadir}/man/
217
218 %post
219 if [ "`readlink /etc/mtab`" != "/proc/self/mounts" ]; then
220         rm -f /etc/mtab
221         ln -s /proc/self/mounts /etc/mtab
222 fi
223
224 /usr/bin/systemd-machine-id-setup >/dev/null 2>&1 || :
225
226 %{_sbindir}/ldconfig
227
228 %postun -p %{_sbindir}/ldconfig
229 %post devel -p %{_sbindir}/ldconfig
230 %postun devel -p %{_sbindir}/ldconfig
231
232
233 %files
234 %defattr(-,root,root,-)
235 %manifest systemd.manifest
236 /bin/systemctl
237 %{_bindir}/*
238 /run
239 %config %{_libdir}/sysctl.d/coredump.conf
240 %config %{_sysconfdir}/dbus-1/system.d/org.freedesktop.systemd1.conf
241 %config %{_sysconfdir}/dbus-1/system.d/org.freedesktop.hostname1.conf
242 %config %{_sysconfdir}/dbus-1/system.d/org.freedesktop.locale1.conf
243 %config %{_sysconfdir}/dbus-1/system.d/org.freedesktop.login1.conf
244 %config %{_sysconfdir}/dbus-1/system.d/org.freedesktop.timedate1.conf
245 %attr(0644,root,root) %{_libdir}/udev/rules.d/70-uaccess.rules
246 %attr(0644,root,root) %{_libdir}/udev/rules.d/71-seat.rules
247 %attr(0644,root,root) %{_libdir}/udev/rules.d/73-seat-late.rules
248 %config %{_sysconfdir}/systemd
249 %config %{_sysconfdir}/xdg/systemd/user
250 %config %{_sysconfdir}/bash_completion.d/systemd-bash-completion.sh
251 %{_prefix}/%{_lib}/tmpfiles.d/*
252 %{_libdir}/systemd
253 /%{_libdir}/security/pam_systemd.so
254 %{_libdir}/udev/rules.d/99-systemd.rules
255 %{_libdir}/libsystemd-daemon.so.0
256 %{_libdir}/libsystemd-daemon.so.0.0.1
257 %{_libdir}/libsystemd-login.so.0
258 %{_libdir}/libsystemd-login.so.0.2.0
259 %{_libdir}/libsystemd-id128.so.0
260 %{_libdir}/libsystemd-id128.so.0.0.2
261 %{_libdir}/libsystemd-journal.so.0
262 %{_libdir}/libsystemd-journal.so.0.0.2
263 %{_datadir}/dbus-1/*/org.freedesktop.systemd1.*
264 %{_defaultdocdir}/systemd
265 %{_datadir}/polkit-1/actions/org.freedesktop.systemd1.policy
266 %{_datadir}/polkit-1/actions/org.freedesktop.locale1.policy
267 %{_datadir}/polkit-1/actions/org.freedesktop.login1.policy
268 %{_datadir}/polkit-1/actions/org.freedesktop.timedate1.policy
269 %{_datadir}/polkit-1/actions/org.freedesktop.hostname1.policy
270 %{_datadir}/dbus-1/system-services/org.freedesktop.hostname1.service
271 %{_datadir}/dbus-1/system-services/org.freedesktop.locale1.service
272 %{_datadir}/dbus-1/system-services/org.freedesktop.login1.service
273 %{_datadir}/dbus-1/system-services/org.freedesktop.timedate1.service
274 %{_datadir}/dbus-1/interfaces/org.freedesktop.hostname1.xml
275 %{_datadir}/dbus-1/interfaces/org.freedesktop.locale1.xml
276 %{_datadir}/dbus-1/interfaces/org.freedesktop.timedate1.xml
277 %{_mandir}/man1/*
278 %{_mandir}/man3/*
279 %{_mandir}/man5/*
280 %{_mandir}/man7/*
281 %{_mandir}/man8/*
282 %exclude %{_libdir}/systemd/system/sysinit.target.wants/serial-getty@tty01.service
283 %exclude %{_libdir}/systemd/system/sysinit.target.wants/serial-getty@ttyMFD2.service
284 %exclude %{_libdir}/systemd/system/sysinit.target.wants/serial-getty@ttyO2.service
285 %exclude %{_libdir}/systemd/system/sysinit.target.wants/serial-getty@ttyS0.service
286 %exclude %{_libdir}/systemd/system/sysinit.target.wants/serial-getty@ttyS1.service
287 %exclude %{_libdir}/systemd/system/sysinit.target.wants/systemd-vconsole-setup.service
288 %exclude %{_libdir}/systemd/user/default.target
289
290 %files console-ttyMFD2
291 %defattr(-,root,root,-)
292 %{_libdir}/systemd/system/sysinit.target.wants/serial-getty@ttyMFD2.service
293
294 %files console-ttyS0
295 %defattr(-,root,root,-)
296 %{_libdir}/systemd/system/sysinit.target.wants/serial-getty@ttyS0.service
297
298 %files console-ttyS1
299 %defattr(-,root,root,-)
300 %{_libdir}/systemd/system/sysinit.target.wants/serial-getty@ttyS1.service
301
302 %files console-tty01
303 %defattr(-,root,root,-)
304 %{_libdir}/systemd/system/sysinit.target.wants/serial-getty@tty01.service
305
306 %files console-ttyO2
307 %defattr(-,root,root,-)
308 %{_libdir}/systemd/system/sysinit.target.wants/serial-getty@ttyO2.service
309
310
311 %files tools
312 %defattr(-,root,root,-)
313 %manifest systemd.manifest
314 %{_bindir}/systemd-analyze
315
316 %files devel
317 %defattr(-,root,root,-)
318 %manifest systemd.manifest
319 %{_datadir}/pkgconfig/systemd.pc
320 %{_includedir}/systemd/sd-daemon.h
321 %{_includedir}/systemd/sd-login.h
322 %{_includedir}/systemd/sd-id128.h
323 %{_includedir}/systemd/sd-journal.h
324 %{_includedir}/systemd/sd-messages.h
325 %{_libdir}/libsystemd-daemon.so
326 %{_libdir}/libsystemd-login.so
327 %{_libdir}/libsystemd-journal.so
328 %{_libdir}/libsystemd-id128.so
329 %{_libdir}/pkgconfig/libsystemd-daemon.pc
330 %{_libdir}/pkgconfig/libsystemd-login.pc
331 %{_libdir}/pkgconfig/libsystemd-id128.pc
332 %{_libdir}/pkgconfig/libsystemd-journal.pc
333 %{_datadir}/systemd/kbd-model-map
334
335 %files sysv
336 %defattr(-,root,root,-)
337 %doc LICENSE
338 %{_sbindir}/halt
339 %{_sbindir}/init
340 %{_sbindir}/poweroff
341 %{_sbindir}/reboot
342 %{_sbindir}/runlevel
343 %{_sbindir}/shutdown
344 %{_sbindir}/telinit