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