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- %lib_api |
11 |
|
12 |
%define enable_test 0 |
13 |
%define enable_verbose 0 |
14 |
|
15 |
%define _with_systemd 0 |
16 |
|
17 |
%define git_url git://git.freedesktop.org/git/dbus/dbus |
18 |
|
19 |
Summary: D-Bus message bus |
20 |
Name: dbus |
21 |
Version: 1.4.1 |
22 |
Release: %mkrel 3 |
23 |
URL: http://www.freedesktop.org/Software/dbus |
24 |
Source0: http://dbus.freedesktop.org/releases/dbus/%{name}-%{version}.tar.gz |
25 |
Source1: doxygen_to_devhelp.xsl |
26 |
# (fc) 0.20-1mdk fix start/stop order (fd.o bug #11491), starts after network |
27 |
Patch0: dbus-initscript.patch |
28 |
# (fc) 1.0.2-5mdv disable fatal warnings on check (fd.o bug #13270) |
29 |
Patch3: dbus-1.0.2-disable_fatal_warning_on_check.patch |
30 |
# (fc) 1.1.2-1mdv generate xml doc (Fedora) |
31 |
Patch6: dbus-1.0.1-generate-xml-docs.patch |
32 |
|
33 |
License: GPLv2+ or AFL |
34 |
Group: System/Servers |
35 |
BuildRoot: %{_tmppath}/%{name}-%{version}-root |
36 |
BuildRequires: libx11-devel |
37 |
BuildRequires: expat-devel >= %{expat_version} |
38 |
%if !%bootstrap |
39 |
BuildRequires: xmlto docbook-dtd412-xml |
40 |
BuildRequires: doxygen |
41 |
%endif |
42 |
BuildRequires: libtool |
43 |
BuildRequires: libcap-ng-devel |
44 |
%if %{_with_systemd} |
45 |
BuildRequires: systemd-units |
46 |
%endif |
47 |
Requires(pre): rpm-helper |
48 |
Requires(preun): rpm-helper |
49 |
Requires(post): rpm-helper |
50 |
Requires(postun): rpm-helper |
51 |
Requires(post): chkconfig >= 1.3.37-3mdv |
52 |
Requires(post): %{lib_name} >= %{version}-%{release} |
53 |
Provides: should-restart = system |
54 |
|
55 |
%description |
56 |
D-Bus is a system for sending messages between applications. It is |
57 |
used both for the systemwide message bus service, and as a |
58 |
per-user-login-session messaging facility. |
59 |
|
60 |
%package -n %{lib_name} |
61 |
Summary: Shared library for using D-Bus |
62 |
Group: System/Libraries |
63 |
Requires: dbus >= %{version} |
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 |
78 |
|
79 |
%description -n %develname |
80 |
Headers and static libraries for D-Bus. |
81 |
|
82 |
%package x11 |
83 |
Summary: X11-requiring add-ons for D-Bus |
84 |
Group: System/Servers |
85 |
Requires: dbus = %{version} |
86 |
|
87 |
%package doc |
88 |
Summary: Developer documentation for D-BUS |
89 |
Group: Books/Computer books |
90 |
Requires: dbus = %{version} |
91 |
Suggests: devhelp |
92 |
Conflicts: %develname < 1.2.20 |
93 |
|
94 |
%description doc |
95 |
This package contains developer documentation for D-Bus along with |
96 |
other supporting documentation such as the introspect dtd file. |
97 |
|
98 |
%description x11 |
99 |
D-Bus contains some tools that require Xlib to be installed, those are |
100 |
in this separate package so server systems need not install X. |
101 |
|
102 |
%prep |
103 |
%setup -q |
104 |
%patch0 -p1 -b .initscript |
105 |
#only disable in cooker to detect buggy programs |
106 |
#patch3 -p1 -b .disable_fatal_warning_on_check |
107 |
%patch6 -p1 -b .xmldoc |
108 |
|
109 |
%build |
110 |
|
111 |
#needed for correct localstatedir location |
112 |
%define _localstatedir %{_var} |
113 |
|
114 |
COMMON_ARGS="--disable-selinux --with-system-pid-file=%{_var}/run/messagebus.pid --with-system-socket=%{_var}/run/dbus/system_bus_socket --with-session-socket-dir=/tmp --libexecdir=/%{_lib}/dbus-%{lib_api}" |
115 |
|
116 |
#### Build once with tests to make check |
117 |
%if %{enable_test} |
118 |
%configure2_5x $COMMON_ARGS --enable-tests=yes \ |
119 |
--enable-verbose-mode=yes \ |
120 |
--enable-asserts=yes \ |
121 |
--disable-doxygen-docs \ |
122 |
%if !%{_with_systemd} |
123 |
--without-systemdsystemunitdir \ |
124 |
%endif |
125 |
--disable-xml-docs |
126 |
DBUS_VERBOSE=1 %make |
127 |
make check |
128 |
|
129 |
#### Clean up and build again |
130 |
make clean |
131 |
%endif |
132 |
|
133 |
%configure2_5x $COMMON_ARGS --disable-tests --disable-asserts \ |
134 |
%if !%bootstrap |
135 |
--enable-doxygen-docs --enable-xml-docs \ |
136 |
%endif |
137 |
%if %enable_verbose |
138 |
--enable-verbose-mode=yes |
139 |
%else |
140 |
--enable-verbose-mode=no |
141 |
%endif |
142 |
%make |
143 |
|
144 |
%if !%bootstrap |
145 |
doxygen Doxyfile |
146 |
|
147 |
xsltproc -o dbus.devhelp %{SOURCE1} doc/api/xml/index.xml |
148 |
%endif |
149 |
|
150 |
%check |
151 |
make check |
152 |
|
153 |
%install |
154 |
rm -rf %{buildroot} |
155 |
|
156 |
%makeinstall_std |
157 |
|
158 |
# move lib to /, because it might be needed by hotplug script, before |
159 |
# /usr is mounted |
160 |
mkdir -p $RPM_BUILD_ROOT/%{_lib} %buildroot%{_var}/lib/dbus |
161 |
mv $RPM_BUILD_ROOT%{_libdir}/*dbus-1*.so.* $RPM_BUILD_ROOT/%{_lib} |
162 |
ln -sf ../../%{_lib}/libdbus-%{lib_api}.so.%{lib_major} $RPM_BUILD_ROOT%{_libdir}/libdbus-%{lib_api}.so |
163 |
|
164 |
mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/X11/xinit.d |
165 |
cat << EOF > $RPM_BUILD_ROOT%{_sysconfdir}/X11/xinit.d/30dbus |
166 |
# to be sourced |
167 |
if [ -z "$DBUS_SESSION_BUS_ADDRESS" ]; then |
168 |
eval \`/usr/bin/dbus-launch --exit-with-session --sh-syntax\` |
169 |
fi |
170 |
EOF |
171 |
chmod 755 $RPM_BUILD_ROOT%{_sysconfdir}/X11/xinit.d/30dbus |
172 |
|
173 |
# create directory |
174 |
mkdir $RPM_BUILD_ROOT%{_datadir}/dbus-%{lib_api}/interfaces |
175 |
|
176 |
%if %{_with_systemd} |
177 |
# Make sure that when somebody asks for D-Bus under the name of the |
178 |
# old SysV script, that he ends up with the standard dbus.service name |
179 |
# now. |
180 |
ln -s dbus.service %{buildroot}/lib/systemd/system/messagebus.service |
181 |
%endif |
182 |
|
183 |
#add devhelp compatible helps |
184 |
mkdir -p $RPM_BUILD_ROOT%{_datadir}/devhelp/books/dbus |
185 |
mkdir -p $RPM_BUILD_ROOT%{_datadir}/devhelp/books/dbus/api |
186 |
|
187 |
%if !%bootstrap |
188 |
cp dbus.devhelp $RPM_BUILD_ROOT%{_datadir}/devhelp/books/dbus |
189 |
cp doc/dbus-specification.html $RPM_BUILD_ROOT%{_datadir}/devhelp/books/dbus |
190 |
cp doc/dbus-faq.html $RPM_BUILD_ROOT%{_datadir}/devhelp/books/dbus |
191 |
cp doc/dbus-tutorial.html $RPM_BUILD_ROOT%{_datadir}/devhelp/books/dbus |
192 |
cp doc/api/html/* $RPM_BUILD_ROOT%{_datadir}/devhelp/books/dbus/api |
193 |
%endif |
194 |
|
195 |
#remove unpackaged file |
196 |
rm -f $RPM_BUILD_ROOT%{_libdir}/*.la |
197 |
|
198 |
%clean |
199 |
rm -rf %{buildroot} |
200 |
|
201 |
%pre |
202 |
%_pre_useradd messagebus / /sbin/nologin |
203 |
%_pre_groupadd daemon messagebus |
204 |
|
205 |
%post |
206 |
if [ "$1" = "1" ]; then |
207 |
/usr/bin/dbus-uuidgen --ensure |
208 |
/sbin/chkconfig --add messagebus || /bin/true |
209 |
fi |
210 |
|
211 |
%postun |
212 |
%_postun_userdel messagebus |
213 |
%_postun_groupdel daemon messagebus |
214 |
|
215 |
%preun |
216 |
%_preun_service messagebus |
217 |
|
218 |
%triggerpostun -- dbus < 0.21-4mdk |
219 |
/sbin/chkconfig --del messagebus |
220 |
/sbin/chkconfig --add messagebus |
221 |
|
222 |
%triggerpostun -- dbus < 1.2.4.4permissive-2mdv |
223 |
/sbin/chkconfig --level 7 messagebus reset |
224 |
|
225 |
|
226 |
%files |
227 |
%defattr(-,root,root) |
228 |
|
229 |
%doc COPYING NEWS |
230 |
|
231 |
%dir %{_sysconfdir}/dbus-%{lib_api} |
232 |
%config(noreplace) %{_sysconfdir}/dbus-%{lib_api}/*.conf |
233 |
%{_sysconfdir}/rc.d/init.d/* |
234 |
%dir %{_sysconfdir}/dbus-%{lib_api}/system.d |
235 |
%dir %{_sysconfdir}/dbus-%{lib_api}/session.d |
236 |
%dir %{_var}/run/dbus |
237 |
%dir %{_var}/lib/dbus |
238 |
%dir %{_libdir}/dbus-1.0 |
239 |
%{_bindir}/dbus-daemon |
240 |
%{_bindir}/dbus-send |
241 |
%{_bindir}/dbus-cleanup-sockets |
242 |
%{_bindir}/dbus-uuidgen |
243 |
%{_mandir}/man*/* |
244 |
%dir %{_datadir}/dbus-%{lib_api} |
245 |
%{_datadir}/dbus-%{lib_api}/system-services |
246 |
%{_datadir}/dbus-%{lib_api}/services |
247 |
%{_datadir}/dbus-%{lib_api}/interfaces |
248 |
# See doc/system-activation.txt in source tarball for the rationale |
249 |
# behind these permissions |
250 |
%dir /%{_lib}/dbus-%{lib_api} |
251 |
%attr(4750,root,messagebus) /%{_lib}/dbus-%{lib_api}/dbus-daemon-launch-helper |
252 |
%if %{_with_systemd} |
253 |
/lib/systemd/system/dbus.service |
254 |
/lib/systemd/system/messagebus.service |
255 |
/lib/systemd/system/dbus.socket |
256 |
/lib/systemd/system/dbus.target.wants/dbus.socket |
257 |
/lib/systemd/system/multi-user.target.wants/dbus.service |
258 |
/lib/systemd/system/sockets.target.wants/dbus.socket |
259 |
|
260 |
%endif |
261 |
|
262 |
%files -n %{lib_name} |
263 |
%defattr(-,root,root) |
264 |
/%{_lib}/*dbus-%{lib_api}*.so.%{lib_major}* |
265 |
|
266 |
%files -n %develname |
267 |
%defattr(-,root,root) |
268 |
%doc ChangeLog |
269 |
%{_libdir}/libdbus-%{lib_api}.a |
270 |
%{_libdir}/libdbus-%{lib_api}.so |
271 |
%{_libdir}/dbus-1.0/include |
272 |
%{_libdir}/pkgconfig/dbus-%{lib_api}.pc |
273 |
%{_includedir}/dbus-1.0 |
274 |
|
275 |
%files x11 |
276 |
%defattr(-,root,root) |
277 |
%{_sysconfdir}/X11/xinit.d/* |
278 |
%{_bindir}/dbus-launch |
279 |
%{_bindir}/dbus-monitor |
280 |
|
281 |
%files doc |
282 |
%defattr(-,root,root) |
283 |
%doc doc/introspect.dtd doc/introspect.xsl doc/system-activation.txt |
284 |
%doc %{_datadir}/devhelp/books/dbus |
285 |
|
286 |
|