1 |
%define bootstrap 0 |
2 |
%{?_without_bootstrap: %global bootstrap 0} |
3 |
%{?_with_bootstrap: %global bootstrap 1} |
4 |
|
5 |
%define expat_version 2.0.1 |
6 |
|
7 |
%define lib_major 3 |
8 |
%define lib_api 1 |
9 |
%define lib_name %mklibname dbus %{lib_api} %{lib_major} |
10 |
%define develname %mklibname -d dbus |
11 |
|
12 |
%define enable_test 0 |
13 |
%define enable_verbose 0 |
14 |
|
15 |
%define git_url git://git.freedesktop.org/git/dbus/dbus |
16 |
|
17 |
Summary: D-Bus message bus |
18 |
Name: dbus |
19 |
Version: 1.6.8 |
20 |
%define subrel 8 |
21 |
Release: %mkrel 4 |
22 |
URL: http://www.freedesktop.org/Software/dbus |
23 |
Source0: http://dbus.freedesktop.org/releases/dbus/%{name}-%{version}.tar.gz |
24 |
# (cg) See https://bugs.freedesktop.org/show_bug.cgi?id=56043 |
25 |
Patch0: dbus-1.6.8-dbus-spawn-ignore-sigpipe.patch |
26 |
# (cg) CVE-2013-2168 |
27 |
# http://cgit.freedesktop.org/dbus/dbus/commit/?id=954d75b2b64e4799f360d2a6bf9cff6d9fee37e7 |
28 |
Patch1: 0001-CVE-2013-2168-_dbus_printf_string_upper_bound-copy-t.patch |
29 |
# (tmb) CVE-2014-3477 |
30 |
# http://cgit.freedesktop.org/dbus/dbus/commit/?h=dbus-1.6&id=cab1c56bb9d70469128d2ae1c40539c0d3b30f13 |
31 |
Patch2: 0002-CVE-2014-3477-deliver-activation-errors-correctly.patch |
32 |
# (fedora) CVE-2014-3532 and CVE-2014-3533, backported from 1.6 branch |
33 |
Patch3: 0003-CVE-2014-3532-Handle-ETOOMANYREFS-when-sending-recursive-fds.patch |
34 |
Patch4: 0004-CVE-2014-3533-If-loader-cont-two-msgs-with-fds-don-t-corru.patch |
35 |
# (debian) (CVE-2014-3635/6/7/8/9) mga#14012 |
36 |
Patch5: 10001-system-bus-limit-use-max_replies_per_connection-128-.patch |
37 |
Patch6: 10002-config-change-DEFAULT_MESSAGE_UNIX_FDS-to-16.patch |
38 |
Patch7: 10003-config-change-default-auth_timeout-to-20-seconds.patch |
39 |
Patch8: 10004-Stop-listening-on-DBusServer-sockets-when-reaching-m.patch |
40 |
Patch9: 10005-config-add-new-limit-pending_fd_timeout.patch |
41 |
Patch10: 10006-DBusConnection-implements-_dbus_connection_get_pendi.patch |
42 |
Patch11: 10007-DBusConnection-implements-_dbus_connection_set_pendi.patch |
43 |
Patch12: 10008-bus-enforce-pending_fd_timeout.patch |
44 |
Patch13: 10010-_dbus_read_socket_with_unix_fds-do-not-accept-extra-.patch |
45 |
# CVE-2014-7824 |
46 |
Patch14: 10011-dbus-set-fd-rlimit-to-64k-for-the-system-dbus-daemon_CVE-2014-7824.patch |
47 |
|
48 |
License: GPLv2+ or AFL |
49 |
Group: System/Servers |
50 |
BuildRequires: libx11-devel |
51 |
BuildRequires: expat-devel >= %{expat_version} |
52 |
%if !%bootstrap |
53 |
BuildRequires: xmlto docbook-dtd412-xml |
54 |
BuildRequires: doxygen |
55 |
%endif |
56 |
BuildRequires: libtool |
57 |
BuildRequires: libcap-ng-devel |
58 |
BuildRequires: pkgconfig(gio-2.0) >= 2.24 |
59 |
BuildRequires: pkgconfig(glib-2.0) >= 2.24 |
60 |
BuildRequires: pkgconfig(libsystemd-daemon) >= 32 |
61 |
BuildRequires: pkgconfig(libsystemd-login) >= 32 |
62 |
Requires(pre): rpm-helper >= 0.24.8-1 |
63 |
Requires(preun): rpm-helper >= 0.24.8-1 |
64 |
Provides: should-restart = system |
65 |
|
66 |
%description |
67 |
D-Bus is a system for sending messages between applications. It is |
68 |
used both for the systemwide message bus service, and as a |
69 |
per-user-login-session messaging facility. |
70 |
|
71 |
%package -n %{lib_name} |
72 |
Summary: Shared library for using D-Bus |
73 |
Group: System/Libraries |
74 |
Requires: dbus >= %{version} |
75 |
Obsoletes: %{_lib}dbus-1_3 < 1.6.0 |
76 |
|
77 |
%description -n %{lib_name} |
78 |
D-Bus shared library. |
79 |
|
80 |
%package -n %develname |
81 |
Summary: Libraries and headers for D-Bus |
82 |
Group: Development/C |
83 |
Requires: %{name} = %{version} |
84 |
Requires: %{lib_name} = %{version} |
85 |
Provides: lib%{name}-1-devel = %{version}-%{release} |
86 |
Provides: lib%{name}-devel = %{version}-%{release} |
87 |
Provides: %{name}-devel = %{version}-%{release} |
88 |
Conflicts: %{_lib}dbus-1_0-devel |
89 |
Obsoletes: %{mklibname -d dbus- 1 3} < 1.6.0 |
90 |
Obsoletes: %{_lib}dbus-1-devel < 1.6.0 |
91 |
|
92 |
%description -n %develname |
93 |
Headers and static libraries for D-Bus. |
94 |
|
95 |
%package x11 |
96 |
Summary: X11-requiring add-ons for D-Bus |
97 |
Group: System/Servers |
98 |
Requires: dbus = %{version} |
99 |
|
100 |
%package doc |
101 |
Summary: Developer documentation for D-BUS |
102 |
Group: Documentation |
103 |
Requires: dbus = %{version} |
104 |
Suggests: devhelp |
105 |
BuildArch: noarch |
106 |
Conflicts: libdbus-1-devel < 1.2.20 |
107 |
Conflicts: lib64dbus-1-devel < 1.2.20 |
108 |
|
109 |
%description doc |
110 |
This package contains developer documentation for D-Bus along with |
111 |
other supporting documentation such as the introspect dtd file. |
112 |
|
113 |
%description x11 |
114 |
D-Bus contains some tools that require Xlib to be installed, those are |
115 |
in this separate package so server systems need not install X. |
116 |
|
117 |
%prep |
118 |
%setup -q |
119 |
%apply_patches |
120 |
|
121 |
%build |
122 |
|
123 |
COMMON_ARGS="--disable-static --disable-selinux --with-system-socket=/run/dbus/system_bus_socket --libexecdir=%{_libexecdir}/dbus-%{lib_api}" |
124 |
|
125 |
#### Build once with tests to make check |
126 |
%if %{enable_test} |
127 |
%configure2_5x $COMMON_ARGS --enable-tests=yes --enable-systemd \ |
128 |
--enable-verbose-mode=yes \ |
129 |
--enable-asserts=yes \ |
130 |
--disable-doxygen-docs \ |
131 |
--enable-userdb-cache \ |
132 |
--disable-xml-docs |
133 |
DBUS_VERBOSE=1 %make |
134 |
make check |
135 |
|
136 |
#### Clean up and build again |
137 |
make clean |
138 |
%endif |
139 |
|
140 |
%configure2_5x $COMMON_ARGS --disable-tests --disable-asserts \ |
141 |
%if !%bootstrap |
142 |
--enable-doxygen-docs --enable-xml-docs \ |
143 |
--htmldir=%{_datadir}/devhelp/books/%{name} \ |
144 |
%endif |
145 |
%if %enable_verbose |
146 |
--enable-verbose-mode=yes |
147 |
%else |
148 |
--enable-verbose-mode=no |
149 |
%endif |
150 |
%make |
151 |
|
152 |
%check |
153 |
make check |
154 |
|
155 |
%install |
156 |
%makeinstall_std |
157 |
|
158 |
mkdir -p %{buildroot}%{_sysconfdir}/X11/xinit.d |
159 |
cat << EOF > %{buildroot}%{_sysconfdir}/X11/xinit.d/30dbus |
160 |
# to be sourced |
161 |
if [ -z "\$DBUS_SESSION_BUS_ADDRESS" ]; then |
162 |
eval \`/usr/bin/dbus-launch --exit-with-session --sh-syntax\` |
163 |
fi |
164 |
EOF |
165 |
chmod 755 %{buildroot}%{_sysconfdir}/X11/xinit.d/30dbus |
166 |
|
167 |
# create directory |
168 |
mkdir %{buildroot}%{_datadir}/dbus-%{lib_api}/interfaces |
169 |
|
170 |
# This is legacy |
171 |
rm -rf %{buildroot}%{_unitdir}/dbus.target.wants |
172 |
|
173 |
# link devhelp docs in docdir |
174 |
mkdir -p %{buildroot}%{_docdir}/%{name}-doc |
175 |
pushd %{buildroot}%{_datadir}/devhelp/books/%{name} |
176 |
for f in *; do |
177 |
ln -s ../../devhelp/books/%{name}/$f %{buildroot}%{_docdir}/%{name}-doc |
178 |
done |
179 |
popd |
180 |
|
181 |
#remove unpackaged file |
182 |
find %{buildroot} -name '*.la' -delete |
183 |
|
184 |
%pre |
185 |
%_pre_useradd messagebus / /sbin/nologin |
186 |
%_pre_groupadd daemon messagebus |
187 |
|
188 |
%postun |
189 |
%_postun_userdel messagebus |
190 |
%_postun_groupdel daemon messagebus |
191 |
|
192 |
%files |
193 |
%doc COPYING NEWS |
194 |
%dir %{_sysconfdir}/dbus-%{lib_api} |
195 |
%exclude %{_sysconfdir}/rc.d/init.d/* |
196 |
%config(noreplace) %{_sysconfdir}/dbus-%{lib_api}/*.conf |
197 |
%dir %{_sysconfdir}/dbus-%{lib_api}/system.d |
198 |
%dir %{_sysconfdir}/dbus-%{lib_api}/session.d |
199 |
%dir %{_localstatedir}/lib/dbus |
200 |
%dir %{_libdir}/dbus-1.0 |
201 |
%{_bindir}/dbus-daemon |
202 |
%{_bindir}/dbus-send |
203 |
%{_bindir}/dbus-cleanup-sockets |
204 |
%{_bindir}/dbus-uuidgen |
205 |
%{_mandir}/man*/* |
206 |
%dir %{_datadir}/dbus-%{lib_api} |
207 |
%{_datadir}/dbus-%{lib_api}/system-services |
208 |
%{_datadir}/dbus-%{lib_api}/services |
209 |
%{_datadir}/dbus-%{lib_api}/interfaces |
210 |
# See doc/system-activation.txt in source tarball for the rationale |
211 |
# behind these permissions |
212 |
%dir %{_libexecdir}/dbus-%{lib_api} |
213 |
%attr(4750,root,messagebus) %{_libexecdir}/dbus-%{lib_api}/dbus-daemon-launch-helper |
214 |
%{_unitdir}/dbus.service |
215 |
%{_unitdir}/dbus.socket |
216 |
%{_unitdir}/multi-user.target.wants/dbus.service |
217 |
%{_unitdir}/sockets.target.wants/dbus.socket |
218 |
|
219 |
%files -n %{lib_name} |
220 |
%{_libdir}/*dbus-%{lib_api}*.so.%{lib_major}* |
221 |
|
222 |
%files -n %develname |
223 |
%doc ChangeLog |
224 |
%{_libdir}/libdbus-%{lib_api}.so |
225 |
%{_libdir}/dbus-1.0/include |
226 |
%{_libdir}/pkgconfig/dbus-%{lib_api}.pc |
227 |
%{_includedir}/dbus-1.0 |
228 |
|
229 |
%files x11 |
230 |
%{_sysconfdir}/X11/xinit.d/* |
231 |
%{_bindir}/dbus-launch |
232 |
%{_bindir}/dbus-monitor |
233 |
|
234 |
%files doc |
235 |
%doc %{_datadir}/devhelp/books/dbus |
236 |
%{_docdir}/%{name}-doc |