File epack.spec of Package epack

#
# spec file for package epack
#
# 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:           epack
Version:        0.5.1
Release:        0
Summary:        Small Archive Manager
License:        GPL-3.0
Group:          Productivity/Archiving/Compression
Url:            https://github.com/wfx/epack
Source0:        https://github.com/wfx/epack/archive/v%{version}.tar.gz#/%{name}-%{version}.tar.gz
BuildRequires:  hicolor-icon-theme
BuildRequires:  pkgconfig
BuildRequires:  pkgconfig(python3)
BuildRequires:  python3-efl
# Check list of dependencies:
BuildRequires:  python3-magic
BuildRequires:  pkgconfig(libarchive)
Requires:       %(rpm -qf $(readlink -qne %{_libdir}/libarchive.so) --qf '%{NAME} >= %{VERSION}')
Requires:       python3-efl
Requires:       python3-magic
Recommends:     %{name}-lang
BuildArch:      noarch
%if 0%{?suse_version}
BuildRequires:  fdupes
BuildRequires:  update-desktop-files
%endif

%description
A simple tool to extract any archive file.

%lang_package

%prep
%setup -q

%build
python3 setup.py build

%install
python3 setup.py install --prefix=%{_prefix} --root=%{buildroot}
%find_lang %{name}
%if 0%{?suse_version}
%suse_update_desktop_file -r %{name} Enlightenment Utility Archiving Compression
%suse_update_desktop_file -r %{name}_extract_here Enlightenment Utility Archiving Compression
%fdupes %{buildroot}/%{python_sitelib}
%endif

%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 LICENSE README.md
%{_bindir}/%{name}
%{python_sitelib}/%{name}/
%{python_sitelib}/%{name}-*.egg-info
%{_datadir}/applications/%{name}*.desktop
%{_datadir}/icons/hicolor/*/apps/%{name}.??g

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

%changelog
openSUSE Build Service is sponsored by