File e_dbus.spec of Package e_dbus

#
# spec file for package e_dbus
#
# 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 http://bugs.opensuse.org/
#


Name:           e_dbus
Version:        1.7.8
Release:        0
Summary:        Dbus wrapping and glue layer library
License:        BSD-2-Clause
Group:          System/Libraries
Url:            http://enlightenment.org/
Source:         %{name}-%{version}.tar.bz2
BuildRequires:  dbus-1-devel
BuildRequires:  doxygen
BuildRequires:  ecore-devel >= %{version}
BuildRequires:  eina-devel >= %{version}
BuildRequires:  libtool
BuildRequires:  pkgconfig
%if 0%{?suse_version}
BuildRequires:  fdupes
%endif
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

%description
E_Dbus is a set of wrappers around DBus APIs by third party, so they can be
easily used by EFL applications, automatically providing Ecore/main loop
integration, as well as Eina data types.

%package -n libedbus1
Summary:        E_Dbus Dynamic Library
Group:          System/Libraries

%description -n libedbus1
Main dynamic library of E_Dbus.

%package devel
Summary:        E_Dbus development package
Group:          Development/Libraries/C and C++
Requires:       %{name} = %{version}
Requires:       dbus-1-devel
Requires:       ecore-devel
Requires:       eina-devel
Requires:       libedbus1 = %{version}

%description devel
Development files for E_Dbus package.

%package doc-html
Summary:        HTML documentation of E_Dbus
Group:          Documentation/HTML

%description doc-html
Documentation of E_Dbus library in form of HTML pages.

%prep
%setup -q

%build
# fake time used for documentation
FAKE_DOCDATE=$(LC_ALL=C date -u -r %{_sourcedir}/%{name}.changes '+%%a %%b %%d %%Y')
FAKE_DOCYEAR=$(LC_ALL=C date -u -r %{_sourcedir}/%{name}.changes '+%%Y')
FAKE_DOCDATETIME=$(LC_ALL=C date -u -r %{_sourcedir}/%{name}.changes '+%%a %%b %%d %%Y %T')
sed -i "s/\$datetime/$FAKE_DOCDATETIME/g;s/\$date/$FAKE_DOCDATE/g;s/\$year/$FAKEDOCYEAR/g" doc/*.html

%configure --disable-static --disable-silent-rules
make %{?_smp_mflags}
make doc

%install
make install DESTDIR="%buildroot"

# copy documentation manually
echo "Copying HTML documentation"
mkdir -p %{buildroot}%{_docdir}/%{name}
/bin/cp -vr doc/html %{buildroot}%{_docdir}/%{name}
# fix permissions
find %{buildroot}%{_docdir} -type f | xargs chmod 0644
find %{buildroot}%{_docdir} -type d | xargs chmod 0755
# remove duplicates
%if 0%{?suse_version}
%fdupes -s %{buildroot}%{_docdir}
%endif

find %{buildroot}%{_libdir} -name '*.la' -exec rm -v {} \;
cp -v ChangeLog README COPYING %{buildroot}%{_docdir}/%{name}

%post -n libedbus1 -p /sbin/ldconfig

%postun -n libedbus1 -p /sbin/ldconfig

%files
%defattr(-,root,root)
%doc %{_docdir}/%{name}
%{_docdir}/%{name}
%exclude %{_docdir}/%{name}/html
%{_bindir}/e*
%{_datadir}/e_dbus/

%files -n libedbus1
%defattr(-, root, root)
%{_libdir}/libe*.so.*

%files devel
%defattr(-, root, root)
%{_includedir}/e_dbus-1/
%{_libdir}/pkgconfig/*.pc
%{_libdir}/libe*.so

%files doc-html
%defattr(-, root, root)
%doc %{_docdir}/%{name}/html

%changelog
openSUSE Build Service is sponsored by