File dbus-1.spec of Package dbus-1

#
# spec file for package dbus (Version 1.1.3)
#
# Copyright (c) 2007 SUSE LINUX Products GmbH, Nuernberg, Germany.
# This file and all modifications and additions to the pristine
# package are under the same license as the package itself.
#
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#

# norootforbuild

%define checkoutdate .20071022git

Name:           dbus-1
Url:            http://dbus.freedesktop.org/
License:        GPL v2 or later; Other uncritical OpenSource License
Group:          System/Daemons
Summary:        D-Bus Message Bus System
# COMMON1-BEGIN
BuildRequires:  doxygen libexpat-devel libzio pkgconfig
Version:        1.1.3
Release:        1.1%{?checkoutdate}
AutoReqProv:    on
Source0:        dbus-%{version}.tar.gz
Source1:        rc.boot.dbus
Source2:        dbus-1.desktop
Patch0:         dbus-do-not-abort-on-check-thoenig-01.patch
# https://bugs.freedesktop.org/show_bug.cgi?id=11491
Patch1:         dbus-lsb.patch
# https://bugs.freedesktop.org/show_bug.cgi?id=12429
Patch2:         dbus-audit-user.patch
# https://bugs.freedesktop.org/show_bug.cgi?id=12430
Patch3:         dbus-no-abort.patch
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
# COMMON1-END
PreReq:         permissions /usr/sbin/groupadd /usr/sbin/useradd /sbin/insserv /etc/init.d/boot.localfs

%package -n dbus-1-devel
Summary:        Developer package for D-Bus
Requires:       %{name} = %{version}
AutoReqProv:    on
Group:          Development/Libraries/Other

%package -n dbus-1-devel-doc
Summary:        Developer documentation package for D-Bus
Requires:       %{name} = %{version}
Group:          Development/Libraries/Other
AutoReqProv:    on

%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 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-devel-doc
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 dbus-%{version} -q
# Disable this until we hit RC phase
#%patch0
%patch1 -p1
#%patch2 -p1
%patch3 -p1

%build
autoreconf -fi
export CFLAGS="${RPM_OPT_FLAGS} -fno-strict-aliasing -fPIC"
export CXXFLAGS="${RPM_OPT_FLAGS} -fno-strict-aliasing"
%if 0%{?suse_version} > 1000
export CFLAGS="$CFLAGS -fstack-protector"
export CXXFLAGS="$CXXFLAGS -fstack-protector"
%endif
./configure								\
    --prefix=%{_prefix}							\
    --bindir=/bin							\
    --exec_prefix=%{_exec_prefix}					\
    --sysconfdir=%{_sysconfdir}						\
    --datadir=%{_datadir}						\
    --libdir=/usr/%{_lib}							\
    --localstatedir=%{_localstatedir}					\
    --mandir=%{_mandir}							\
    --with-init-scripts=suse						\
    --enable-dnotify							\
    --enable-doxygen-docs						\
    --with-console-auth-dir=/var/run/resmgr/classes/desktop/
make %{?jobs:-j %jobs}
doxygen -u && doxygen
./cleanup-man-pages.sh

%install
# COMMON2-END
make DESTDIR=%{buildroot} install
mkdir -p %{buildroot}/etc/init.d
mkdir -p %{buildroot}/usr/sbin
install -m 755 %{SOURCE1} %{buildroot}/%{_sysconfdir}/init.d/dbus
ln -sf %{_sysconfdir}/init.d/dbus %{buildroot}/%{_sbindir}/rcdbus
install -d %{buildroot}/%{_localstatedir}/run/dbus
mkdir -p %{buildroot}/%{_datadir}/susehelp/meta/Development/Libraries/
install -m 0644 %SOURCE2 \
    %{buildroot}/%{_datadir}/susehelp/meta/Development/Libraries/dbus-1.desktop
mkdir -p %{buildroot}/%{_libdir}/pkgconfig
mkdir -p %{buildroot}/%{_datadir}/dbus-1/interfaces
#sed -e 's@-I${libdir}@-I${prefix}/%{_lib}@' %{buildroot}/%{_lib}/pkgconfig/dbus-1.pc > %{buildroot}/%{_libdir}/pkgconfig/dbus-1.pc
#rm -f %{buildroot}/%{_lib}/pkgconfig/dbus-1.pc
mkdir -p %{buildroot}/%{_libdir}/dbus-1.0/include/
#mv -f %{buildroot}/%{_lib}/dbus-1.0/include/* %{buildroot}/%{_libdir}/dbus-1.0/include/
rm -f %{buildroot}/%{_libdir}/*.a
rm -f %{buildroot}/%{_libdir}/*.la
rm -f %{buildroot}/bin/dbus-launch
rm -f %{buildroot}/%{_mandir}/man1/dbus-launch.1*
chmod a-x AUTHORS COPYING HACKING NEWS README doc/*.txt doc/file-boilerplate.c doc/TODO

%clean
%{__rm} -rf %{buildroot}

%pre
/usr/sbin/groupadd -r messagebus 2> /dev/null || :
/usr/sbin/useradd -r -o -s /bin/false -c "User for D-Bus" -d /var/run/dbus -g messagebus messagebus 2> /dev/null || :
%if 0%{?suse_version:1}

%preun
%{stop_on_removal dbus}

%post
mkdir -p %{_localstatedir}/lib/dbus
%{insserv_force_if_yast dbus}
%{run_ldconfig}
%{run_permissions}
%verifyscript
%verify_permissions -e %{_libexecdir}/dbus-1/dbus-daemon-launch-helper

%postun
%{restart_on_update dbus}
%{insserv_cleanup}
%{run_ldconfig}
%endif

%post devel -p /sbin/ldconfig

%postun devel -p /sbin/ldconfig

%files
%defattr(-, root, root)
%dir %{_datadir}/dbus-1
%dir %{_datadir}/dbus-1/services
%dir %{_datadir}/dbus-1/interfaces
%doc AUTHORS COPYING HACKING NEWS README
%{_sysconfdir}/dbus-1
%{_sysconfdir}/init.d/dbus
/bin/dbus-cleanup-sockets
/bin/dbus-daemon
/bin/dbus-monitor
/bin/dbus-send
/bin/dbus-uuidgen
#/%{_lib}/dbus-1
%{_libdir}/*dbus-1.so.*
%{_mandir}/man1/dbus-cleanup-sockets.1.*
%{_mandir}/man1/dbus-daemon.1.*
%{_mandir}/man1/dbus-monitor.1.*
%{_mandir}/man1/dbus-send.1.*
%{_mandir}/man1/dbus-uuidgen.1.*
%{_sbindir}/rcdbus
%attr(-,messagebus,messagebus) %{_localstatedir}/run/dbus
# See doc/system-activation.txt in source tarball for the rationale
# behind these permissions
%verify(not mode) /usr/libexec/dbus-daemon-launch-helper
# from hughsie's bleeding edge fedora spec
%{_datadir}/dbus-1/system-services
/usr/libexec/dbus-daemon-launch-helper

%files -n dbus-1-devel
%defattr(-,root,root)
%{_includedir}/*
%{_libdir}/*dbus-1.so
%{_libdir}/dbus-1.0
%{_libdir}/dbus-1.0/include
%{_libdir}/pkgconfig/dbus-1.pc

%files -n dbus-1-devel-doc
%defattr(-,root,root)
%doc doc/api/html
%doc doc/*.txt doc/file-boilerplate.c doc/TODO
%{_datadir}/susehelp

%changelog
* Mon Oct 22 2007 jkress@suse.de
- Initial packaging for packagekit repo
openSUSE Build Service is sponsored by