File ephoto.spec of Package ephoto

#
# spec file for package ephoto
#
# Copyright (c) 2017 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/
#


Name:           ephoto
Version:        @SERVICE@
Release:        0
Summary:        EFL image viewer/editor/manipulator/slideshow creator
License:        BSD-2-Clause
Group:          Productivity/Graphics/Viewers
Url:            http://enlightenment.org
Source:         %{name}-%{version}.tar.xz
BuildRequires:  ImageMagick
BuildRequires:  meson >= 0.40.0
BuildRequires:  hicolor-icon-theme
BuildRequires:  pkgconfig
BuildRequires:  pkgconfig(ecore) >= 1.20.0
BuildRequires:  pkgconfig(ecore-evas)
BuildRequires:  pkgconfig(ecore-file)
BuildRequires:  pkgconfig(ecore-imf)
BuildRequires:  pkgconfig(ecore-imf-evas)
BuildRequires:  pkgconfig(ecore-input)
BuildRequires:  pkgconfig(ecore-ipc)
BuildRequires:  pkgconfig(edje)
BuildRequires:  pkgconfig(eet)
BuildRequires:  pkgconfig(efreet)
BuildRequires:  pkgconfig(eina)
BuildRequires:  pkgconfig(elementary) >= 1.13.0
BuildRequires:  pkgconfig(emotion) >= 1.13.0
BuildRequires:  pkgconfig(enlightenment)
BuildRequires:  pkgconfig(ethumb_client)
BuildRequires:  pkgconfig(evas)
Requires:       efl
Requires:       elementary >= 1.13.0
Requires:       evas-generic-loaders >= 1.13.0
Recommends:     %{name}-lang = %{version}
%if 0%{?suse_version}
BuildRequires:  fdupes
BuildRequires:  update-desktop-files
%endif

%description
Ephoto is an image viewer and editor.

Images can be viewed one at a time, in thumbnail groups, or as a slideshow.
In terms of editing, images can be rotated/mirrored, cropped, colors be
adjusted and artistic filters be applied.

%lang_package

%prep
%setup -q

%build
export CFLAGS="%{optflags} -g"
%{meson}
%{meson_build}

%install
%{meson_install}

_file=$(find -name %{name}.png)
_width=$(identify -format %w ${_file%\./*})
_height=$(identify -format %h ${_file%\./*})
if [ "$_width" -eq $_height ]; then
  ls %{_datadir}/icons/hicolor | grep '[0-9]x[0-9]' | sort -n | while read _size; do
    if [ "$_width" -ge ${_size%x*} ]; then
      mkdir -p %{buildroot}%{_datadir}/icons/hicolor/${_size}/apps
      convert -strip \
        ${_file%\./*} -resize $_size \
        %{buildroot}%{_datadir}/icons/hicolor/${_size}/apps/${_file##*/}
    fi
  done
else
  install -Dm0644 $_file %{buildroot}%{_datadir}/pixmaps/${_file##*/}
fi
rm %{buildroot}%{_datadir}/icons/%{name}.png

%if 0%{?suse_version}
%fdupes %{buildroot}/%{_datadir}
%suse_update_desktop_file -r %{name} Enlightenment Graphics Viewer
%endif
%find_lang %{name}

%if 0%{?suse_version} < 1320
%post
%icon_theme_cache_post
%desktop_database_post

%postun
%icon_theme_cache_postun
%desktop_database_postun
%endif

%{?suse_version:%files}
%{!?suse_version:%files -f %{name}.lang}
%doc AUTHORS COPYING* README
%{_bindir}/%{name}
%{_libdir}/%{name}/
%{_datadir}/%{name}/
%{_datadir}/applications/%{name}.desktop
%{_datadir}/icons/hicolor/*/apps/%{name}.??g
%dir %{_libdir}/enlightenment
%{_libdir}/enlightenment/gadgets/

%{?suse_version:%files lang -f %{name}.lang}

%changelog
openSUSE Build Service is sponsored by