dbus-1/dbus-1.spec
Fridrich Strba 626c513a25 Accepting request 441304 from home:kukuk:branches:Base:System
- Create new subpackage: dbus-1-nox11
  - contains dbus-launch without x11 support
- Rename dbus-launch to dbus-launch.x11
- use update-alternatives to switch between dbus-launch with and
  without X11
- Solves [bnc#934214]

- Create new subpackage: dbus-1-nox11
  - contains dbus-launch without x11 support
- Rename dbus-launch to dbus-launch.x11
- use update-alternatives to switch between dbus-launch with and
  without X11
- Solves [bnc#934214]

OBS-URL: https://build.opensuse.org/request/show/441304
OBS-URL: https://build.opensuse.org/package/show/Base:System/dbus-1?expand=0&rev=221
2016-11-22 08:31:31 +00:00

224 lines
7.3 KiB
RPMSpec

#
# spec file for package dbus-1
#
# Copyright (c) 2016 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
%define with_systemd 1
%define _name dbus
%define _libname libdbus-1-3
%bcond_with docs
%bcond_without selinux
Name: dbus-1
Summary: D-Bus Message Bus System
License: GPL-2.0+ or AFL-2.1
Group: System/Daemons
Url: http://dbus.freedesktop.org/
# WARNING don't use cosmetic beautifiers. it will break the specs after calling pre_checkin script. we don't need to be pretty, but efficient
# COMMON1-BEGIN
Version: 1.10.12
Release: 0
Source0: http://dbus.freedesktop.org/releases/dbus/%{_name}-%{version}.tar.gz
Source2: dbus-1.desktop
Source3: dbus_at_console.ck
Source4: baselibs.conf
Patch0: dbus-log-deny.patch
# PATCH-FIX-OPENSUSE coolo@suse.de -- force a feature configure won't accept without x11 in buildrequires
Patch1: dbus-do-autolaunch.patch
BuildRequires: libcap-ng-devel
BuildRequires: libexpat-devel
BuildRequires: libtool
BuildRequires: pkg-config
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildRequires: pkgconfig(libsystemd-daemon)
BuildRequires: pkgconfig(libsystemd-login)
%if %{with selinux}
BuildRequires: libselinux-devel
%endif
# COMMON1-END
%package -n %{_libname}
Summary: Library package for D-Bus
Group: Development/Libraries/Other
%package -n dbus-1-devel
Summary: Developer package for D-Bus
Group: Development/Libraries/Other
Requires: %{_libname} = %{version}
Requires: dbus-1
Requires: glibc-devel
%package -n dbus-1-nox11
Summary: D-Bus Message Bus System
Group: System/Daemons
Provides: dbus-1-x11
Requires(post): update-alternatives
Requires(preun): update-alternatives
%description
D-Bus is a message bus system, a simple way for applications to talk to
one another. D-Bus supplies both a system daemon and a
per-user-login-session daemon. Also, the message bus is built on top of
a general one-to-one message passing framework, which can be used by
any two apps to communicate directly (without going through the message
bus daemon).
%description -n %{_libname}
D-Bus is a message bus system, a simple way for applications to talk to
one another. D-Bus supplies both a system daemon and a
per-user-login-session daemon. Also, the message bus is built on top of
a general one-to-one message passing framework, which can be used by
any two apps to communicate directly (without going through the message
bus daemon).
%description -n dbus-1-devel
D-Bus is a message bus system, a simple way for applications to talk to
one another. D-Bus supplies both a system daemon and a
per-user-login-session daemon. Also, the message bus is built on top of
a general one-to-one message passing framework, which can be used by
any two apps to communicate directly (without going through the message
bus daemon).
%description -n dbus-1-nox11
D-Bus contains some tools that require Xlib to be installed, which are
normally in the package dbus-1-x11. This package contains the same
tools but without X11 spport for small server systems without X.
%prep
# COMMON2-BEGIN
%setup -q -n %{_name}-%{version}
%patch0 -p1
%patch1 -p1
%build
echo 'HTML_TIMESTAMP=NO' >> Doxyfile.in
autoreconf -fi
# We use -fpie/-pie for the whole build; this is the recommended way to harden
# the build upstream, see discussion in fdo#46570
export CFLAGS="%{optflags} -fno-strict-aliasing -fPIC -fpie"
export LDFLAGS="-pie"
export CXXFLAGS="%{optflags} -fno-strict-aliasing"
export V=1
# is_opensuse was first defined after openSUSE 13.2
%configure \
--disable-static \
--with-pic \
--bindir=/bin \
--libexecdir=/lib/dbus-1 \
--libdir=/%{_lib} \
--with-init-scripts=suse \
--enable-inotify \
%if %{with docs}
--enable-doxygen-docs \
%endif
%if %{with selinux}
--enable-selinux \
%endif
--enable-systemd \
--enable-libaudit \
%if 0%{?suse_version} <= 1315 && !0%{?is_opensuse}
--with-console-auth-dir=/var/run/dbus/at_console/ \
--with-system-pid-file=/var/run/dbus/pid \
--with-system-socket=/var/run/dbus/system_bus_socket \
%else
--with-console-auth-dir=/run/dbus/at_console/ \
--with-system-pid-file=/run/dbus/pid \
--with-system-socket=/run/dbus/system_bus_socket \
%endif
--with-systemdsystemunitdir=%{_unitdir}
make %{?_smp_mflags}
%if %{with docs}
doxygen -u && doxygen
./cleanup-man-pages.sh
%endif
%install
# COMMON2-END
tdir=$(mktemp -d)
make DESTDIR=$tdir install
# devel stuff must not be in /lib
mkdir -p %{buildroot}%{_libdir}
ln -s -v /%{_lib}/$(readlink $tdir/%{_lib}/lib%{name}.so) %{buildroot}%{_libdir}/lib%{name}.so
rm -v $tdir/%{_lib}/lib%{name}.so
mkdir -p %{buildroot}/%{_libdir}/dbus-1.0/include/
mv -f $tdir/%{_lib}/dbus-1.0/include/* %{buildroot}/%{_libdir}/dbus-1.0/include/
rm -f $tdir/%{_lib}/*.la
# dbus-launch, too
mkdir -p $tdir%{_bindir}
mv -f $tdir/bin/dbus-launch $tdir%{_bindir}/dbus-launch.nox11
# fix up pkgconfig file
mkdir -p %{buildroot}/%{_libdir}/pkgconfig
sed -e 's@^\(libdir=\).*@\1%{_libdir}@' $tdir/%{_lib}/pkgconfig/dbus-1.pc > %{buildroot}/%{_libdir}/pkgconfig/dbus-1.pc
rm -f $tdir/%{_lib}/pkgconfig/dbus-1.pc
pushd $tdir
filelist=$(mktemp)
find .%{_includedir} -type f > $filelist
find ./%{_lib} -name "*.so*" >> $filelist
find .%{_bindir} -name dbus-launch.nox11 >> $filelist
cat $filelist | while read file; do
mkdir -p $(dirname %{buildroot}/$file)
cp -a $file %{buildroot}/$file
done
popd
rm -rf $tdir
for i in %{_sysconfdir}/dbus-1/session.d %{_sysconfdir}/dbus-1/system.d \
%{_datadir}/dbus-1/interfaces %{_datadir}/dbus-1/services %{_datadir}/dbus-1/system-services; do
mkdir -p %{buildroot}$i
done
%post -n %{_libname} -p /sbin/ldconfig
%postun -n %{_libname} -p /sbin/ldconfig
%post -n dbus-1-nox11
%{_sbindir}/update-alternatives --install %{_bindir}/dbus-launch dbus-launch %{_bindir}/dbus-launch.nox11 10
%preun -n dbus-1-nox11
%{_sbindir}/update-alternatives --remove dbus-launch %{_bindir}/dbus-launch.nox11
%files -n %{_libname}
%defattr(-, root, root)
/%{_lib}/libdbus-1.so.*
# Own those directories in the library instead of dbus-1, since dbus users
# often ship files there
%dir %{_sysconfdir}/dbus-1
%dir %{_sysconfdir}/dbus-1/session.d
%dir %{_sysconfdir}/dbus-1/system.d
%dir %{_datadir}/dbus-1
%dir %{_datadir}/dbus-1/interfaces
%dir %{_datadir}/dbus-1/services
%dir %{_datadir}/dbus-1/system-services
%files -n dbus-1-devel
%defattr(-,root,root)
%{_includedir}/*
%{_libdir}/libdbus-1.so
%dir %{_libdir}/dbus-1.0
%{_libdir}/dbus-1.0/include
%{_libdir}/pkgconfig/dbus-1.pc
%files -n dbus-1-nox11
%defattr(-,root,root)
%ghost %{_sysconfdir}/alternatives/dbus-launch
%{_bindir}/dbus-launch.nox11
%changelog