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