File emotion.spec of Package emotion

#
# spec file for package emotion
#
# 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:           emotion
Version:        1.7.8
Release:        0
Summary:        Media Library for EFL
License:        BSD-2-Clause
Group:          Development/Libraries/C and C++
Url:            http://enlightenment.org/
Source:         %{name}-%{version}.tar.bz2
BuildRequires:  doxygen
%if 0%{?suse_version}
BuildRequires:  fdupes
%endif
BuildRequires:  edje-devel >= %{version}
BuildRequires:  eet-devel >= %{version}
BuildRequires:  eio-devel >= %{version}
BuildRequires:  evas-devel >= %{version}
BuildRequires:  gstreamer-0_10-plugins-base-devel
BuildRequires:  gstreamer-devel
BuildRequires:  libtool
BuildRequires:  libxine-devel
BuildRequires:  pkgconfig
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
Requires:       %{name}-module = %{version}

%description
Emotion is Media Library.

%package -n libemotion1
Summary:        Emotion shared library
Group:          Development/Libraries/C and C++
Requires:       %{name}-module

%description -n libemotion1
Contains shared library of Emotion Media Library package

%package devel
Summary:        Emotion development files
Group:          Development/Libraries/C and C++
Requires:       %{name} = %{version}
Requires:       edje-devel >= %{version}
Requires:       eet-devel >= %{version}
Requires:       eio-devel >= %{version}
Requires:       evas-devel >= %{version}
Requires:       gstreamer-devel
Requires:       libemotion1 = %{version}
Requires:       libxine-devel

%description devel
Development files for emotion package.

%package module
Summary:        Emotion Edje module
Group:          Development/Libraries/C and C++

%description module
Emotion module for integration multimedia into Edje.

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

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

%package examples
Summary:        Examples of Emotion usage
Group:          Documentation/Man

%description examples
Source code examples of Emotion library usage.

%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 --enable-install-examples
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 line endings
find %{buildroot}%{_docdir} -name '*.eps' | xargs sed -i 's@\r@\n@g'
# remove duplicates
%if 0%{?suse_version}
%fdupes -s %{buildroot}%{_docdir}
%endif
cp -v ChangeLog README COPYING* %{buildroot}%{_docdir}/%{name}/
find %{buildroot}%{_libdir} -name '*.la' -exec rm -vf {} \;

%clean
%{?buildroot:rm -rf %{buildroot}}

%post -n libemotion1 -p /sbin/ldconfig

%postun -n libemotion1 -p /sbin/ldconfig

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

%files devel
%defattr(-,root,root)
%{_libdir}/libemotion.so
%{_libdir}/pkgconfig/%{name}.pc
%{_includedir}/*

%files
%defattr(-,root,root)
%doc %{_docdir}/%{name}
%exclude %{_docdir}/%{name}/html
%dir %{_libdir}/%{name}
%{_bindir}/%{name}_*
%{_datadir}/%{name}
%exclude %{_datadir}/%{name}/examples

%files module
%defattr(-, root, root)
%{_libdir}/edje
%{_libdir}/%{name}/*.so

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

%files examples
%defattr(-, root, root)
%{_datadir}/%{name}/examples

%changelog
openSUSE Build Service is sponsored by