fix update
[scm/bb/tizen.git] / proto-meta-Tizen_generic / specfile-initial / systemd / packaging / systemd.spec
1 Name:           systemd
2 Version:        208
3 Release:        0
4 # For a breakdown of the licensing, see README
5 License:        LGPL-2.0+ and MIT and GPL-2.0+
6 Summary:        A System and Service Manager
7 Url:            http://www.freedesktop.org/wiki/Software/systemd
8 Group:          Base/Startup
9 Source0:        http://www.freedesktop.org/software/systemd/%{name}-%{version}.tar.xz
10 Source1:        pamconsole-tmp.conf
11 Source1001:     systemd.manifest
12 BuildRequires:  gperf
13 BuildRequires:  hwdata
14 BuildRequires:  intltool >= 0.40.0
15 BuildRequires:  libacl-devel
16 BuildRequires:  libblkid-devel >= 2.20
17 BuildRequires:  libcap-devel
18 BuildRequires:  libgcrypt-devel
19 BuildRequires:  libkmod-devel >= 14
20 BuildRequires:  libxslt
21 BuildRequires:  pam-devel
22 BuildRequires:  pkgconfig
23 BuildRequires:  usbutils >= 0.82
24 BuildRequires:  pkgconfig(dbus-1)
25 BuildRequires:  pkgconfig(glib-2.0)
26 BuildRequires:  pkgconfig(liblzma)
27 BuildRequires:  pkgconfig(libpci)
28 BuildRequires:  attr-devel
29 Requires:       dbus
30 Requires:       filesystem
31 Requires:       hwdata
32 Requires(post): coreutils
33 Requires(post): gawk
34 Requires(pre):  coreutils
35 Requires(pre):  /usr/bin/getent
36 Requires(pre):  /usr/sbin/groupadd
37
38 Obsoletes:      SysVinit < 2.86-24
39 Obsoletes:      sysvinit < 2.86-24
40 Provides:       SysVinit = 2.86-24
41 Provides:       sysvinit = 2.86-24
42 Provides:       /bin/systemctl
43 Provides:       /sbin/shutdown
44 Provides:       udev = %{version}
45 Obsoletes:      udev < 183
46
47 %description
48 systemd is a system and service manager for Linux, compatible with
49 SysV and LSB init scripts. systemd provides aggressive parallelization
50 capabilities, uses socket and D-Bus activation for starting services,
51 offers on-demand starting of daemons, keeps track of processes using
52 Linux cgroups, supports snapshotting and restoring of the system
53 state, maintains mount and automount points and implements an
54 elaborate transactional dependency-based service control logic. It can
55 work as a drop-in replacement for sysvinit.
56
57 %package -n libsystemd
58 License:        LGPL-2.0+ and MIT
59 Summary:        Systemd libraries
60 Group:          Base/Startup
61 Obsoletes:      libudev < 183
62 Obsoletes:      systemd < 185-4
63 Conflicts:      systemd < 185-4
64
65 %description -n libsystemd
66 Libraries for systemd and udev, as well as the systemd PAM module.
67
68 %package devel
69 License:        LGPL-2.0+ and MIT
70 Summary:        Development headers for systemd
71 Requires:       %{name} = %{version}
72 Provides:       libudev-devel = %{version}
73 Obsoletes:      libudev-devel < 183
74
75 %description devel
76 Development headers and auxiliary files for developing applications for systemd.
77
78 %package analyze
79 License:        LGPL-2.0+
80 Summary:        Tool for processing systemd profiling information
81 Requires:       %{name} = %{version}
82 Obsoletes:      systemd < 38-5
83
84 %description analyze
85 'systemd-analyze blame' lists which systemd unit needed how much time to finish
86 initialization at boot.
87 'systemd-analyze plot' renders an SVG visualizing the parallel start of units
88 at boot.
89
90 %package -n libgudev
91 License:        LGPL-2.0+
92 Summary:        Libraries for adding libudev support to applications that use glib
93 Requires:       %{name} = %{version}
94
95 %description -n libgudev
96 This package contains the libraries that make it easier to use libudev
97 functionality from applications that use glib.
98
99 %package -n libgudev-devel
100 License:        LGPL-2.0+
101 Summary:        Header files for adding libudev support to applications that use glib
102 Requires:       libgudev = %{version}
103
104 %description -n libgudev-devel
105 This package contains the header and pkg-config files for developing
106 glib-based applications using libudev functionality.
107
108 %prep
109 %setup -q
110 cp %{SOURCE1001} .
111
112 %build
113 %autogen
114 %configure \
115         --enable-bootchart \
116         --libexecdir=%{_prefix}/lib \
117         --docdir=%{_docdir}/systemd \
118         --disable-static \
119         --with-sysvinit-path= \
120         --with-sysvrcnd-path= \
121         --with-smack-run-label=System
122 make %{?_smp_mflags} \
123         systemunitdir=%{_unitdir} \
124         userunitdir=%{_unitdir_user}
125
126 %install
127 %make_install
128
129 # udev links
130 %{_bindir}/mkdir -p %{buildroot}/%{_sbindir}
131 %{_bindir}/ln -sf ../bin/udevadm %{buildroot}%{_sbindir}/udevadm
132 %{_bindir}/mkdir -p %{buildroot}%{_prefix}/lib/firmware/updates
133
134 # Create SysV compatibility symlinks. systemctl/systemd are smart
135 # enough to detect in which way they are called.
136 %{_bindir}/ln -s ../lib/systemd/systemd %{buildroot}%{_sbindir}/init
137 %{_bindir}/ln -s ../lib/systemd/systemd %{buildroot}%{_bindir}/systemd
138 %{_bindir}/ln -s ../bin/systemctl %{buildroot}%{_sbindir}/reboot
139 %{_bindir}/ln -s ../bin/systemctl %{buildroot}%{_sbindir}/halt
140 %{_bindir}/ln -s ../bin/systemctl %{buildroot}%{_sbindir}/poweroff
141 %{_bindir}/ln -s ../bin/systemctl %{buildroot}%{_sbindir}/shutdown
142 %{_bindir}/ln -s ../bin/systemctl %{buildroot}%{_sbindir}/telinit
143 %{_bindir}/ln -s ../bin/systemctl %{buildroot}%{_sbindir}/runlevel
144
145 # legacy links
146 %{_bindir}/ln -s loginctl %{buildroot}%{_bindir}/systemd-loginctl
147
148 # We create all wants links manually at installation time to make sure
149 # they are not owned and hence overriden by rpm after the used deleted
150 # them.
151 %{_bindir}/rm -r %{buildroot}%{_sysconfdir}/systemd/system/*.target.wants
152
153 # Make sure the ghost-ing below works
154 %{_bindir}/touch %{buildroot}%{_sysconfdir}/systemd/system/runlevel2.target
155 %{_bindir}/touch %{buildroot}%{_sysconfdir}/systemd/system/runlevel3.target
156 %{_bindir}/touch %{buildroot}%{_sysconfdir}/systemd/system/runlevel4.target
157 %{_bindir}/touch %{buildroot}%{_sysconfdir}/systemd/system/runlevel5.target
158
159 # Make sure these directories are properly owned
160 %{_bindir}/mkdir -p %{buildroot}%{_prefix}/lib/systemd/system/basic.target.wants
161 %{_bindir}/mkdir -p %{buildroot}%{_prefix}/lib/systemd/system/default.target.wants
162 %{_bindir}/mkdir -p %{buildroot}%{_prefix}/lib/systemd/system/dbus.target.wants
163 %{_bindir}/mkdir -p %{buildroot}%{_prefix}/lib/systemd/system/syslog.target.wants
164
165 # Make sure the user generators dir exists too
166 %{_bindir}/mkdir -p %{buildroot}%{_prefix}/lib/systemd/system-generators
167 %{_bindir}/mkdir -p %{buildroot}%{_prefix}/lib/systemd/user-generators
168
169 # Create new-style configuration files so that we can ghost-own them
170 %{_bindir}/touch %{buildroot}%{_sysconfdir}/hostname
171 %{_bindir}/touch %{buildroot}%{_sysconfdir}/vconsole.conf
172 %{_bindir}/touch %{buildroot}%{_sysconfdir}/locale.conf
173 %{_bindir}/touch %{buildroot}%{_sysconfdir}/machine-id
174 %{_bindir}/touch %{buildroot}%{_sysconfdir}/machine-info
175 %{_bindir}/touch %{buildroot}%{_sysconfdir}/timezone
176 #%{_bindir}/mkdir -p %{buildroot}%{_sysconfdir}/X11/xorg.conf.d
177 #%{_bindir}/touch %{buildroot}%{_sysconfdir}/X11/xorg.conf.d/00-keyboard.conf
178
179 %{_bindir}/mkdir -p %{buildroot}%{_prefix}/lib/systemd/system-preset/
180 %{_bindir}/mkdir -p %{buildroot}%{_prefix}/lib/systemd/user-preset/
181
182 # Make sure the shutdown/sleep drop-in dirs exist
183 %{_bindir}/mkdir -p %{buildroot}%{_prefix}/lib/systemd/system-shutdown/
184 %{_bindir}/mkdir -p %{buildroot}%{_prefix}/lib/systemd/system-sleep/
185
186 # Make sure the NTP units dir exists
187 %{_bindir}/mkdir -p %{buildroot}%{_prefix}/lib/systemd/ntp-units.d/
188
189 # Install modprobe fragment
190 %{_bindir}/mkdir -p %{buildroot}%{_sysconfdir}/modprobe.d/
191
192 # Enable readahead services
193 %{_bindir}/ln -s ../systemd-readahead-collect.service %{buildroot}%{_prefix}/lib/systemd/system/default.target.wants/
194 %{_bindir}/ln -s ../systemd-readahead-replay.service %{buildroot}%{_prefix}/lib/systemd/system/default.target.wants/
195
196 # Fix the dangling /var/lock -> /run/lock symlink
197 install -Dm644 tmpfiles.d/legacy.conf %{buildroot}%{_prefix}/lib/tmpfiles.d/legacy.conf
198
199 install -m644 %{SOURCE1} %{buildroot}%{_prefix}/lib/tmpfiles.d/
200
201 rm -rf %{buildroot}/%{_prefix}/lib/systemd/user/default.target
202
203 rm -rf %{buildroot}/%{_docdir}/%{name}
204
205 # Move macros to the proper location for Tizen
206 mkdir -p %{buildroot}%{_sysconfdir}/rpm
207 install -m644 src/core/macros.systemd %{buildroot}%{_sysconfdir}/rpm/macros.systemd
208 rm -f %{buildroot}%{_prefix}/lib/rpm/macros.d/macros.systemd
209
210 %pre
211 %{_bindir}/getent group cdrom >/dev/null 2>&1 || %{_sbindir}/groupadd -r -g 11 cdrom >/dev/null 2>&1 || :
212 %{_bindir}/getent group tape >/dev/null 2>&1 || %{_sbindir}/groupadd -r -g 33 tape >/dev/null 2>&1 || :
213 %{_bindir}/getent group dialout >/dev/null 2>&1 || %{_sbindir}/groupadd -r -g 18 dialout >/dev/null 2>&1 || :
214 %{_bindir}/getent group floppy >/dev/null 2>&1 || %{_sbindir}/groupadd -r -g 19 floppy >/dev/null 2>&1 || :
215 %{_bindir}/systemctl stop systemd-udevd-control.socket systemd-udevd-kernel.socket systemd-udevd.service >/dev/null 2>&1 || :
216
217 # Rename configuration files that changed their names
218 %{_bindir}/mv -n %{_sysconfdir}/systemd/systemd-logind.conf %{_sysconfdir}/systemd/logind.conf >/dev/null 2>&1 || :
219 %{_bindir}/mv -n %{_sysconfdir}/systemd/systemd-journald.conf %{_sysconfdir}/systemd/journald.conf >/dev/null 2>&1 || :
220
221 %post
222 %{_bindir}/systemd-machine-id-setup > /dev/null 2>&1 || :
223 %{_prefix}/lib/systemd/systemd-random-seed save > /dev/null 2>&1 || :
224 %{_bindir}/systemctl daemon-reexec > /dev/null 2>&1 || :
225 %{_bindir}/systemctl start systemd-udevd.service >/dev/null 2>&1 || :
226
227 %postun
228 if [ $1 -ge 1 ] ; then
229         %{_bindir}/systemctl daemon-reload > /dev/null 2>&1 || :
230         %{_bindir}/systemctl try-restart systemd-logind.service >/dev/null 2>&1 || :
231 fi
232
233 %preun
234 if [ $1 -eq 0 ] ; then
235         %{_bindir}/systemctl disable \
236                 getty@.service \
237                 remote-fs.target \
238                 systemd-readahead-replay.service \
239                 systemd-readahead-collect.service >/dev/null 2>&1 || :
240
241         %{_bindir}/rm -f %{_sysconfdir}/systemd/system/default.target >/dev/null 2>&1 || :
242 fi
243
244 %post -n libsystemd -p /sbin/ldconfig
245 %postun -n libsystemd  -p /sbin/ldconfig
246
247 %post -n libgudev -p /sbin/ldconfig
248 %postun -n libgudev -p /sbin/ldconfig
249
250
251
252 %files
253 %manifest %{name}.manifest
254 %config %{_sysconfdir}/systemd/bootchart.conf
255 %config %{_sysconfdir}/pam.d/systemd-user
256 %{_bindir}/bootctl
257 %{_bindir}/kernel-install
258 %{_bindir}/machinectl
259 %{_bindir}/systemd-run
260 %dir %{_prefix}/lib/kernel
261 %dir %{_prefix}/lib/kernel/install.d
262 %{_prefix}/lib/kernel/install.d/50-depmod.install
263 %{_prefix}/lib/kernel/install.d/90-loaderentry.install
264 %{_prefix}/lib/systemd/system-generators/systemd-efi-boot-generator
265 %{_bindir}/hostnamectl
266 %{_bindir}/localectl
267 %{_bindir}/systemd-coredumpctl
268 %{_bindir}/timedatectl
269 %dir %{_sysconfdir}/systemd
270 %dir %{_sysconfdir}/systemd/system
271 %dir %{_sysconfdir}/systemd/user
272 %dir %{_sysconfdir}/tmpfiles.d
273 %dir %{_sysconfdir}/sysctl.d
274 %dir %{_sysconfdir}/modules-load.d
275 %dir %{_sysconfdir}/binfmt.d
276 %{_datadir}/bash-completion/*
277 %dir %{_datadir}/zsh/site-functions
278 %{_datadir}/zsh/site-functions/*
279 %dir %{_sysconfdir}/udev
280 %dir %{_sysconfdir}/udev/rules.d
281 %dir %{_prefix}/lib/systemd
282 %dir %{_prefix}/lib/systemd/system
283 %dir %{_prefix}/lib/systemd/system-generators
284 %dir %{_prefix}/lib/systemd/user-generators
285 %dir %{_prefix}/lib/systemd/system-preset
286 %dir %{_prefix}/lib/systemd/user-preset
287 %dir %{_prefix}/lib/systemd/system-shutdown
288 %dir %{_prefix}/lib/systemd/system-sleep
289 %dir %{_prefix}/lib/tmpfiles.d
290 %dir %{_prefix}/lib/sysctl.d
291 %dir %{_prefix}/lib/modules-load.d
292 %dir %{_prefix}/lib/binfmt.d
293 %dir %{_prefix}/lib/firmware
294 %dir %{_prefix}/lib/firmware/updates
295 %dir %{_datadir}/systemd
296 %config(noreplace) %{_sysconfdir}/dbus-1/system.d/org.freedesktop.systemd1.conf
297 %config(noreplace) %{_sysconfdir}/dbus-1/system.d/org.freedesktop.hostname1.conf
298 %config(noreplace) %{_sysconfdir}/dbus-1/system.d/org.freedesktop.login1.conf
299 %config(noreplace) %{_sysconfdir}/dbus-1/system.d/org.freedesktop.locale1.conf
300 %config(noreplace) %{_sysconfdir}/dbus-1/system.d/org.freedesktop.timedate1.conf
301 %config(noreplace) %{_sysconfdir}/dbus-1/system.d/org.freedesktop.machine1.conf
302 %config(noreplace) %{_sysconfdir}/systemd/system.conf
303 %config(noreplace) %{_sysconfdir}/systemd/user.conf
304 %config(noreplace) %{_sysconfdir}/systemd/logind.conf
305 %config(noreplace) %{_sysconfdir}/systemd/journald.conf
306 %config(noreplace) %{_sysconfdir}/udev/udev.conf
307 #%{_sysconfdir}/bash_completion.d/systemd-bash-completion.sh
308 %config %{_sysconfdir}/rpm/macros.systemd
309 %{_sysconfdir}/xdg/systemd
310 %ghost %config(noreplace) %{_sysconfdir}/hostname
311 %ghost %config(noreplace) %{_sysconfdir}/vconsole.conf
312 %ghost %config(noreplace) %{_sysconfdir}/locale.conf
313 %ghost %config(noreplace) %{_sysconfdir}/machine-id
314 %ghost %config(noreplace) %{_sysconfdir}/machine-info
315 %ghost %config(noreplace) %{_sysconfdir}/timezone
316 %{_bindir}/systemd
317 %{_bindir}/systemctl
318 %{_bindir}/systemd-notify
319 %{_bindir}/systemd-ask-password
320 %{_bindir}/systemd-tty-ask-password-agent
321 %{_bindir}/systemd-machine-id-setup
322 %{_bindir}/loginctl
323 %{_bindir}/systemd-loginctl
324 %{_bindir}/journalctl
325 %{_bindir}/systemd-tmpfiles
326 %{_bindir}/systemd-nspawn
327 %{_bindir}/systemd-stdio-bridge
328 %{_bindir}/systemd-cat
329 %{_bindir}/systemd-cgls
330 %{_bindir}/systemd-cgtop
331 %{_bindir}/systemd-delta
332 %{_bindir}/systemd-detect-virt
333 %{_bindir}/systemd-inhibit
334 %{_bindir}/udevadm
335 %{_prefix}/lib/sysctl.d/*.conf
336 %{_prefix}/lib/systemd/systemd
337 %{_prefix}/lib/systemd/system
338
339 %dir %{_prefix}/lib/systemd/system/basic.target.wants
340 %dir %{_prefix}/lib/systemd/user
341 %{_prefix}/lib/systemd/user/bluetooth.target
342 %{_prefix}/lib/systemd/user/exit.target
343 %{_prefix}/lib/systemd/user/printer.target
344 %{_prefix}/lib/systemd/user/shutdown.target
345 %{_prefix}/lib/systemd/user/sockets.target
346 %{_prefix}/lib/systemd/user/sound.target
347 %{_prefix}/lib/systemd/user/systemd-exit.service
348 %{_prefix}/lib/systemd/user/paths.target
349 %{_prefix}/lib/systemd/user/smartcard.target
350 %{_prefix}/lib/systemd/user/timers.target
351
352 %{_prefix}/lib/systemd/systemd-*
353 %dir %{_prefix}/lib/systemd/catalog
354 %{_prefix}/lib/systemd/catalog/systemd.catalog
355 %{_prefix}/lib/udev
356 %{_prefix}/lib/systemd/system-generators/systemd-getty-generator
357 %{_prefix}/lib/systemd/system-generators/systemd-fstab-generator
358 %{_prefix}/lib/systemd/system-generators/systemd-system-update-generator
359 %{_prefix}/lib/systemd/system-generators/systemd-gpt-auto-generator
360 %{_prefix}/lib/tmpfiles.d/systemd.conf
361 %{_prefix}/lib/tmpfiles.d/x11.conf
362 %{_prefix}/lib/tmpfiles.d/tmp.conf
363 %{_prefix}/lib/tmpfiles.d/legacy.conf
364 %{_prefix}/lib/tmpfiles.d/pamconsole-tmp.conf
365 %{_sbindir}/init
366 %{_sbindir}/reboot
367 %{_sbindir}/halt
368 %{_sbindir}/poweroff
369 %{_sbindir}/shutdown
370 %{_sbindir}/telinit
371 %{_sbindir}/runlevel
372 %{_sbindir}/udevadm
373 %{_datadir}/systemd/kbd-model-map
374 %{_datadir}/dbus-1/services/org.freedesktop.systemd1.service
375 %{_datadir}/dbus-1/system-services/org.freedesktop.systemd1.service
376 %{_datadir}/dbus-1/system-services/org.freedesktop.hostname1.service
377 %{_datadir}/dbus-1/system-services/org.freedesktop.login1.service
378 %{_datadir}/dbus-1/system-services/org.freedesktop.locale1.service
379 %{_datadir}/dbus-1/system-services/org.freedesktop.timedate1.service
380 %{_datadir}/dbus-1/system-services/org.freedesktop.machine1.service
381 %{_datadir}/dbus-1/interfaces/org.freedesktop.systemd1.*.xml
382 %{_datadir}/dbus-1/interfaces/org.freedesktop.hostname1.xml
383 %{_datadir}/dbus-1/interfaces/org.freedesktop.locale1.xml
384 %{_datadir}/dbus-1/interfaces/org.freedesktop.timedate1.xml
385 %dir %{_datadir}/polkit-1
386 %dir %{_datadir}/polkit-1/actions
387 %{_datadir}/polkit-1/actions/org.freedesktop.systemd1.policy
388 %{_datadir}/polkit-1/actions/org.freedesktop.hostname1.policy
389 %{_datadir}/polkit-1/actions/org.freedesktop.login1.policy
390 %{_datadir}/polkit-1/actions/org.freedesktop.locale1.policy
391 %{_datadir}/polkit-1/actions/org.freedesktop.timedate1.policy
392 %{_datadir}/pkgconfig/systemd.pc
393 %{_datadir}/pkgconfig/udev.pc
394
395 # Make sure we don't remove runlevel targets from F14 alpha installs,
396 # but make sure we don't create then anew.
397 %ghost %config(noreplace) %{_sysconfdir}/systemd/system/runlevel2.target
398 %ghost %config(noreplace) %{_sysconfdir}/systemd/system/runlevel3.target
399 %ghost %config(noreplace) %{_sysconfdir}/systemd/system/runlevel4.target
400 %ghost %config(noreplace) %{_sysconfdir}/systemd/system/runlevel5.target
401
402 %files -n libsystemd
403 %manifest %{name}.manifest
404 %{_libdir}/security/pam_systemd.so
405 %{_libdir}/libsystemd-daemon.so.*
406 %{_libdir}/libsystemd-login.so.*
407 %{_libdir}/libsystemd-journal.so.*
408 %{_libdir}/libsystemd-id128.so.*
409 %{_libdir}/libudev.so.*
410 %{_libdir}/libnss_myhostname.so.2
411
412 %files devel
413 %manifest %{name}.manifest
414 %{_libdir}/libsystemd-daemon.so
415 %{_libdir}/libsystemd-login.so
416 %{_libdir}/libsystemd-journal.so
417 %{_libdir}/libsystemd-id128.so
418 %{_libdir}/libudev.so
419 %dir %{_includedir}/systemd
420 %{_includedir}/systemd/sd-daemon.h
421 %{_includedir}/systemd/sd-login.h
422 %{_includedir}/systemd/sd-journal.h
423 %{_includedir}/systemd/sd-id128.h
424 %{_includedir}/systemd/sd-messages.h
425 %{_includedir}/systemd/sd-shutdown.h
426 %{_includedir}/libudev.h
427 %{_libdir}/pkgconfig/libsystemd-daemon.pc
428 %{_libdir}/pkgconfig/libsystemd-login.pc
429 %{_libdir}/pkgconfig/libsystemd-journal.pc
430 %{_libdir}/pkgconfig/libsystemd-id128.pc
431 %{_libdir}/pkgconfig/libudev.pc
432
433
434 %files analyze
435 %manifest %{name}.manifest
436 %{_bindir}/systemd-analyze
437
438 %files -n libgudev
439 %manifest %{name}.manifest
440 %{_libdir}/libgudev-1.0.so.*
441
442 %files -n libgudev-devel
443 %manifest %{name}.manifest
444 %{_libdir}/libgudev-1.0.so
445 %dir %{_includedir}/gudev-1.0
446 %dir %{_includedir}/gudev-1.0/gudev
447 %{_includedir}/gudev-1.0/gudev/*.h
448 %{_libdir}/pkgconfig/gudev-1.0*
449