File ecore.spec of Package ecore

#
# spec file for package ecore
#
# 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/
#


%define has_ibus 0%{?sles_version} != 11 && 0%{?mandriva_version} != 201010 && 0%{?mandriva_version} != 201000 && 0%{?suse_version} != 1140 && 0%{?mandriva_version} != 201100 && 0%{?centos_version} != 600
%define has_scim 0%{?mandriva_version} != 201100 && 0%{?centos_version} != 600

Name:           ecore
Version:        1.7.5
Release:        0
Summary:        Core mainloop, display abstraction and utility library
License:        BSD-2-Clause
Group:          Development/Libraries/C and C++
Url:            http://enlightenment.org/
Source:         %{name}-%{version}.tar.bz2
# PATCH-FIX-UPSTREAM 0001-Fix-use-of-uninitialized-var-leak-.-Fix-1786.patch sleep_walker@suse.cz -- fix leak causing crash of terminology when pasting selection to rich text editor
Patch0:         0001-Fix-use-of-uninitialized-var-leak-.-Fix-1786.patch
BuildRequires:  SDL-devel
BuildRequires:  doxygen
BuildRequires:  eet-devel >= %version
BuildRequires:  eina-devel >= %version
BuildRequires:  evas-devel >= %version
BuildRequires:  freetype2-devel
BuildRequires:  gcc-c++
BuildRequires:  gettext-devel
BuildRequires:  glib2-devel
BuildRequires:  gnutls-devel
BuildRequires:  ibus-devel
BuildRequires:  libXtst-devel
BuildRequires:  libcurl-devel
BuildRequires:  libgcrypt-devel
BuildRequires:  libpixman-1-0-devel
BuildRequires:  libtool
BuildRequires:  openssl-devel
BuildRequires:  pkgconfig
BuildRequires:  scim-devel
BuildRequires:  tslib-devel
BuildRequires:  xorg-x11-devel
BuildRequires:  xorg-x11-libX11-devel
BuildRequires:  xorg-x11-libXdmcp-devel
BuildRequires:  xorg-x11-libXext-devel
BuildRequires:  xorg-x11-libxcb-devel
BuildRequires:  pkgconfig(printproto)
BuildRequires:  pkgconfig(xscrnsaver)
%if 0%{?suse_version}
BuildRequires:  fdupes
%endif
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

%description
Ecore is a clean and tiny event loop library with many modules to do lots of convenient things for a programmer, to save time and effort.

%package -n libecore1
Summary:        ECore Dynamic Libraries
Group:          System/Libraries
Requires:       %name

%description -n libecore1
Headers, static libraries, test programs and documentation for ecore

%package devel
Summary:        Ecore headers, static libraries, documentation and test programs
Group:          Development/Libraries/C and C++
Requires:       %name = %version
Requires:       eet-devel >= %version
Requires:       eina-devel >= %version
Requires:       evas-devel >= %version
Requires:       freetype2-devel
Requires:       glib2-devel
Requires:       libcurl-devel
Requires:       libecore1 = %{version}
Requires:       libpixman-1-0-devel
Requires:       tslib-devel
Requires:       xorg-x11-devel
Requires:       xorg-x11-libXdmcp-devel

%description devel
Headers, static libraries, test programs and documentation for ecore

%if %has_scim
%package scim
Summary:        SCIM support module for Ecore
Group:          Development/Libraries/C and C++

%description scim
Module bringing support for SCIM input method into Ecore.
%endif

%if %has_ibus
%package ibus
Summary:        IBUS support module for Ecore
Group:          Development/Libraries/C and C++

%description ibus
Module bringing support for IBUS input method into Ecore.
%endif

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

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

%package doc-man
Summary:        Man documentation of Eina
Group:          Documentation/Man

%description doc-man
Documentation of Eina library in form of man pages.

%package examples
Summary:        Examples of Ecore usage
Group:          Documentation/Other

%description examples
Set of default examples of using Ecore.

%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-silent-rules \
    --disable-static \
    \
    --enable-ecore-con \
    --enable-ipv6 \
    --enable-gnutls \
    --enable-curl \
    --enable-epoll \
    --enable-openssl \
    --enable-cares \
    --enable-ecore-ipc \
    --enable-ecore-file \
    --enable-inotify \
    --enable-ecore-imf \
    --enable-ecore-imf-evas \
    --enable-ecore-input \
    --enable-ecore-input-evas \
    --enable-ecore-imf-xim \
    --enable-ecore-imf-scim \
    --enable-ecore-imf-ibus \
    --enable-ecore-evas \
    --enable-ecore-evas-software-buffer \
    --enable-ecore-evas-fb \
    --enable-ecore-evas-opengl-glew \
    --enable-ecore-evas-opengl-sdl \
    --enable-ecore-evas-opengl-x11 \
    --enable-ecore-sdl \
    --enable-ecore-fb \
    --enable-ecore-x \
    --enable-ecore-x-composite \
    --enable-ecore-x-cursor \
    --enable-ecore-x-damage \
    --enable-ecore-x-dri \
    --enable-ecore-x-gesture \
    --enable-ecore-x-input \
    --enable-ecore-x-randr \
    --enable-ecore-x-render \
    --enable-ecore-x-screensaver \
    --enable-ecore-x-shape \
    --enable-ecore-x-sync \
    --enable-ecore-x-xfixes \
    --enable-ecore-x-xinerama \
    --enable-ecore-x-xtest \
    --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}
echo "Copying MAN pages"
/bin/cp -vr doc/man/ %{buildroot}%{_mandir}/
# fix line endings
find %{buildroot}%{_docdir} -name '*.eps' | xargs sed -i 's@\r@\n@g'
# 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}
%fdupes -s %{buildroot}%{_mandir}
%endif

find %{buildroot}%{_libdir} -name '*.la' -exec rm -v {} \;
%find_lang %{name}

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

%post -n libecore1 -p /sbin/ldconfig

%postun  -n libecore1 -p /sbin/ldconfig

%files -f %{name}.lang
%defattr(-, root, root)
%{_libdir}/ecore
%if %has_scim
%exclude %{_libdir}/ecore/immodules/scim.so
%endif
%if %has_ibus
%exclude %{_libdir}/ecore/immodules/ibus.so
%endif

%files -n libecore1
%defattr(-, root, root)
%{_libdir}/libecore*.so.1*

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

%if %has_scim
%files scim
%defattr(-, root, root)
%{_libdir}/ecore/immodules/scim.so
%endif

%if %has_ibus
%files ibus
%defattr(-, root, root)
%{_libdir}/ecore/immodules/ibus.so
%endif

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

%files doc-man
%defattr(-, root, root)
%{_mandir}/*/*

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

%changelog
openSUSE Build Service is sponsored by