15
0

Accepting request 989516 from home:VortexAcherontic

Added the requested changes:

- formatted spec file using spec-cleaner
- removed macros from name and url
-  added test runs
- and improved the multi version support

Many thanks for looking into it :)

OBS-URL: https://build.opensuse.org/request/show/989516
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-icoextract?expand=0&rev=1
This commit is contained in:
2022-07-16 10:57:26 +00:00
committed by Git OBS Bridge
commit ab3abe4be9
5 changed files with 193 additions and 0 deletions

101
python-icoextract.spec Normal file
View File

@@ -0,0 +1,101 @@
#
# spec file for package python-icoextract
#
# Copyright (c) 2022 SUSE LLC
#
# 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 https://bugs.opensuse.org/
#
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
%define skip_python2 1
Name: python-icoextract
Version: 0.1.3
Release: 0
Summary: Extract icons from Windows PE files (.exe/.dll)
License: MIT
Group: System/GUI/Other
URL: https://github.com/jlu5/icoextract
Source: https://github.com/jlu5/icoextract/archive/%{version}/icoextract-%{version}.tar.gz
BuildRequires: %{python_module devel}
BuildRequires: %{python_module pefile}
BuildRequires: %{python_module setuptools}
BuildRequires: ImageMagick
BuildRequires: cmake
BuildRequires: fdupes
BuildRequires: mingw32-cross-binutils
BuildRequires: mingw32-cross-gcc
BuildRequires: mingw64-cross-gcc
BuildRequires: pkgconfig
BuildRequires: python-rpm-macros
Requires: %{python_module pefile}
Requires(post): update-alternatives
Requires(postun): update-alternatives
Suggests: %{python_module Pillow}
BuildArch: noarch
%python_subpackages
%description
icoextract is an icon extractor for Windows PE files (.exe/.dll), written in
Python. It also includes a thumbnailer script (exe-thumbnailer) for Linux
desktops.
%prep
%setup -q -n icoextract-%{version}
%build
%python_build
%install
%python_install
mkdir -p %{buildroot}%{_datadir}/thumbnailers/
cp exe-thumbnailer.thumbnailer %{buildroot}%{_datadir}/thumbnailers/
%python_clone -a %{buildroot}%{_bindir}/exe-thumbnailer
%python_clone -a %{buildroot}%{_bindir}/icoextract
%python_clone -a %{buildroot}%{_bindir}/icolist
%python_clone -a %{buildroot}%{_datadir}/thumbnailers/exe-thumbnailer.thumbnailer
%python_expand %fdupes %{buildroot}%{$python_sitearch}
%check
%if %{with test}
cd tests
%cmake_build
%endif
%post
update-alternatives --install \
%{_datadir}/thumbnailers/exe-thumbnailer.thumbnailer \
exe-thumbnailer.thumbnailer \
%{_datadir}/thumbnailers/exe-thumbnailer.thumbnailer-%{python_version} %{python_version_nodots}
%python_install_alternative exe-thumbnailer
%python_install_alternative icoextract
%python_install_alternative icolist
%postun
[ -f %{_datadir}/thumbnailers/exe-thumbnailer.thumbnailer-%{python_version} ] || update-alternatives --remove \
exe-thumbnailer.thumbnailer \
%{_datadir}/thumbnailers/exe-thumbnailer.thumbnailer-%{python_version}
%python_uninstall_alternative exe-thumbnailer
%python_uninstall_alternative icoextract
%python_uninstall_alternative icolist
%files %{python_files}
%doc README.md
%license LICENSE
%{python_sitelib}/*
%python_alternative %{_bindir}/exe-thumbnailer
%python_alternative %{_bindir}/icoextract
%python_alternative %{_bindir}/icolist
%dir %{_datadir}/thumbnailers
%python_alternative %{_datadir}/thumbnailers/exe-thumbnailer.thumbnailer
%changelog