Merge "kdbus: fixed memory leak in "hello" command." into tizen
[platform/upstream/dbus.git] / packaging / dbus.spec
1 %define dbus_user_uid           81
2
3 %bcond_with kdbus
4 %bcond_with dbuspolicy
5
6 Name:           dbus
7 Url:            http://dbus.freedesktop.org/
8 Summary:        D-Bus Message Bus System
9 License:        GPL-2.0+ or AFL-2.1, BSD-2.0, LGPL-2.1+, MIT
10 Group:          Base/IPC
11 # COMMON1-BEGIN
12
13 %define with_systemd 1
14
15 BuildRequires:  expat-devel
16 BuildRequires:  libtool
17 BuildRequires:  libzio
18 BuildRequires:  pkg-config
19 %if %{with_systemd}
20 BuildRequires:  pkgconfig(libsystemd)
21 %endif
22 BuildRequires:  pkgconfig(libsmack)
23 BuildRequires:  pkgconfig(cynara-client-async)
24 BuildRequires:  pkgconfig(cynara-session)
25 Version:        1.10.6
26 Release:        0
27 Source0:        http://dbus.freedesktop.org/releases/dbus/dbus-%{version}.tar.gz
28 Source1:        rc.boot.dbus
29 Source3:        dbus_at_console.ck
30 Source4:        baselibs.conf
31 Source5:        dbus-user.service
32 Source6:        dbus-user.socket
33 Source7:        dbus.sh
34 Source1001:     dbus.manifest
35 BuildRequires:  libcap-ng-devel
36 BuildRequires:  pkgconfig(libsmack)
37 # Enable support for libdbuspolicy (only for kdbus transport)
38 %if %{with kdbus}
39 %if %{with dbuspolicy}
40 BuildRequires:  pkgconfig(libdbuspolicy1)
41 BuildRequires:  pkgconfig(cynara-client)
42 %endif
43 %endif
44 # COMMON1-END
45 Requires(pre):  /usr/sbin/groupadd /usr/sbin/useradd
46 Provides:       dbus-1
47
48 %description
49 D-Bus is a message bus system, a simple way for applications to talk to
50 one another. D-Bus supplies both a system daemon and a
51 per-user-login-session daemon. Also, the message bus is built on top of
52 a general one-to-one message passing framework, which can be used by
53 any two apps to communicate directly (without going through the message
54 bus daemon).
55 .
56 This package provides dbus-daemon.
57
58 %package devel
59 Summary:        Developer package for D-Bus
60 Group:          Development/Libraries
61 Requires:       dbus-libs = %{version}
62
63 %description devel
64 D-Bus is a message bus system, a simple way for applications to talk to
65 one another.
66 .
67 This package provides development libraries.
68
69 %package libs
70 Summary:         Library package for D-Bus
71 Group:           System/Libraries
72
73 %description libs
74 D-Bus is a message bus system, a simple way for applications to talk to
75 one another.
76 .
77 This package provides shared libraries.
78
79
80 %prep
81 # COMMON2-BEGIN
82 %setup -n dbus-%{version} -q
83 cp %{SOURCE1001} .
84
85 %build
86 # We use -fpie/-pie for the whole build; this is the recommended way to harden
87 # the build upstream, see discussion in fdo#46570
88 export CFLAGS="${RPM_OPT_FLAGS} -fno-strict-aliasing -fPIC -fpie"
89 export LDFLAGS="-pie"
90 export CXXFLAGS="${RPM_OPT_FLAGS} -fno-strict-aliasing"
91 export CFLAGS="$CFLAGS -fstack-protector"
92 export CXXFLAGS="$CXXFLAGS -fstack-protector"
93 export V=1
94 %reconfigure \
95     --disable-static                                                    \
96     --with-pic                                                          \
97     --with-dbus-user=dbus                                               \
98     --libexecdir=%{_libdir}/%{name}                                     \
99     --libdir=%{_libdir}                                                 \
100     --with-init-scripts=suse                                            \
101     --enable-inotify                                                    \
102     --disable-doxygen-docs                                              \
103     --disable-xml-docs                                                  \
104 %if %{with_systemd}
105     --enable-systemd                                                    \
106 %endif
107 %if %{with kdbus}
108     --enable-kdbus-transport                                            \
109 %if %{with dbuspolicy}
110     --enable-libdbuspolicy                                              \
111 %endif
112 %endif
113     --with-system-pid-file=/tmp/dbus_launch                             \
114     --with-console-auth-dir=/var/run/dbus/at_console/                   \
115     --with-systemdsystemunitdir=%{_unitdir}                             \
116     --enable-smack \
117     --enable-cynara
118
119 make %{?_smp_mflags}
120
121 %install
122 # COMMON2-END
123 make DESTDIR=%{buildroot} install
124 mkdir -p %{buildroot}/usr/sbin
125 install -d %{buildroot}/%{_localstatedir}/run/dbus
126 mkdir -p %{buildroot}/%{_libdir}/pkgconfig
127 mkdir -p %{buildroot}/lib/dbus-1/system-services
128 mkdir -p %{buildroot}/%{_datadir}/dbus-1/system-services
129 mkdir -p %{buildroot}/%{_datadir}/dbus-1/interfaces
130 #
131 chmod a-x AUTHORS COPYING HACKING NEWS README doc/*.txt doc/file-boilerplate.c doc/TODO
132 #
133 install -d %{buildroot}%{_sysconfdir}/ConsoleKit/run-session.d
134 install -m 755 %{SOURCE3} %{buildroot}%{_sysconfdir}/ConsoleKit/run-session.d
135 mkdir -p %{buildroot}%{_localstatedir}/lib/dbus
136 touch %{buildroot}/%{_localstatedir}/lib/dbus/machine-id
137
138 mkdir -p %{buildroot}%{_unitdir_user}
139 install -m0644 %{SOURCE5} %{buildroot}%{_unitdir_user}/dbus.service
140 install -m0644 %{SOURCE6} %{buildroot}%{_unitdir_user}/dbus.socket
141 rm -rf %{buildroot}/%{_libdir}/*.la
142 rm -rf %{buildroot}/%{_bindir}/dbus-launch
143
144 # install script for login shells (/etc/profile.d)
145 install -d %{buildroot}%{_sysconfdir}/profile.d
146 install -m0644 %{SOURCE7} %{buildroot}%{_sysconfdir}/profile.d/dbus.sh
147
148 # docs
149 rm -rf %{buildroot}%{_datadir}/doc
150
151 %pre
152 # Add the "dbus" user and group
153 /usr/sbin/groupadd -r -g %{dbus_user_uid} dbus 2>/dev/null || :
154 /usr/sbin/useradd -c 'System message bus' -u %{dbus_user_uid} -g %{dbus_user_uid} \
155         -s /sbin/nologin -r -d '/' dbus 2> /dev/null || :
156
157
158 %post libs -p /sbin/ldconfig
159
160 %postun libs -p /sbin/ldconfig
161
162
163 %files
164 %manifest %{name}.manifest
165 %defattr(-, root, root)
166 %dir %{_localstatedir}/lib/dbus
167 %dir /lib/dbus-1
168 %dir /lib/dbus-1/system-services
169 %license  COPYING
170 %config(noreplace) %{_sysconfdir}/dbus-1/session.conf
171 %config(noreplace) %{_sysconfdir}/dbus-1/system.conf
172 %config(noreplace) %{_datadir}/dbus-1/session.conf
173 %config(noreplace) %{_datadir}/dbus-1/system.conf
174 %{_sysconfdir}/ConsoleKit
175 %{_bindir}/dbus-cleanup-sockets
176 %{_bindir}/dbus-daemon
177 %{_bindir}/dbus-monitor
178 %{_bindir}/dbus-run-session
179 %{_bindir}/dbus-send
180 %{_bindir}/dbus-uuidgen
181 %{_bindir}/dbus-test-tool
182 %{_bindir}/dbus-update-activation-environment
183 # See doc/system-activation.txt in source tarball for the rationale
184 # behind these permissions
185 %attr(4750,root,dbus) %verify(not mode) %{_libdir}/dbus/dbus-daemon-launch-helper
186 %ghost %{_localstatedir}/run/dbus
187 %ghost %{_localstatedir}/lib/dbus/machine-id
188 %dir %{_unitdir}
189 %{_unitdir}/dbus.service
190 %{_unitdir}/dbus.socket
191 %{_unitdir_user}/dbus.service
192 %{_unitdir_user}/dbus.socket
193 %dir %{_unitdir}/dbus.target.wants
194 %{_unitdir}/dbus.target.wants/dbus.socket
195 %dir %{_unitdir}/multi-user.target.wants
196 %{_unitdir}/multi-user.target.wants/dbus.service
197 %dir %{_unitdir}/sockets.target.wants
198 %{_unitdir}/sockets.target.wants/dbus.socket
199 %dir %{_sysconfdir}/dbus-1
200 %dir %{_datadir}/dbus-1/session.d
201 %dir %{_datadir}/dbus-1/system.d
202 %dir %{_datadir}/dbus-1
203 %dir %{_datadir}/dbus-1/interfaces
204 %dir %{_datadir}/dbus-1/services
205 %dir %{_datadir}/dbus-1/system-services
206 %{_sysconfdir}/profile.d/dbus.sh
207
208 %files libs
209 %manifest %{name}.manifest
210 %defattr(-, root, root)
211 %{_libdir}/libdbus-1.so.*
212
213 %files devel
214 %manifest %{name}.manifest
215 %defattr(-,root,root)
216 %{_includedir}/*
217 %{_libdir}/libdbus-1.so
218 %{_libdir}/dbus-1.0/include
219 %{_libdir}/pkgconfig/dbus-1.pc
220 %dir %{_libdir}/dbus-1.0
221
222
223 %changelog