# TODO:
-# - enable ducktype-docs when it works
+# - enable ducktype-docs when it works and update files if necessary
# - move /etc/dbus-1 from -libs to base after external packages transition to /usr/share/dbus-1
#
# Conditional build:
+%bcond_without apidocs # API docs
%bcond_without apparmor # AppArmor support
+%bcond_with ducktype # ducktype docs
%bcond_without selinux # SELinux support
%bcond_without systemd # systemd at_console support
%bcond_without X11 # X11 support
Summary: D-BUS message bus
Summary(pl.UTF-8): Magistrala przesyłania komunikatów D-BUS
Name: dbus
-Version: 1.12.12
+Version: 1.14.10
Release: 1
License: AFL v2.1 or GPL v2+
Group: Libraries
-Source0: https://dbus.freedesktop.org/releases/dbus/%{name}-%{version}.tar.gz
-# Source0-md5: ea11069521beeee4e47f0086596a43c8
+Source0: https://dbus.freedesktop.org/releases/dbus/%{name}-%{version}.tar.xz
+# Source0-md5: 46070a3487817ff690981f8cd2ba9376
Source1: messagebus.init
Source2: %{name}-daemon-1-profile.d-sh
Source3: %{name}-sysconfig
BuildRequires: autoconf-archive >= 2019.01.06
BuildRequires: automake >= 1:1.13
BuildRequires: docbook-dtd44-xml
-BuildRequires: doxygen
+%{?with_apidocs:BuildRequires: doxygen}
BuildRequires: expat-devel >= %{expat_version}
%{?with_apparmor:BuildRequires: libapparmor-devel >= 1:2.10}
BuildRequires: libcap-ng-devel
BuildRequires: libtool >= 2:2.0
BuildRequires: libxslt-progs
BuildRequires: pkgconfig
-#BuildRequires: python3-ducktype
-BuildRequires: rpmbuild(macros) >= 1.626
+%{?with_ducktype:BuildRequires: python3-ducktype}
+BuildRequires: rpm-build >= 4.6
+BuildRequires: rpmbuild(macros) >= 2.011
BuildRequires: sed >= 4.0
%{?with_systemd:BuildRequires: systemd-devel >= 32}
+BuildRequires: tar >= 1:1.22
BuildRequires: xmlto
%{?with_X11:BuildRequires: xorg-lib-libX11-devel}
-BuildRequires: yelp-tools
+BuildRequires: xz
+%{?with_ducktype:BuildRequires: yelp-tools}
Requires(post,postun): /sbin/ldconfig
Requires(post,preun): /sbin/chkconfig
Requires(postun): /usr/sbin/groupdel
Requires(pre): /usr/bin/getgid
Requires(pre): /usr/sbin/groupadd
Requires(pre): /usr/sbin/useradd
-Requires(post,preun,postun): systemd-units >= 38
+Requires(post,preun,postun): systemd-units >= 1:250.1
Requires: %{name}-libs = %{version}-%{release}
Requires: expat >= %{expat_version}
%{?with_apparmor:Requires: libapparmor >= 1:2.10}
%{?with_selinux:Requires: libselinux >= 2.0.86}
Requires: rc-scripts >= 0.4.3.0
-Requires: systemd-units >= 38
+Requires: systemd-units >= 1:250.1
Provides: group(messagebus)
Provides: user(messagebus)
-Obsoletes: dbus-glib-tools
-Obsoletes: dbus-systemd
+Obsoletes: dbus-glib-tools < 0.91
+Obsoletes: dbus-systemd < 1.4.16-5
+Obsoletes: dbus-upstart < 1.8.16-3
Conflicts: pam < 0.99.7.1
# not available for dbus 0.9x yet(?)
#Obsoletes: dbus-gtk dbus-gcj dbus-gcj-devel dbus-gcj-static
Summary(pl.UTF-8): Biblioteka D-BUS
Group: Libraries
%{?with_systemd:Requires: systemd-libs >= 32}
-Obsoletes: dbus-dirs
+Obsoletes: dbus-dirs < 1.6.14
%description libs
D-BUS library.
Group: Documentation
# dbus.devhelp refers also to common docs packaged in -devel
Requires: %{name}-devel = %{version}-%{release}
-%if "%{_rpmversion}" >= "5"
BuildArch: noarch
-%endif
%description apidocs
D-BUS API documentation.
Summary(pl.UTF-8): Obsługa sesji X11 dla D-BUS
Group: X11/Applications
Requires: %{name} = %{version}-%{release}
-Obsoletes: dbus-X11
+Obsoletes: dbus-X11 < 0.62-2
%description x11
This package contains D-BUS utilities to start D-BUS service together
%patch3 -p1
%patch4 -p1
+%{__sed} -i -e '1s,/usr/bin/env python,%{__python},' tools/GetAllMatchRules.py
+
%build
%{__libtoolize}
%{__aclocal} -I m4
%{__autoheader}
%{__automake}
%configure \
+ %{!?with_apidocs:--disable-doxygen-docs} \
%{!?with_apparmor:--disable-apparmor} \
--disable-asserts \
- --disable-ducktype-docs \
+ %{!?with_ducktype:--disable-ducktype-docs} \
%{?debug:--enable-verbose-mode} \
%{!?with_selinux:--disable-selinux} \
--disable-silent-rules \
cp -p %{SOURCE5} $RPM_BUILD_ROOT%{systemdtmpfilesdir}/%{name}.conf
+%if %{with systemd}
ln -s dbus.service $RPM_BUILD_ROOT%{systemdunitdir}/messagebus.service
-# for local configuration in dbus 1.10+
-install -d $RPM_BUILD_ROOT/etc/dbus-1/{session.d,system.d}
-
# we are creating messagebus user from rpm pre
%{__rm} $RPM_BUILD_ROOT/usr/lib/sysusers.d/dbus.conf
+%endif
+
+# for local configuration in dbus 1.10+
+install -d $RPM_BUILD_ROOT/etc/dbus-1/{session.d,system.d}
%clean
rm -rf $RPM_BUILD_ROOT
%service -n messagebus restart "D-Bus daemon"
export NORESTART="yes"
%systemd_post messagebus.service
+%systemd_user_post dbus.service dbus.socket
%preun
if [ "$1" = "0" ];then
%service messagebus stop
/sbin/chkconfig --del messagebus
fi
+%systemd_user_preun dbus.service dbus.socket
%postun
if [ "$1" = "0" ]; then
%{_mandir}/man1/dbus-test-tool.1*
%{_mandir}/man1/dbus-update-activation-environment.1*
+%if %{with systemd}
%{systemdunitdir}/dbus.service
%{systemdunitdir}/dbus.socket
%{systemdunitdir}/messagebus.service
%{systemduserunitdir}/dbus.service
%{systemduserunitdir}/dbus.socket
%{systemduserunitdir}/sockets.target.wants/dbus.socket
+%endif
%files libs
%defattr(644,root,root,755)
-%doc AUTHORS COPYING ChangeLog NEWS README doc/TODO
+%doc AUTHORS CONTRIBUTING.md COPYING NEWS README doc/TODO
%attr(755,root,root) %{_libdir}/libdbus-1.so.*.*.*
%attr(755,root,root) %ghost %{_libdir}/libdbus-1.so.3
%dir %{_datadir}/dbus-1
%defattr(644,root,root,755)
%{_libdir}/libdbus-1.a
+%if %{with apidocs}
%files apidocs
%defattr(644,root,root,755)
%{_docdir}/dbus/api
%{_docdir}/dbus/dbus.devhelp2
+%endif
%files x11
%defattr(644,root,root,755)