File dbus-1-x11.spec of Package dbus-1

# spec file for package dbus-1-x11
# Copyright (c) 2013 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

Name:           dbus-1-x11
%define _name   dbus
BuildRequires:  pkgconfig(x11)
Summary:        D-Bus Message Bus System
License:        GPL-2.0+ or AFL-2.1
Group:          System/Daemons

%define with_systemd 1

%if ! %{with_systemd}
%if 0%{?suse_version} < 1230
%define _unitdir /lib/systemd/system
%define _unitdir /usr/lib/systemd/system

BuildRequires:  audit-devel
BuildRequires:  doxygen
BuildRequires:  libexpat-devel
BuildRequires:  libtool
BuildRequires:  pkg-config
BuildRequires:  update-desktop-files
%if %{with_systemd}
BuildRequires:  pkgconfig(libsystemd-daemon)
BuildRequires:  pkgconfig(libsystemd-login)
Version:        1.6.8
Release:        0
# bug437293
%ifarch ppc64
Obsoletes:      dbus-1-64bit
Source1:        rc.boot.dbus
Source2:        dbus-1.desktop
Source4:        baselibs.conf
Patch0:         dbus-log-deny.patch
# PATCH-FIX-OPENSUSE -- force a feature configure won't accept without x11 in buildrequires
Patch1:         dbus-do-autolaunch.patch
%if 0%{?suse_version} > 1100
%bcond_without selinux
%bcond_with selinux
%if %{with selinux}
BuildRequires:  libselinux-devel
BuildRequires:  libcap-ng-devel
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

D-Bus contains some tools that require Xlib to be installed, those are
in this separate package so server systems need not install X.

%setup -n %{_name}-%{version} -q
%patch0 -p1
%patch1 -p1

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
%configure \
    --disable-static 							\
    --with-pic 								\
    --bindir=/bin							\
    --libexecdir=/lib/%{name}					\
    --libdir=/%{_lib}							\
    --with-init-scripts=suse						\
    --enable-inotify							\
    --enable-doxygen-docs						\
%if %{with selinux}
    --enable-selinux							\
%if %{with_systemd}
    --enable-systemd							\
    --enable-libaudit							\
    --with-console-auth-dir=/var/run/dbus/at_console/			\
make %{?_smp_mflags}
doxygen -u && doxygen

tdir=$(mktemp -d)
make DESTDIR=$tdir install
mkdir -p %{buildroot}/%{_bindir}
mkdir -p %{buildroot}/%{_mandir}/man1
mv $tdir/bin/dbus-launch %{buildroot}/%{_bindir}
mv $tdir/%{_mandir}/man1/dbus-launch.1* %{buildroot}/%{_mandir}/man1
rm -rf $tdir


openSUSE Build Service is sponsored by