Files
packages/anda/langs/python/pillow-heif/python3-pillow-heif.spec
T
Gilver cf51f0d748 feat: The Python ifcondening (#5050) (#5091)
* chore(sphinxcontrib-moderncmakedomain): The ifcondening



* chore(colorz): The ifcondening



* chore(protobuf): The ifcondening



* fix: That's siteARCH



* cleanup: /



* chore(lomiri-ui-toolkit): The ifcondening



* chore(pillow-heif): The ifcondening



* chore(haishoku): The ifcondening



* chore(fast-colorthief): The ifcondening



* chore(ignis): The ifcondening



* chore(modern-colorthief): The Ifcondening



* chore(shibuya): The ifcondening



* Revert "chore(modern-colorthief): The Ifcondening"

This reverts commit dc82282bb7.

* refactor: Change the ifcondening approach

* cleanup: / again

* Revert "chore(sphinxcontrib-moderncmakedomain): The ifcondening"

This reverts commit 45f5cd8e36.

* Revert "chore(ignis): The ifcondening"

This reverts commit 88c4d68297.

* bulk: She if on my condition

* Updates with new packages

* I forgot the stupit 0 thing

* Fixes based on builds per branch

---------


(cherry picked from commit f8eb58ff9c)

Signed-off-by: Gilver <rockgrub@disroot.org>
Signed-off-by: RockGrub <RockGrub@users.noreply.github.com>
2025-05-28 13:28:24 +08:00

129 lines
3.9 KiB
RPMSpec

%global py3_incdir %(RPM_BUILD_ROOT= %{python3} -Ic 'import sysconfig; print(sysconfig.get_path("include"))')
%global srcname pillow-heif
# Dependencies are missing to build the documentation
%bcond_with doc
Name: python-%{srcname}
Version: 0.22.0
Release: 2%?dist
Summary: Python library for working with HEIF images and plugin for Pillow
License: BSD-3-Clause
URL: https://github.com/bigcat88/pillow_heif
Source0: https://github.com/bigcat88/pillow_heif/archive/refs/tags/v%{version}/pillow-heif-%{version}.tar.gz
Source1: test.py
BuildRequires: gcc
BuildRequires: python%{python3_pkgversion}-pytest
BuildRequires: python%{python3_pkgversion}
BuildRequires: python%{python3_pkgversion}-devel
BuildRequires: python%{python3_pkgversion}-setuptools
BuildRequires: python%{python3_pkgversion}-pillow-devel
BuildRequires: libheif-devel
BuildRequires: python%{python3_pkgversion}dist(pip)
%if %{with doc}
BuildRequires: make
BuildRequires: python%{python3_pkgversion}-sphinx
BuildRequires: python%{python3_pkgversion}-sphinx-copybutton
BuildRequires: python%{python3_pkgversion}-sphinx-issues
BuildRequires: python%{python3_pkgversion}-sphinx_rtd_theme
%endif
%description
Python library for working with HEIF images and plugin for Pillow
There are two subpackages: devel (development) and doc (documentation).
%package -n python%{python3_pkgversion}-%{srcname}
Summary: Python library for working with HEIF images and plugin for Pillow
Requires: python%{python3_pkgversion}-pillow
Requires: libheif
%{?python_provide:%python_provide python%{python3_pkgversion}-%{srcname}}
%description -n python%{python3_pkgversion}-%{srcname}
Python library for working with HEIF images and plugin for Pillow
There are two subpackages: devel (development) and doc (documentation).
%package -n python%{python3_pkgversion}-%{srcname}-devel
Summary: Development files for %{srcname}
Requires: python%{python3_pkgversion}-devel, libheif-devel
Requires: python%{python3_pkgversion}-%{srcname}%{?_isa} = %{version}-%{release}
%{?python_provide:%python_provide python%{python3_pkgversion}-%{srcname}-devel}
%description -n python%{python3_pkgversion}-%{srcname}-devel
Development files for %{srcname}.
%package -n python%{python3_pkgversion}-%{srcname}-doc
Summary: Documentation for %{srcname}
BuildArch: noarch
Requires: python%{python3_pkgversion}-%{srcname} = %{version}-%{release}
%{?python_provide:%python_provide python%{python3_pkgversion}-%{srcname}-doc}
%description -n python%{python3_pkgversion}-%{srcname}-doc
Documentation for %{srcname}.
%prep
%autosetup -p1 -n pillow_heif-%{version}
%build
# Native build
%if 0%{?fedora} <= 41 || 0%{?rhel}
%py3_build
%else
%pyproject_wheel
%endif
# Doc build
%if %{with doc}
PYTHONPATH=$(echo $PWD/build/lib.linux-*) make -C docs html BUILDDIR=_build_py3 SPHINXBUILD=sphinx-build-%python3_version
rm -f docs/_build_py3/html/.buildinfo
%endif
%install
# Native build
%if 0%{?fedora} <= 41 || 0%{?rhel}
%py3_install
%else
%pyproject_install
%endif
%check
# Check Python 3 modules
cp %{SOURCE1} $(echo $PWD/build/lib.linux-*)/
pushd build/lib.linux-*
PYTHONPATH=$PWD %{__python3} test.py
pytest pillow_heif && echo "Test done"
popd
%files -n python%{python3_pkgversion}-%{srcname}
%doc README.md CHANGELOG.md
%license LICENSE.txt
%{python3_sitearch}/pillow_heif/
%if 0%{?fedora} <= 41 || 0%{?rhel}
%{python3_sitearch}/pillow_heif-%{version}-py%{python3_version}.egg-info/
%else
%{python3_sitearch}/pillow_heif-%{version}.dist-info/
%endif
%{python3_sitearch}/_pillow_heif.*.so
%files -n python%{python3_pkgversion}-%{srcname}-devel
%if %{with doc}
%files -n python%{python3_pkgversion}-%{srcname}-doc
%doc docs/_build_py3/html
%endif
%changelog
* Wed Jul 10 2024 Trung Lê <8@tle.id.au> - 0.17.0-0
- New upstream release
* Thu Jun 27 2024 Trung Lê <8@tle.id.au> - 0.16.0-1
- Initial RPM package