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