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 4 |
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 |
|
36 |
License: GPLv2+ or AFL |
37 |
Group: System/Servers |
38 |
BuildRequires: libx11-devel |
39 |
BuildRequires: expat-devel >= %{expat_version} |
40 |
%if !%bootstrap |
41 |
BuildRequires: xmlto docbook-dtd412-xml |
42 |
BuildRequires: doxygen |
43 |
%endif |
44 |
BuildRequires: libtool |
45 |
BuildRequires: libcap-ng-devel |
46 |
BuildRequires: pkgconfig(gio-2.0) >= 2.24 |
47 |
BuildRequires: pkgconfig(glib-2.0) >= 2.24 |
48 |
BuildRequires: pkgconfig(libsystemd-daemon) >= 32 |
49 |
BuildRequires: pkgconfig(libsystemd-login) >= 32 |
50 |
Requires(pre): rpm-helper >= 0.24.8-1 |
51 |
Requires(preun): rpm-helper >= 0.24.8-1 |
52 |
Provides: should-restart = system |
53 |
|
54 |
%description |
55 |
D-Bus is a system for sending messages between applications. It is |
56 |
used both for the systemwide message bus service, and as a |
57 |
per-user-login-session messaging facility. |
58 |
|
59 |
%package -n %{lib_name} |
60 |
Summary: Shared library for using D-Bus |
61 |
Group: System/Libraries |
62 |
Requires: dbus >= %{version} |
63 |
Obsoletes: %{_lib}dbus-1_3 < 1.6.0 |
64 |
|
65 |
%description -n %{lib_name} |
66 |
D-Bus shared library. |
67 |
|
68 |
%package -n %develname |
69 |
Summary: Libraries and headers for D-Bus |
70 |
Group: Development/C |
71 |
Requires: %{name} = %{version} |
72 |
Requires: %{lib_name} = %{version} |
73 |
Provides: lib%{name}-1-devel = %{version}-%{release} |
74 |
Provides: lib%{name}-devel = %{version}-%{release} |
75 |
Provides: %{name}-devel = %{version}-%{release} |
76 |
Conflicts: %{_lib}dbus-1_0-devel |
77 |
Obsoletes: %{mklibname -d dbus- 1 3} < 1.6.0 |
78 |
Obsoletes: %{_lib}dbus-1-devel < 1.6.0 |
79 |
|
80 |
%description -n %develname |
81 |
Headers and static libraries for D-Bus. |
82 |
|
83 |
%package x11 |
84 |
Summary: X11-requiring add-ons for D-Bus |
85 |
Group: System/Servers |
86 |
Requires: dbus = %{version} |
87 |
|
88 |
%package doc |
89 |
Summary: Developer documentation for D-BUS |
90 |
Group: Documentation |
91 |
Requires: dbus = %{version} |
92 |
Suggests: devhelp |
93 |
BuildArch: noarch |
94 |
Conflicts: libdbus-1-devel < 1.2.20 |
95 |
Conflicts: lib64dbus-1-devel < 1.2.20 |
96 |
|
97 |
%description doc |
98 |
This package contains developer documentation for D-Bus along with |
99 |
other supporting documentation such as the introspect dtd file. |
100 |
|
101 |
%description x11 |
102 |
D-Bus contains some tools that require Xlib to be installed, those are |
103 |
in this separate package so server systems need not install X. |
104 |
|
105 |
%prep |
106 |
%setup -q |
107 |
%apply_patches |
108 |
|
109 |
%build |
110 |
|
111 |
COMMON_ARGS="--disable-static --disable-selinux --with-system-socket=/run/dbus/system_bus_socket --libexecdir=%{_libexecdir}/dbus-%{lib_api}" |
112 |
|
113 |
#### Build once with tests to make check |
114 |
%if %{enable_test} |
115 |
%configure2_5x $COMMON_ARGS --enable-tests=yes --enable-systemd \ |
116 |
--enable-verbose-mode=yes \ |
117 |
--enable-asserts=yes \ |
118 |
--disable-doxygen-docs \ |
119 |
--enable-userdb-cache \ |
120 |
--disable-xml-docs |
121 |
DBUS_VERBOSE=1 %make |
122 |
make check |
123 |
|
124 |
#### Clean up and build again |
125 |
make clean |
126 |
%endif |
127 |
|
128 |
%configure2_5x $COMMON_ARGS --disable-tests --disable-asserts \ |
129 |
%if !%bootstrap |
130 |
--enable-doxygen-docs --enable-xml-docs \ |
131 |
--htmldir=%{_datadir}/devhelp/books/%{name} \ |
132 |
%endif |
133 |
%if %enable_verbose |
134 |
--enable-verbose-mode=yes |
135 |
%else |
136 |
--enable-verbose-mode=no |
137 |
%endif |
138 |
%make |
139 |
|
140 |
%check |
141 |
make check |
142 |
|
143 |
%install |
144 |
%makeinstall_std |
145 |
|
146 |
mkdir -p %{buildroot}%{_sysconfdir}/X11/xinit.d |
147 |
cat << EOF > %{buildroot}%{_sysconfdir}/X11/xinit.d/30dbus |
148 |
# to be sourced |
149 |
if [ -z "\$DBUS_SESSION_BUS_ADDRESS" ]; then |
150 |
eval \`/usr/bin/dbus-launch --exit-with-session --sh-syntax\` |
151 |
fi |
152 |
EOF |
153 |
chmod 755 %{buildroot}%{_sysconfdir}/X11/xinit.d/30dbus |
154 |
|
155 |
# create directory |
156 |
mkdir %{buildroot}%{_datadir}/dbus-%{lib_api}/interfaces |
157 |
|
158 |
# This is legacy |
159 |
rm -rf %{buildroot}%{_unitdir}/dbus.target.wants |
160 |
|
161 |
# link devhelp docs in docdir |
162 |
mkdir -p %{buildroot}%{_docdir}/%{name}-doc |
163 |
pushd %{buildroot}%{_datadir}/devhelp/books/%{name} |
164 |
for f in *; do |
165 |
ln -s ../../devhelp/books/%{name}/$f %{buildroot}%{_docdir}/%{name}-doc |
166 |
done |
167 |
popd |
168 |
|
169 |
#remove unpackaged file |
170 |
find %{buildroot} -name '*.la' -delete |
171 |
|
172 |
%pre |
173 |
%_pre_useradd messagebus / /sbin/nologin |
174 |
%_pre_groupadd daemon messagebus |
175 |
|
176 |
%postun |
177 |
%_postun_userdel messagebus |
178 |
%_postun_groupdel daemon messagebus |
179 |
|
180 |
%files |
181 |
%doc COPYING NEWS |
182 |
%dir %{_sysconfdir}/dbus-%{lib_api} |
183 |
%exclude %{_sysconfdir}/rc.d/init.d/* |
184 |
%config(noreplace) %{_sysconfdir}/dbus-%{lib_api}/*.conf |
185 |
%dir %{_sysconfdir}/dbus-%{lib_api}/system.d |
186 |
%dir %{_sysconfdir}/dbus-%{lib_api}/session.d |
187 |
%dir %{_localstatedir}/lib/dbus |
188 |
%dir %{_libdir}/dbus-1.0 |
189 |
%{_bindir}/dbus-daemon |
190 |
%{_bindir}/dbus-send |
191 |
%{_bindir}/dbus-cleanup-sockets |
192 |
%{_bindir}/dbus-uuidgen |
193 |
%{_mandir}/man*/* |
194 |
%dir %{_datadir}/dbus-%{lib_api} |
195 |
%{_datadir}/dbus-%{lib_api}/system-services |
196 |
%{_datadir}/dbus-%{lib_api}/services |
197 |
%{_datadir}/dbus-%{lib_api}/interfaces |
198 |
# See doc/system-activation.txt in source tarball for the rationale |
199 |
# behind these permissions |
200 |
%dir %{_libexecdir}/dbus-%{lib_api} |
201 |
%attr(4750,root,messagebus) %{_libexecdir}/dbus-%{lib_api}/dbus-daemon-launch-helper |
202 |
%{_unitdir}/dbus.service |
203 |
%{_unitdir}/dbus.socket |
204 |
%{_unitdir}/multi-user.target.wants/dbus.service |
205 |
%{_unitdir}/sockets.target.wants/dbus.socket |
206 |
|
207 |
%files -n %{lib_name} |
208 |
%{_libdir}/*dbus-%{lib_api}*.so.%{lib_major}* |
209 |
|
210 |
%files -n %develname |
211 |
%doc ChangeLog |
212 |
%{_libdir}/libdbus-%{lib_api}.so |
213 |
%{_libdir}/dbus-1.0/include |
214 |
%{_libdir}/pkgconfig/dbus-%{lib_api}.pc |
215 |
%{_includedir}/dbus-1.0 |
216 |
|
217 |
%files x11 |
218 |
%{_sysconfdir}/X11/xinit.d/* |
219 |
%{_bindir}/dbus-launch |
220 |
%{_bindir}/dbus-monitor |
221 |
|
222 |
%files doc |
223 |
%doc %{_datadir}/devhelp/books/dbus |
224 |
%{_docdir}/%{name}-doc |