File efl.spec of Package efl

#
# spec file for package efl
#
# Copyright (c) 2015 SUSE LINUX 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/
#


# build doc is disabled due to #897122 once the bug is resolved it can be re enabled
%define build_doc 0

# Build doc needs to be defined for build doc man to work
%define build_doc_man 0
%define egueb_present 0

%define harfbuzz_present (0%{?mandriva_version} != 201000 && 0%{?centos_version} != 600 && 0%{?sles_version} == 0)

%define pulse_present (0%{?mandriva_version} == 0 && 0%{?centos_version} == 0)

%define gstreamer_present (0%{?mandriva_version} == 0 && 0%{?sles_version} == 0)

%define gstreamer1_present (0%{?suse_version} >= 1230 || 0%{?fedora_version} >= 20)

%define xinput22_present (0%{?mandriva_version} == 0 && 0%{?centos_version} == 0)

# always require systemd for now
%define systemd_present (0%{?suse_version} != 1220)

# fedora SLEs 12 don't support xine
%define xine_present (0%{?suse_version} != 1315 && 0%{?fedora} == 0)

%define physics_present 1

%ifarch %ix86 x86_64 %arml ppc
%define luajit_present 1
%else
%define luajit_present 0
%endif

%define enable_wayland (0%{?suse_version} > 1320)

Name:           efl
Version:        1.15.2
Release:        0
# TODO: split package to separate packages and specify licenses correctly
Summary:        Enlightenment Foundation Libraries - libraries used by Enlightenment (e17 e19)
License:        BSD-2-Clause and LGPL-2.1 and Zlib
Group:          Development/Libraries/C and C++
Url:            http://enlightenment.org
Source:         %{name}-%{version}.tar.xz
Patch1:         efl-1.11.3-fix-bashisms.patch
BuildRequires:  autoconf >= 2.5
BuildRequires:  automake
%if %build_doc
BuildRequires:  doxygen
%endif
BuildRequires:  gcc-c++
BuildRequires:  gettext-devel
BuildRequires:  giflib-devel
BuildRequires:  glibc-devel
BuildRequires:  libjpeg-devel
BuildRequires:  libtool
BuildRequires:  pkgconfig
BuildRequires:  python >= 2.5
%ifarch %ix86 x86_64 ppc ppc64 ppc64le s390x armv7l armv7hl armv6l armv6hl aarch64
BuildRequires:  valgrind
%endif

BuildRequires:  pkgconfig(alsa)
%if %physics_present
BuildRequires:  pkgconfig(bullet) >= 2.80
%endif
BuildRequires:  pkgconfig(check)
BuildRequires:  pkgconfig(dbus-1)
BuildRequires:  pkgconfig(dri)
BuildRequires:  pkgconfig(egl)
BuildRequires:  pkgconfig(fontconfig)
BuildRequires:  pkgconfig(freetype2)
BuildRequires:  pkgconfig(fribidi)
BuildRequires:  pkgconfig(glesv2)
BuildRequires:  pkgconfig(glib-2.0)
BuildRequires:  pkgconfig(libcurl)
BuildRequires:  pkgconfig(libexif)
BuildRequires:  pkgconfig(libpng) >= 1.2.10
BuildRequires:  pkgconfig(librsvg-2.0)
BuildRequires:  pkgconfig(libtiff-4)
BuildRequires:  pkgconfig(libudev)
%if %enable_wayland
BuildRequires:  pkgconfig(gbm)
BuildRequires:  pkgconfig(libdrm) >= 2.4
BuildRequires:  pkgconfig(libinput)
BuildRequires:  pkgconfig(wayland-client) >= 1.8.0
BuildRequires:  pkgconfig(wayland-cursor) >= 1.8.0
BuildRequires:  pkgconfig(wayland-egl) >= 1.8.0
BuildRequires:  pkgconfig(xkbcommon) >= 0.3.0
%endif
%if %xine_present
BuildRequires:  pkgconfig(libxine)
%endif
%if %luajit_present
BuildRequires:  pkgconfig(luajit)
%else
%if 0%{suse_version} >= 1330
BuildRequires:  pkgconfig(lua-5.1)
%else
BuildRequires:  pkgconfig(lua) < 5.2
%endif
%endif
BuildRequires:  pkgconfig(openssl)
BuildRequires:  pkgconfig(pixman-1)
BuildRequires:  pkgconfig(sdl)
BuildRequires:  pkgconfig(sndfile)
BuildRequires:  pkgconfig(x11)
BuildRequires:  pkgconfig(xcomposite)
BuildRequires:  pkgconfig(xcursor)
BuildRequires:  pkgconfig(xdmcp)
BuildRequires:  pkgconfig(xext)
BuildRequires:  pkgconfig(xi)
BuildRequires:  pkgconfig(xinerama)
BuildRequires:  pkgconfig(xkbfile)
BuildRequires:  pkgconfig(xp)
BuildRequires:  pkgconfig(xproto)
BuildRequires:  pkgconfig(xrandr)
BuildRequires:  pkgconfig(xscrnsaver)
BuildRequires:  pkgconfig(xtst)
BuildRequires:  pkgconfig(zlib)

%if 0%{?mandriva_version} == 201000
BuildRequires:  glibc-static-devel
%endif
%if %{gstreamer_present}
%if %gstreamer1_present
BuildRequires:  pkgconfig(gstreamer-1.0)
BuildRequires:  pkgconfig(gstreamer-plugins-base-1.0)
%else 
BuildRequires:  pkgconfig(gstreamer-0.10)
BuildRequires:  pkgconfig(gstreamer-plugins-base-0.10)
%endif
%endif
%if 0%{?mandriva_version} != 201010 && 0%{?centos_version} != 600 && 0%{?sles_version} != 11
BuildRequires:  pkgconfig(mount)
%endif
%if %pulse_present
BuildRequires:  pkgconfig(libpulse)
%endif
# requires systemd 195 to work
%if %systemd_present
BuildRequires:  systemd
BuildRequires:  systemd-devel
%endif
%if 0%{?suse_version}
BuildRequires:  fdupes
%endif

Provides:       ecore = %{version}
Obsoletes:      ecore < %{version}
Provides:       edje-utils = %{version}
Obsoletes:      edje-utils < %{version}
Provides:       eet = %{version}
Obsoletes:      eet < %{version}
Provides:       eeze = %{version}
Obsoletes:      eeze < %{version}
Provides:       efreet = %{version}
Obsoletes:      efreet < %{version}
Provides:       eina = %{version}
Obsoletes:      eina < %{version}
Provides:       emotion = %{version}
Obsoletes:      emotion < %{version}
Provides:       ethumb = %{version}
Obsoletes:      ethumb < %{version}
Provides:       evas = %{version}
Obsoletes:      evas < %{version}

BuildRoot:      %{_tmppath}/%{name}-%{version}-build
%if %systemd_present
%{?systemd_requires}
%endif

%description
EFL is library collection providing various functionality used (not onyl) by Enlightenment 17 and 19, Terminology, Tizen mobile platform and much more.

%package devel
Summary:        Headers, pkgconfig files and other files for development with EFL
License:        BSD-2-Clause and LGPL-2.1 and Zlib
Group:          Development/Libraries/C and C++
Requires:       gettext-devel
Requires:       giflib-devel
Requires:       glibc-devel

%if %physics_present
Requires:       pkgconfig(bullet)
%endif
Requires:       pkgconfig(dbus-1)
Requires:       pkgconfig(dri)
Requires:       pkgconfig(egl)
Requires:       pkgconfig(fontconfig)
Requires:       pkgconfig(freetype2)
Requires:       pkgconfig(fribidi)
Requires:       pkgconfig(glesv2)
Requires:       pkgconfig(glib-2.0)
Requires:       pkgconfig(libcurl)
Requires:       pkgconfig(libexif)
Requires:       pkgconfig(libopenjpeg)
Requires:       pkgconfig(libpng) >= 1.2.10
Requires:       pkgconfig(librsvg-2.0)
Requires:       pkgconfig(libtiff-4)
Requires:       pkgconfig(libudev)
%if %enable_wayland
Requires:       pkgconfig(gbm)
Requires:       pkgconfig(libdrm) >= 2.4
Requires:       pkgconfig(libinput)
Requires:       pkgconfig(wayland-client) >= 1.8.0
Requires:       pkgconfig(wayland-cursor) >= 1.8.0
Requires:       pkgconfig(wayland-egl) >= 1.8.0
Requires:       pkgconfig(xkbcommon) >= 0.3.0
%endif
%if %xine_present
Requires:       pkgconfig(libxine)
%endif
%if %luajit_present
Requires:       pkgconfig(luajit)
%else
%if 0%{suse_version} >= 1330
Requires:       pkgconfig(lua-5.1)
%else
Requires:       pkgconfig(lua) < 5.2
%endif
%endif
Requires:       pkgconfig(openssl)
Requires:       pkgconfig(pixman-1)
Requires:       pkgconfig(sdl)
Requires:       pkgconfig(sndfile)
Requires:       pkgconfig(x11)
Requires:       pkgconfig(xcomposite)
Requires:       pkgconfig(xcursor)
Requires:       pkgconfig(xdmcp)
Requires:       pkgconfig(xext)
Requires:       pkgconfig(xi)
Requires:       pkgconfig(xinerama)
Requires:       pkgconfig(xp)
Requires:       pkgconfig(xproto)
Requires:       pkgconfig(xrandr)
Requires:       pkgconfig(xscrnsaver)
Requires:       pkgconfig(xtst)
Requires:       pkgconfig(zlib)

%if 0%{?mandriva_version} == 201000
Requires:       glibc-static-devel
%endif
%if %{egueb_present}
Requires:       egueb-devel
Requires:       ender-devel
%endif
%if %harfbuzz_present
Requires:       pkgconfig(harfbuzz)
%endif
%if %{gstreamer_present}
Requires:       pkgconfig(gstreamer-0.10)
Requires:       pkgconfig(gstreamer-plugins-base-0.10)
%if %gstreamer1_present
Requires:       pkgconfig(gstreamer-1.0)
Requires:       pkgconfig(gstreamer-plugins-base-1.0)
%endif
%endif
%if %pulse_present
Requires:       pkgconfig(libpulse)
%endif

Requires:       %{name} = %{version}
Requires:       libecore1 = %{version}
Requires:       libector1 = %{version}
Requires:       libedje1 = %{version}
Requires:       libeet1 = %{version}
Requires:       libeeze1 = %{version}
Requires:       libefreet1 = %{version}
Requires:       libefreet_mime1 = %{version}
Requires:       libefreet_trash1 = %{version}
Requires:       libeina1 = %{version}
Requires:       libeio1 = %{version}
Requires:       libeldbus1 = %{version}
Requires:       libelocation1 = %{version}
Requires:       libembryo1 = %{version}
Requires:       libemile1 = %{version}
Requires:       libemotion1 = %{version}
Requires:       libeo1 = %{version}
%if %physics_present
Requires:       libephysics1 = %{version}
%endif
Requires:       edje = %{version}
Requires:       embryo = %{version}
Requires:       libethumb1 = %{version}
Requires:       libethumb_client1 = %{version}
Requires:       libevas1 = %{version}
Provides:       ecore-devel = %{version}
Provides:       edbus-devel = %{version}
Provides:       edje-devel = %{version}
Provides:       eet-devel = %{version}
Provides:       eeze-devel = %{version}
Provides:       efreet-devel = %{version}
Provides:       eina-devel = %{version}
Provides:       eio-devel = %{version}
Provides:       embryo-devel = %{version}
Provides:       emotion-devel = %{version}
%if %physics_present
Provides:       ephysics-devel = %{version}
%endif
Provides:       eo-devel = %{version}
Provides:       ethumb-devel = %{version}
Provides:       evas-devel = %{version}
Obsoletes:      ecore-devel < %{version}
Obsoletes:      edbus-devel < %{version}
Obsoletes:      edje-devel < %{version}
Obsoletes:      eet-devel < %{version}
Obsoletes:      eeze-devel < %{version}
Obsoletes:      efreet-devel < %{version}
Obsoletes:      eina-devel < %{version}
Obsoletes:      eio-devel < %{version}
Obsoletes:      embryo-devel < %{version}
Obsoletes:      emotion-devel < %{version}
Obsoletes:      eo-devel < %{version}
%if %physics_present
Obsoletes:      ephysics-devel < %{version}
%endif
Obsoletes:      ethumb-devel < %{version}
Obsoletes:      evas-devel < %{version}

%description devel
Headers, pkgconfig files and other files needed for development with EFL.

%package -n libecore1
Summary:        Ecore, part of EFL
License:        BSD-2-Clause
Group:          Development/Libraries/C and C++

%description -n libecore1
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 libector1
Summary:        Ector, part of EFL
License:        LGPL-2.1
Group:          Development/Libraries/C and C++

%description -n libector1
Ector provides a new retained rendering library that is used by Evas to
provide
Evas_Object_VG. This is a new Evas_Object that provides a vector graphics
scene graph following the SVG specification. It will be considered a bug
if some
behaviour does not follow the SVG standard. Evas_Object_VG provides 3
kind of objects
for now: shape, as well as linear and radial gradients.

%package -n libedje1
Summary:        Edje, part of EFL
License:        BSD-2-Clause and GPL-2.0
Group:          System/Libraries

%description -n libedje1
Abstract GUI layout and animation object library. Part of Enlightenment Foundation Libraries.

%package -n libeldbus1
Summary:        ELDbus, part of EFL
License:        LGPL-2.1
Group:          System/Libraries

%description -n libeldbus1
ELDbus is a wrapper around libdbus for the Enlightenment Foundation Libraries

%package -n libeet1
Summary:        Eet, part of EFL
License:        BSD-2-Clause
Group:          Development/Libraries/C and C++

%description -n libeet1
Eet is a tiny library designed to write an arbitrary set of chunks of
data to a file and optionally compress each chunk (very much like a
zip file) and allow fast random-access reading of the file later
on. It does not do zip as a zip itself has more complexity than is
needed, and it was much simpler to implement this once here.

It also can encode and decode data structures in memory, as well as
image data for saving to eet files or sending across the network to
other machines, or just writing to arbitrary files on the system. All
data is encoded in a platform independent way and can be written and
read by any architecture.

%package -n libeeze1
Summary:        Eeze, part of EFL
License:        BSD-2-Clause
Group:          System/Libraries

%description -n libeeze1
Eeze is a library for manipulating devices through udev with a simple
and fast api. It interfaces directly with libudev, avoiding such
middleman daemons as udisks/upower or hal, to immediately gather
device information the instant it becomes known to the system.  This
can be used to determine such things as:
  * If a cdrom has a disk inserted
  * The temperature of a cpu core
  * The remaining power left in a battery
  * The current power consumption of various parts
  * Monitor in realtime the status of peripheral devices

Each of the above examples can be performed by using only a single
eeze function, as one of the primary focuses of the library is to
reduce the complexity of managing devices.

%package -n libefl1
Summary:        Efreet, part of EFL
License:        LGPL-2.1
Group:          System/Libraries

%description -n libefl1
The foundation components for the enlightenment foundation libraries.

%package -n libefreet1
Summary:        Efreet, part of EFL
License:        BSD-2-Clause
Group:          System/Libraries

%description -n libefreet1
Standards handling for FreeDesktop.org standards.

%package -n libefreet_mime1
Summary:        Efreet, part of EFL
License:        BSD-2-Clause
Group:          System/Libraries
Conflicts:      libefreet1 < 1.8

%description -n libefreet_mime1
Standards handling for FreeDesktop.org mime types.

%package -n libefreet_trash1
Summary:        Efreet, part of EFL
License:        BSD-2-Clause
Group:          System/Libraries
Conflicts:      libefreet1 < 1.8

%description -n libefreet_trash1
Standards handling for FreeDesktop.org trash.

%package -n libeina1
Summary:        Eina, part of EFL
License:        LGPL-2.1
Group:          Development/Libraries/C and C++

%description -n libeina1
Eina is library handling various data types.

%package -n libeio1
Summary:        Eio, part of EFL
License:        LGPL-2.1
Group:          Development/Libraries/C and C++

%description -n libeio1
Extension of ecore for parallel I/O operations. Part of Enlightenment Foundation Libraries.

%package -n libelocation1
Summary:        ELocation, part of EFL
License:        LGPL-2.1
Group:          Development/Libraries/C and C++

%description -n libelocation1
A location library. Part of Enlightenment Foundation Libraries.

%package -n libelua1
Summary:        Lua bindings for the EFL
License:        LGPL-2.1
Group:          Development/Libraries/C and C++

%description -n libelua1
Support for lua within the efl

%package -n libembryo1
Summary:        Embryo, part of EFL
License:        BSD-2-Clause and Zlib
Group:          Development/Libraries/C and C++

%description -n libembryo1
Embryo is a tiny library designed to interpret limited small programs compiled
by the included compiler, embryo_cc. It is mostly a cleaned up and smaller
version of the original Small abstract machine. The compiler is mostly
untouched.

%package -n libemotion1
Summary:        Emotion, part of EFL
License:        BSD-2-Clause
Group:          Development/Libraries/C and C++

%description -n libemotion1
Emotion is a wrapper that provides a uniform api to a number of different media libraries
Currently the supported backends for this 

%package -n libemile1
Summary:        Emile, part of EFL compression and ciphering libs for the efl
License:        LGPL-2.1
Group:          Development/Libraries/C and C++

%description -n libemile1

Emile provides a library to bring together serialization, compression
and ciphering.
It is a low-level library and can be used by anything above Eina. It
came along with a
lot re-factoring of our current code base to make use of it and
de-duplicate a lot of
existing code. More refactoring is expected in ecore_con_ssl ciphering
and general
image compression.

%package -n libeo1
Summary:        Eo, part of EFL
License:        LGPL-2.1
Group:          Development/Libraries/C and C++

%description -n libeo1
Eo is library providing basic E object in OOP way of programming.

%package -n libeolian1
Summary:        Eolian, part of EFL
License:        LGPL-2.1
Group:          Development/Libraries/C and C++

%description -n libeolian1
Eolian is library for binding/code generation based on Eo descriptions.

%package -n libethumb1
Summary:        EThumb, part of EFL
License:        LGPL-2.1
Group:          Development/Libraries/C and C++

%description -n libethumb1
Thumbnail generation library for EFL

%if %physics_present
%package -n libephysics1
Summary:        EPhysics, part of EFL
License:        LGPL-2.1
Group:          Development/Libraries/C and C++

%description -n libephysics1
EPhysics is a wrapper around bullet physics for the enlightenment foundation libraries
%endif

%package -n libevas1
Summary:        Evas, part of EFL
License:        BSD-2-Clause
Group:          Development/Libraries/C and C++

%description -n libevas1
Evas is a clean display canvas API that implements a scene graph, not an
immediate-mode rendering target, is cross-platform, for several target display
systems that can draw anti-aliased text, smooth super and sub-sampled scaled
images, alpha-blend objects and much more.

%package -n libethumb_client1
Summary:        EThumb Client, part of EFL
License:        LGPL-2.1
Group:          System/Libraries

%description -n libethumb_client1
Shared library of ethumb client

%package -n edje
Summary:        Abstract GUI layout and animation object library
License:        BSD-2-Clause
Group:          Development/Libraries/C and C++
Requires:       efl = %{version}
Requires:       embryo = %{version}
Requires:       libedje1 = %{version}

%description -n edje
Abstract GUI layout and animation object library. Part of Enlightenment Foundation Libraries.

%package -n elua
Summary:        LuaJIT bindings for the efl
License:        LGPL-2.1
Group:          Development/Libraries
Requires:       efl = %{version}

%description -n elua
A set of efl bindings for the LuaJIT environment

%package -n embryo
Summary:        Abstract GUI layout and animation object library
License:        BSD-2-Clause
Group:          Development/Libraries/C and C++
Requires:       libembryo1 = %{version}

%description -n embryo
Embryo is a tiny library designed to interpret limited small programs compiled
by the included compiler, embryo_cc. It is mostly a cleaned up and smaller
version of the original Small abstract machine. The compiler is mostly
untouched.

%if %{build_doc}
%if %{build_doc_man}
%package doc-man
Summary:        EFL reference man pages
License:        BSD-2-Clause
Group:          Documentation/Man

%description doc-man
Documentation in form of man pages describing EFL API.
%endif #build_doc_man

%package doc-html
Summary:        EFL reference man pages
License:        BSD-2-Clause
Group:          Documentation/HTML

%description doc-html
Documentation in form of HTML pages describing EFL API.
%endif #build_doc

%package examples
Summary:        Examples of EFL usage
License:        BSD-2-Clause and LGPL-2.1 and Zlib
Group:          Documentation/Man

%description examples
Examples usage of the EFL library.

%package testsuite
Summary:        EFL testsuite
License:        BSD-2-Clause and LGPL-2.1 and Zlib
Group:          Development/Libraries/C and C++
Requires:       libefreet1 = %{version}

%description testsuite
Testsuite of EFL package.

%prep
%setup -q
%patch1 -p1

%build
# fedora has the wrong autoconf version
%if 0%{?fedora_version}
autoreconf -ivf
%endif

# remove __DATE__ and __TIME__
FAKE_BUILDTIME=$(LC_ALL=C date -u -r %{_sourcedir}/%{name}.changes '+%%H:%%M')
FAKE_BUILDDATE=$(LC_ALL=C date -u -r %{_sourcedir}/%{name}.changes '+%%b %%e %%Y')
FAKE_DOCDATE=$(LC_ALL=C date -u -r %{_sourcedir}/%{name}.changes '+%%a %%b %%d %%Y')
sed -i "s/__TIME__/\"$FAKE_BUILDTIME\"/g;s/__DATE__/\"$FAKE_BUILDDATE\"/g" \
    src/lib/eina/eina_hamster.c

# it seems that fedora libxcb-devel package doesn't contain xcb-xprint.pc
%if 0%{?fedora_version}
sed -i 's/xcb-xprint//g' configure.ac configure
%endif

ARGS=""

# old gcc without intristic
%if 0%{?sles_version} == 11
# SLE is reduced, doesn't have FriBiDi, GStreamer, etc.
ARGS="$ARGS --disable-cpu-sse3 --disable-fribidi --disable-gstreamer --disable-xinput2 --without-eeze"
%endif

# build esvg only if egueb can be built
%if %{egueb_present}
ARGS="$ARGS --enable-image-loader-svg"
%endif

# efl intentionally compares string pointers in alot of places rather then strings this stops obs complaining
export CFLAGS="%optflags -Wno-address";

%configure \
    --disable-static \
    --disable-silent-rules \
    --disable-tslib \
%if ! %pulse_present
    --disable-pulseaudio \
%endif
%if ! %physics_present
    --disable-physics \
    --enable-i-really-know-what-i-am-doing-and-that-this-will-probably-break-things-and-i-will-fix-them-myself-and-send-patches-aba \
%endif
%if !%gstreamer1_present
    --disable-gstreamer1 \
    --enable-gstreamer \
    --enable-i-really-know-what-i-am-doing-and-that-this-will-probably-break-things-and-i-will-fix-them-myself-and-send-patches-aba \
%endif
    --disable-harfbuzz \
%if !%luajit_present
    --enable-lua-old \
%if %physics_present
    --enable-i-really-know-what-i-am-doing-and-that-this-will-probably-break-things-and-i-will-fix-them-myself-and-send-patches-aba \
%endif
%endif
%if %xinput22_present
    --enable-xinput22 \
%endif
%if 0%{?mandriva_version} == 201000
    --disable-xinput2 \
%endif
%if 0%{?mandriva_version}
    --disable-gstreamer \
%endif
%if %xine_present
    --enable-xine \
%endif
%if %systemd_present
    --enable-systemd \
%endif
    --enable-fb \
%if %{build_doc}
    --enable-doc \
%else
    --disable-doc \
%endif
%if %enable_wayland
    --enable-wayland \
    --enable-drm \
    --enable-drm-gl \
%endif
    $ARGS

make %{?_smp_mflags}
%if %{build_doc}
make doc
%endif 

%install
make install DESTDIR="%buildroot"
# SL: TODO
echo "Copying examples"
install -m 0755 -d "%{buildroot}/%{_datadir}/%{name}/examples"
cp -rv src/examples/* "%{buildroot}/%{_datadir}/%{name}/examples"
%if 0%{?suse_version}
%fdupes -s "%{buildroot}/%{_datadir}/%{name}/examples"
%endif
# delete binary with suid bit set :D
rm -f "%buildroot/%_bindir/eeze_scanner"

%if !%luajit_present
rm -f "%buildroot/%{_datadir}/elua/checkme"
%endif

%if %{build_doc}
%if %{build_doc_man}
# copy documentation manually
echo "Copying MAN pages"
/bin/cp -vr doc/man %{buildroot}%{_datadir}/
%endif #build_doc_man
# fix line endings
find doc/html -name '*.eps' | xargs sed -i 's@\r@\n@g'
# remove duplicates
%if 0%{?suse_version}
%fdupes -s doc/html
%if %{build_doc_man}
%fdupes -s %{buildroot}%{_datadir}/man/
%endif #build_doc_man
%endif #build_doc
%fdupes %{buildroot}%{_includedir}
%endif

# fix permissions
find \
%if %{build_doc_man}
     %{buildroot}%{_datadir}/man \
     doc \
%endif
     %{buildroot}%{_datadir}/%{name}/examples \
     -type d -exec chmod 0755 {} \;
find \
%if %{build_doc_man}
     %{buildroot}%{_datadir}/man \
     doc \
%endif
     %{buildroot}%{_datadir}/%{name}/examples \
    -type f -exec chmod 0644 {} \;

# python gdb pretty printers shouldn't have execute permissions.
chmod 0644 %{buildroot}%{_datadir}/eo/gdb/eo_gdb.py

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

%if %systemd_present && ! 0%{?fedora_version}
%pre
%service_add_pre efreet.service ethumb.service

%post
%service_add_post efreet.service ethumb.service

%preun
%service_del_preun efreet.service ethumb.service

%postun
%service_del_postun efreet.service ethumb.service
%endif

%post -n libecore1 -p /sbin/ldconfig
%postun -n libecore1 -p /sbin/ldconfig

%post -n libector1 -p /sbin/ldconfig
%postun -n libector1 -p /sbin/ldconfig

%post -n libedje1 -p /sbin/ldconfig
%postun -n libedje1 -p /sbin/ldconfig

%post -n libeldbus1 -p /sbin/ldconfig
%postun -n libeldbus1 -p /sbin/ldconfig

%post -n libeet1 -p /sbin/ldconfig
%postun -n libeet1 -p /sbin/ldconfig

%post -n libeeze1 -p /sbin/ldconfig
%postun -n libeeze1 -p /sbin/ldconfig

%post -n libefl1 -p /sbin/ldconfig
%postun -n libefl1 -p /sbin/ldconfig

%post -n libefreet1 -p /sbin/ldconfig
%postun -n libefreet1 -p /sbin/ldconfig

%post -n libeina1 -p /sbin/ldconfig
%postun -n libeina1 -p /sbin/ldconfig

%post -n libeio1 -p /sbin/ldconfig
%postun -n libeio1 -p /sbin/ldconfig

%post -n libelocation1 -p /sbin/ldconfig
%postun -n libelocation1 -p /sbin/ldconfig

%post -n libelua1 -p /sbin/ldconfig
%postun -n libelua1 -p /sbin/ldconfig

%post -n libembryo1 -p /sbin/ldconfig
%postun -n libembryo1 -p /sbin/ldconfig

%post -n libemile1 -p /sbin/ldconfig
%postun -n libemile1 -p /sbin/ldconfig

%post -n libemotion1 -p /sbin/ldconfig
%postun -n libemotion1 -p /sbin/ldconfig

%post -n libeo1 -p /sbin/ldconfig
%postun -n libeo1 -p /sbin/ldconfig

%post -n libeolian1 -p /sbin/ldconfig
%postun -n libeolian1 -p /sbin/ldconfig

%if %physics_present
%post -n libephysics1 -p /sbin/ldconfig
%postun -n libephysics1 -p /sbin/ldconfig
%endif

%post -n libethumb1 -p /sbin/ldconfig
%postun -n libethumb1 -p /sbin/ldconfig

%post -n libethumb_client1 -p /sbin/ldconfig
%postun -n libethumb_client1 -p /sbin/ldconfig

%post -n libevas1 -p /sbin/ldconfig
%postun -n libevas1 -p /sbin/ldconfig

%post -n libefreet_trash1 -p /sbin/ldconfig
%postun -n libefreet_trash1 -p /sbin/ldconfig

%post -n libefreet_mime1 -p /sbin/ldconfig
%postun -n libefreet_mime1 -p /sbin/ldconfig

%files -f efl.lang
%defattr(-, root, root)
%{_bindir}/*
%exclude %{_bindir}/edje_*
%exclude %{_bindir}/embryo_*
%exclude %{_datadir}/ecore_x/checkme
%exclude %{_datadir}/evas/checkme
%doc README COPYING AUTHORS
%{_libdir}/ecore_evas
%{_libdir}/ecore_imf
%{_libdir}/ecore
%{_libdir}/ecore_x
%{_libdir}/eeze
%{_libdir}/efreet
%{_libdir}/emotion
%{_libdir}/ethumb
%{_libdir}/ethumb_client
%{_libdir}/evas
%{_datadir}/dbus-1
%{_datadir}/ecore
%{_datadir}/ecore_x
%{_datadir}/emotion
%{_datadir}/eo
%{_datadir}/ethumb
%{_datadir}/evas
%if %systemd_present
%{_prefix}/lib/systemd/user/*.service
%endif

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

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

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

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

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

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

%if %luajit_present
%files -n libelua1
%defattr(-, root, root)
%{_libdir}/libelua.so.*
%endif

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

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

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

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

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

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

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

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

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

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

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

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

%if %physics_present
%files -n libephysics1
%defattr(-,root,root)
%{_libdir}/libephysics.so.*
%endif

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

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

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

%files devel
%defattr(-, root, root)
%{_libdir}/pkgconfig/*
%{_libdir}/lib*.so
%{_libdir}/cmake/
%{_includedir}/efl-1/
%{_includedir}/efl-cxx-1/
%{_includedir}/ecore-1/
%{_includedir}/ecore-audio-1/
%{_includedir}/ecore-avahi-1/
%{_includedir}/ecore-con-1/
%{_includedir}/ecore-evas-1/
%{_includedir}/ecore-fb-1/
%{_includedir}/ecore-file-1/
%{_includedir}/ecore-imf-1/
%{_includedir}/ecore-imf-evas-1/
%{_includedir}/ecore-input-1/
%{_includedir}/ecore-input-evas-1/
%{_includedir}/ecore-ipc-1/
%{_includedir}/ecore-x-1/
%if %enable_wayland
%{_includedir}/ecore-wayland-1/
%{_includedir}/ecore-drm-1/
%endif
%{_includedir}/ector-1/
%{_includedir}/eldbus-1/
%{_includedir}/elocation-1/
%if %luajit_present
%{_includedir}/elua-1/
%endif
%{_includedir}/edje-1/
%{_includedir}/eet-1/
%{_includedir}/eeze-1/
%{_includedir}/efreet-1/
%{_includedir}/eina-1/
%{_includedir}/eio-1/
%{_includedir}/embryo-1/
%{_includedir}/emile-1/
%{_includedir}/emotion-1/
%{_includedir}/eo-1/
%{_includedir}/eolian-1/
# C++ headers
%{_includedir}/ecore-cxx-1
%{_includedir}/ecore-audio-cxx-1/
%{_includedir}/edje-cxx-1
%{_includedir}/eet-cxx-1
%{_includedir}/eina-cxx-1
%{_includedir}/eio-cxx-1
%{_includedir}/eldbus_cxx-1
%{_includedir}/eo-cxx-1
%{_includedir}/eolian-cxx-1
%{_includedir}/evas-cxx-1

%if %physics_present
%{_includedir}/ephysics-1/
%endif
%{_includedir}/ethumb-1/
%{_includedir}/ethumb-client-1/
%{_includedir}/evas-1/
%{_datadir}/eolian/
%{_datadir}/ecore_x/checkme
%{_datadir}/evas/checkme
%{_datadir}/gdb/

%files -n edje
%defattr(-, root, root)
%{_bindir}/edje_*
%{_datadir}/edje
%{_libdir}/edje
%{_datadir}/mime/packages/edje.xml

%if %luajit_present
%files -n elua
%defattr(-, root, root)
%{_datadir}/elua
%endif

%files -n embryo
%defattr(-, root, root)
%{_bindir}/embryo_*
%{_datadir}/embryo

%if %{build_doc}
%if %{build_doc_man}
%files doc-man
%defattr(-, root, root)
%{_datadir}/man/*/*
%endif #build_doc_man

%files doc-html
%defattr(-, root, root)
%doc doc/html/*

%endif #build_doc

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

%files testsuite
%defattr(-, root, root)
%{_datadir}/ecore_imf/
%{_datadir}/eeze/
%{_datadir}/efreet/
%{_datadir}/ethumb_client/

%changelog
openSUSE Build Service is sponsored by