File gifup.spec of Package gifup

#
# spec file for package gifup
#
# Copyright (c) 2018 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:           gifup
Version:        0.0.21
Release:        0
Summary:        Create GIFs from Videos quickly
License:        GPL-3.0-or-later
Group:          Productivity/Graphics/Other
URL:            https://github.com/BharatKalluri
Source:         https://github.com/BharatKalluri/Gifup/archive/%{version}.tar.gz#/Gifup-%{version}.tar.gz
BuildRequires:  gettext-runtime >= 0.19.7
BuildRequires:  elementary-cmake-modules
BuildRequires:  fdupes
BuildRequires:  hicolor-icon-theme
BuildRequires:  meson
BuildRequires:  pkgconfig
BuildRequires:  update-desktop-files
BuildRequires:  vala
BuildRequires:  pkgconfig(granite)
BuildRequires:  pkgconfig(gtk+-3.0)
Requires:       ffmpeg
Recommends:     %{name}-lang

%description
Gifup is a simple and effective way to create GIFs from video files.

%lang_package

%prep
%setup -q -n Gifup-%{version}

%build
%meson
%meson_build

%install
%meson_install
%suse_update_desktop_file -r com.github.bharatkalluri.gifup GTK Utilities DesktopUtility
%find_lang com.github.bharatkalluri.gifup %{name}.lang
%fdupes %{buildroot}%{_datadir}

# dirlist HiDPI icons (see: hicolor/index.theme)
_dirlist=$PWD/dir.lst
pushd %{buildroot}
find ./ | while read _list; do
    echo $_list | grep '[0-9]\@[0-9]' || continue
    _path=$(echo $_list | sed 's/[^/]//')
    if ! ls ${_path%/*} 2> /dev/null; then
        grep -xqs "\%dir\ ${_path%/*}" $_dirlist || echo "%dir ${_path%/*}" >> $_dirlist
    fi
done
popd

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

%postun
%desktop_database_postun
%icon_theme_cache_postun
%endif

%files -f dir.lst
%license LICENSE.md
%doc README.md
%{_bindir}/com.github.bharatkalluri.gifup
%{_datadir}/applications/com.github.bharatkalluri.gifup.desktop
%{_datadir}/icons/hicolor/*/apps/com.github.bharatkalluri.gifup.??g
%{_datadir}/metainfo/com.github.bharatkalluri.gifup.appdata.xml

%files lang -f %{name}.lang

%changelog
openSUSE Build Service is sponsored by