clean up spec file: remove comment out macros and sub packages
[external/systemd.git] / packaging / systemd.spec
1 %define _sbindir /sbin
2 Name:       systemd
3 Summary:    System and Session Manager
4 Version:    43
5 Release:    2
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 Source1002: max_user_inotify.conf
13 Patch1:     0002-systemd-fsck-disable-l-until-linux.patch
14 Patch2:     add-tmp.mount-as-tmpfs.patch
15 Patch3:     tizen-login-location.patch
16 Patch4:     tizen-service-file-workaround.patch
17 Patch5:     journal-make-sure-to-refresh-window-position-and-poi.patch
18 Patch6:     tizen-preserve-hostname.patch
19 Patch7:     util-never-follow-symlinks-in-rm_rf_children.patch
20 Patch8:     util-introduce-memdup.patch
21 Patch9:     main-allow-system-wide-limits-for-services.patch
22 Patch10:    enable-core-dumps-globally.patch
23 Patch11:    SMACK-Add-configuration-options.-v3.patch
24 Patch12:    reboot_syscall_param.patch
25 Patch13:    default_oom_score.patch
26 Patch14:    fix-syscall-NR_fanotify_mark-on-arm.patch
27 Patch15:    reboot-delay.patch
28
29 BuildRequires:  pkgconfig(dbus-1) >= 1.4.0
30 BuildRequires:  pkgconfig(dbus-glib-1)
31 BuildRequires:  pkgconfig(gio-unix-2.0)
32 BuildRequires:  pkgconfig(libudev) >= 174
33 BuildRequires:  libcap-devel
34 BuildRequires:  gperf
35 BuildRequires:  libxslt
36 BuildRequires:  pam-devel
37 BuildRequires:  intltool >= 0.40.0
38 BuildRequires:  libacl-devel
39 BuildRequires:  fdupes
40 BuildRequires:  pkgconfig(libkmod)
41 Requires(post): %{_sbindir}/ldconfig
42 Requires(postun): %{_sbindir}/ldconfig
43
44 %description
45 system and session manager for Linux, compatible with SysV and
46 LSB init scripts. systemd provides aggressive parallelization
47 capabilities, uses socket and D-Bus activation for starting
48 services, offers on-demand starting of daemons, keeps track of
49 processes using Linux cgroups, supports snapshotting and restoring
50 of the system state, maintains mount and automount points and
51 implements an elaborate transactional dependency-based service
52 control logic. It can work as a drop-in replacement for sysvinit.
53
54 %package devel
55 Summary:    Development tools for systemd
56 Group:      Development/Libraries
57 Requires:   %{name} = %{?epoch:%{epoch}:}%{version}-%{release}
58 Requires(post): %{_sbindir}/ldconfig
59 Requires(postun): %{_sbindir}/ldconfig
60
61 %description devel
62 This package includes the libraries and header files you will need
63 to compile applications for systemd.
64
65 %package console-ttyS0
66 Summary:    Systemd console ttyS0
67 Group:      System/System Control
68 Requires:   %{name}
69
70 %description console-ttyS0
71 This package will setup a serial getty for ttyS0 is desired.
72
73
74 %package console-ttyS1
75 Summary:    Systemd console ttyS1
76 Group:      System/System Control
77 Requires:   %{name}
78
79 %description console-ttyS1
80 This package will setup a serial getty for ttyS1 is desired.
81
82
83 %package console-tty01
84 Summary:    Systemd console tty01
85 Group:      System/System Control
86 Requires:   %{name}
87
88 %description console-tty01
89 This package will setup a serial getty for tty01 is desired.
90
91
92 %package console-ttyO2
93 Summary:    Systemd console ttyO2
94 Group:      System/System Control
95 Requires:   %{name}
96
97 %description console-ttyO2
98 This package will setup a serial getty for ttyO2 is desired.
99
100 %package console-ttyMFD2
101 Summary:    Systemd console ttyMFD2
102 Group:      System/System Control
103 Requires:   %{name}
104
105 %description console-ttyMFD2
106 This package will setup a serial getty for ttyMFD2 is desired.
107
108 %package console-ttySAC2
109 Summary:    Systemd console ttySAC2
110 Group:      System/System Control
111 Requires:   %{name}
112
113 %description console-ttySAC2
114 This package will setup a serial getty for ttySAC2 is desired.
115
116
117 %package docs
118 Summary:   System and session manager man pages
119 Group:     Development/Libraries
120 Requires:  %{name} = %{?epoch:%{epoch}:}%{version}-%{release}
121
122 %description docs
123 This package includes the man pages for systemd.
124
125
126 %prep
127 %setup -q -n %{name}-%{version}
128 %patch1 -p1
129 %patch2 -p1
130 %patch3 -p1
131 %patch4 -p1
132 %patch5 -p1
133 %patch6 -p1
134 %patch7 -p1
135 %patch8 -p1
136 %patch9 -p1
137 %patch10 -p1
138 %patch11 -p1
139 %patch12 -p1
140 %patch13 -p1
141 %patch14 -p1
142 %patch15 -p1
143
144 %build
145 cp %{SOURCE1001} .
146 %autogen
147 %configure --disable-static \
148     --with-rootdir="" \
149     --with-distro=meego \
150     --disable-gtk \
151     --disable-selinux \
152     --disable-tcpwrap \
153     --disable-coredump \
154     --enable-split-usr \
155     --disable-manpages \
156     --with-pamlibdir="/%{_libdir}/security" \
157     --with-udevrulesdir="%{_libdir}/udev/rules.d"
158
159 make %{?_smp_mflags}
160
161 %install
162 %make_install
163
164 # Create SysV compatibility symlinks. systemctl/systemd are smart
165 # enough to detect in which way they are called.
166 # install -d %{buildroot}%{_sbindir}/
167 # ln -s ..%{_libdir}/systemd/systemd %{buildroot}%{_sbindir}/init
168 # ln -s ..%{_bindir}/systemctl %{buildroot}%{_sbindir}/halt
169 # ln -s ..%{_bindir}/systemctl %{buildroot}%{_sbindir}/poweroff
170 # ln -s ..%{_bindir}/systemctl %{buildroot}%{_sbindir}/reboot
171 # ln -s ..%{_bindir}/systemctl %{buildroot}%{_sbindir}/runlevel
172 # ln -s ..%{_bindir}/systemctl %{buildroot}%{_sbindir}/shutdown
173 # ln -s ..%{_bindir}/systemctl %{buildroot}%{_sbindir}/telinit
174
175 # /usr compat - delete when no longer needed
176 install -d %{buildroot}/bin/
177 ln -s ..%{_bindir}/systemctl %{buildroot}/bin/systemctl
178
179 mkdir %{buildroot}/run
180
181 # Make sure these directories are properly owned
182 mkdir -p %{buildroot}%{_libdir}/systemd/system/basic.target.wants
183 mkdir -p %{buildroot}%{_libdir}/systemd/system/dbus.target.wants
184
185 # enable readahead by default
186 ln -s ../systemd-readahead-collect.service %{buildroot}%{_libdir}/systemd/system/sysinit.target.wants/systemd-readahead-collect.service
187 ln -s ../systemd-readahead-replay.service %{buildroot}%{_libdir}/systemd/system/sysinit.target.wants/systemd-readahead-replay.service
188
189 # Don't ship documentation in the wrong place
190 rm %{buildroot}/%{_docdir}/systemd/*
191
192 mkdir -p %{buildroot}/etc/systemd/system/basic.target.wants
193 mkdir -p %{buildroot}/etc/systemd/system/getty.target.wants
194 mkdir -p %{buildroot}%{_libdir}/systemd/system/getty.target.wants
195
196 # Modify inotify max_user_instances
197 mkdir -p %{buildroot}/%{_libdir}/sysctl.d
198 cp %{SOURCE1002} %{buildroot}%{_libdir}/sysctl.d/
199
200 #console-ttyMFD2
201 ln -s ../serial-getty@.service %{buildroot}%{_libdir}/systemd/system/getty.target.wants/serial-getty@ttyMFD2.service
202
203 #console-ttySAC2
204 ln -s ../serial-getty@.service %{buildroot}%{_libdir}/systemd/system/getty.target.wants/serial-getty@ttySAC2.service
205
206 #console-ttyS0
207 ln -s ../serial-getty@.service %{buildroot}%{_libdir}/systemd/system/getty.target.wants/serial-getty@ttyS0.service
208
209 #console-ttyS1
210 ln -s ../serial-getty@.service %{buildroot}%{_libdir}/systemd/system/getty.target.wants/serial-getty@ttyS1.service
211
212 #console-tty01
213 ln -s ../serial-getty@.service %{buildroot}%{_libdir}/systemd/system/getty.target.wants/serial-getty@tty01.service
214
215 #console-ttyO2
216 ln -s ../serial-getty@.service %{buildroot}%{_libdir}/systemd/system/getty.target.wants/serial-getty@ttyO2.service
217
218 %post
219 rm -f /etc/mtab
220 ln -sf /proc/self/mounts /etc/mtab
221
222 /usr/bin/systemd-machine-id-setup >/dev/null 2>&1 || :
223
224 %{_sbindir}/ldconfig
225
226 %postun -p %{_sbindir}/ldconfig
227 %post devel -p %{_sbindir}/ldconfig
228 %postun devel -p %{_sbindir}/ldconfig
229
230
231 %files
232 %defattr(-,root,root,-)
233 %manifest systemd.manifest
234 /bin/systemctl
235 %{_bindir}/*
236 # systemd-analyze is excluded for removing dependency with python-base
237 %exclude %{_bindir}/systemd-analyze
238 /run
239 %config %{_sysconfdir}/dbus-1/system.d/org.freedesktop.systemd1.conf
240 %config %{_sysconfdir}/dbus-1/system.d/org.freedesktop.hostname1.conf
241 %config %{_sysconfdir}/dbus-1/system.d/org.freedesktop.locale1.conf
242 %config %{_sysconfdir}/dbus-1/system.d/org.freedesktop.login1.conf
243 %config %{_sysconfdir}/dbus-1/system.d/org.freedesktop.timedate1.conf
244 %attr(0644,root,root) %{_libdir}/udev/rules.d/70-uaccess.rules
245 %attr(0644,root,root) %{_libdir}/udev/rules.d/71-seat.rules
246 %attr(0644,root,root) %{_libdir}/udev/rules.d/73-seat-late.rules
247 %config %{_sysconfdir}/systemd
248 %config %{_sysconfdir}/xdg/systemd/user
249 %config %{_sysconfdir}/bash_completion.d/systemd-bash-completion.sh
250 %{_prefix}/%{_lib}/tmpfiles.d/*
251 %{_libdir}/systemd
252 /%{_libdir}/security/pam_systemd.so
253 %{_libdir}/udev/rules.d/99-systemd.rules
254 %{_libdir}/libsystemd-daemon.so.0
255 %{_libdir}/libsystemd-daemon.so.0.0.1
256 %{_libdir}/libsystemd-login.so.0
257 %{_libdir}/libsystemd-login.so.0.2.0
258 %{_libdir}/libsystemd-id128.so.0
259 %{_libdir}/libsystemd-id128.so.0.0.2
260 %{_libdir}/libsystemd-journal.so.0
261 %{_libdir}/libsystemd-journal.so.0.0.2
262 %{_libdir}/sysctl.d/*
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 %exclude %{_libdir}/systemd/system/getty.target.wants/serial-getty@tty01.service
278 %exclude %{_libdir}/systemd/system/getty.target.wants/serial-getty@ttyMFD2.service
279 %exclude %{_libdir}/systemd/system/getty.target.wants/serial-getty@ttySAC2.service
280 %exclude %{_libdir}/systemd/system/getty.target.wants/serial-getty@ttyO2.service
281 %exclude %{_libdir}/systemd/system/getty.target.wants/serial-getty@ttyS0.service
282 %exclude %{_libdir}/systemd/system/getty.target.wants/serial-getty@ttyS1.service
283 %exclude %{_libdir}/systemd/system/sysinit.target.wants/systemd-vconsole-setup.service
284 %exclude %{_libdir}/systemd/user/default.target
285
286 %files console-ttySAC2
287 %defattr(-,root,root,-)
288 %{_libdir}/systemd/system/getty.target.wants/serial-getty@ttySAC2.service
289
290 %files console-ttyMFD2
291 %defattr(-,root,root,-)
292 %{_libdir}/systemd/system/getty.target.wants/serial-getty@ttyMFD2.service
293
294 %files console-ttyS0
295 %defattr(-,root,root,-)
296 %{_libdir}/systemd/system/getty.target.wants/serial-getty@ttyS0.service
297
298 %files console-ttyS1
299 %defattr(-,root,root,-)
300 %{_libdir}/systemd/system/getty.target.wants/serial-getty@ttyS1.service
301
302 %files console-tty01
303 %defattr(-,root,root,-)
304 %{_libdir}/systemd/system/getty.target.wants/serial-getty@tty01.service
305
306 %files console-ttyO2
307 %defattr(-,root,root,-)
308 %{_libdir}/systemd/system/getty.target.wants/serial-getty@ttyO2.service
309
310
311 # tools package dislabled because of pycairo package dependency
312 # %files tools
313 # %defattr(-,root,root,-)
314 # %manifest systemd.manifest
315 # %{_bindir}/systemd-analyze
316
317 %files devel
318 %defattr(-,root,root,-)
319 %manifest systemd.manifest
320 %{_datadir}/pkgconfig/systemd.pc
321 %{_includedir}/systemd/sd-daemon.h
322 %{_includedir}/systemd/sd-login.h
323 %{_includedir}/systemd/sd-id128.h
324 %{_includedir}/systemd/sd-journal.h
325 %{_includedir}/systemd/sd-messages.h
326 %{_libdir}/libsystemd-daemon.so
327 %{_libdir}/libsystemd-login.so
328 %{_libdir}/libsystemd-journal.so
329 %{_libdir}/libsystemd-id128.so
330 %{_libdir}/pkgconfig/libsystemd-daemon.pc
331 %{_libdir}/pkgconfig/libsystemd-login.pc
332 %{_libdir}/pkgconfig/libsystemd-id128.pc
333 %{_libdir}/pkgconfig/libsystemd-journal.pc
334 %{_datadir}/systemd/kbd-model-map
335
336 # %files sysv
337 # %defattr(-,root,root,-)
338 # %doc LICENSE
339 # %{_sbindir}/halt
340 # %{_sbindir}/init
341 # %{_sbindir}/poweroff
342 # %{_sbindir}/reboot
343 # %{_sbindir}/runlevel
344 # %{_sbindir}/shutdown
345 # %{_sbindir}/telinit