dbus-1/dbus-1.spec

206 lines
6.3 KiB
RPMSpec

#
# spec file for package dbus-1
#
# Copyright (c) 2014 SUSE LINUX Products 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 0
%bcond_with docs
Name: dbus-1
%define _name dbus
%define _libname libdbus-1-3
Url: http://dbus.freedesktop.org/
Summary: D-Bus Message Bus System
License: GPL-2.0+ or AFL-2.1
Group: System/Daemons
# COMMON1-BEGIN
%if ! %{with_systemd}
%if 0%{?suse_version} < 1230
%define _unitdir /lib/systemd/system
%else
%define _unitdir /usr/lib/systemd/system
%endif
%endif
%if %{with_systemd}
BuildRequires: pkgconfig(libsystemd-daemon)
BuildRequires: pkgconfig(libsystemd-login)
%endif
BuildRequires: libexpat-devel
BuildRequires: libtool
BuildRequires: pkg-config
Version: 1.7.10
Release: 0
#
Source0: http://dbus.freedesktop.org/releases/dbus/%{_name}-%{version}.tar.gz
Source1: rc.boot.dbus
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
%bcond_without selinux
%if %{with selinux}
BuildRequires: libselinux-devel
%endif
BuildRequires: libcap-ng-devel
BuildRoot: %{_tmppath}/%{name}-%{version}-build
# 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
%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).
%prep
# COMMON2-BEGIN
%setup -n %{_name}-%{version} -q
%patch0 -p1
%patch1 -p1
%build
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="${RPM_OPT_FLAGS} -fno-strict-aliasing -fPIC -fpie"
export LDFLAGS="-pie"
export CXXFLAGS="${RPM_OPT_FLAGS} -fno-strict-aliasing"
%if 0%{?suse_version} > 1000
export CFLAGS="$CFLAGS -fstack-protector"
export CXXFLAGS="$CXXFLAGS -fstack-protector"
export V=1
%endif
%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
%if %{with_systemd}
--enable-systemd \
%endif
--enable-libaudit \
--with-console-auth-dir=/run/dbus/at_console/ \
--with-system-pid-file=/run/dbus/pid \
--with-system-socket=/run/dbus/system_bus_socket \
--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
# 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
cat $filelist | while read file; do
mkdir -p $(dirname %{buildroot}/$file)
cp -a $file %{buildroot}/$file
done
popd
rm -rf $tdir
for i in /etc/dbus-1/session.d /etc/dbus-1/system.d \
/usr/share/dbus-1/interfaces /usr/share/dbus-1/services /usr/share/dbus-1/system-services; do
mkdir -p %{buildroot}$i
done
%post -n %{_libname} -p /sbin/ldconfig
%postun -n %{_libname} -p /sbin/ldconfig
%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
%changelog