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