## START: Set by rpmautospec
## (rpmautospec version 0.7.3)
## RPMAUTOSPEC: autorelease, autochangelog
%define autorelease(e:s:pb:n) %{?-p:0.}%{lua:
    release_number = 2;
    base_release_number = tonumber(rpm.expand("%{?-b*}%{!?-b:1}"));
    print(release_number + base_release_number - 1);
}%{?-e:.%{-e*}}%{?-s:.%{-s*}}%{!?-n:%{?dist}}
## END: Set by rpmautospec

Name:           python-glymur
Version:        0.14.1.post2
%global srcversion %(echo '%{version}' | sed -r 's/\\.(post)/\\1/')
Release:        %autorelease
Summary:        Interface to the OpenJPEG library for working with JPEG 2000 files

# SPDX
License:        MIT
URL:            https://github.com/quintusdias/glymur
# The PyPI sdist lacks documentation.
Source0:        %{url}/archive/v%{srcversion}/glymur-%{srcversion}.tar.gz
# Man pages hand-written for Fedora in groff_man(7) format based on --help
# output:
Source1:        jp2dump.1
Source2:        jpeg2jp2.1
Source3:        tiff2jp2.1

# Since the package has had endian-dependent test failures in the past, we give
# up “noarch” in the base package in order to run tests on all supported
# architectures.  We can still make all the built RPMs noarch.  Since the
# package does not in fact contain any compiled code, there is no corresponding
# debuginfo package.
%global debug_package %{nil}

# https://fedoraproject.org/wiki/Changes/EncourageI686LeafRemoval
%if %{undefined fc40} && %{undefined fc41}
ExcludeArch:    %{ix86}
%endif

BuildRequires:  python3-devel

# Test dependencies are now only listed in CI configurations, e.g.
# ci/travis-313.yaml, so we must enumerate them manually.
BuildRequires:  %{py3_dist pytest}
BuildRequires:  %{py3_dist pytest-xdist}
BuildRequires:  %{py3_dist scikit-image}

# tests/fixtures.py: each of these enables more tests
# (We also have a weak dependency on gdal.)
BuildRequires:  %{py3_dist gdal}

# Provide shared libraries opened via ctypes; see glymur/config.py
BuildRequires:  openjpeg2
BuildRequires:  libtiff

%if %[ %{defined fc43} || %{defined fc42} || %{defined fc41} || %{defined fc40} || %{defined el9} ]
# Workaround for setuptools<77.0.3; see
# https://packaging.python.org/en/latest/guides/writing-pyproject-toml/#license-and-license-files.
# Once https://src.fedoraproject.org/rpms/python-setuptools/pull-request/124
# lands in Rawhide, we can remove the fc43 term from the conditional.
%global no_pep_639_backend 1

BuildRequires:  tomcli
%endif

%global _description %{expand:
Glymur contains a Python interface to the OpenJPEG
library which allows one to read and write JPEG 2000 files.}

%description %_description

%package -n python3-glymur
Summary:        %{summary}

BuildArch:      noarch

# Provide shared libraries opened via ctypes; see glymur/config.py
Requires:       openjpeg2
Requires:       libtiff

# glymur/jp2box.py: provides optional functionality
Recommends:     %{py3_dist gdal}

%description -n python3-glymur %_description


%prep
%autosetup -n glymur-%{srcversion} -p1

%if 0%{?no_pep_639_backend}
tomcli set pyproject.toml del project.license
%endif


%generate_buildrequires
%pyproject_buildrequires


%build
%pyproject_wheel


%install
install -m 0644 -p -D -t '%{buildroot}%{_mandir}/man1' \
    '%{SOURCE1}' '%{SOURCE2}' '%{SOURCE3}'


%pyproject_install
%pyproject_save_files -l glymur


%check
%pytest ${ignore-} -k "${k-}" -n auto -rs -v


%files -n python3-glymur -f %{pyproject_files}
%doc README.md CHANGES.txt
%{_bindir}/jp2dump
%{_bindir}/jpeg2jp2
%{_bindir}/tiff2jp2

%{_mandir}/man1/jp2dump.1*
%{_mandir}/man1/jpeg2jp2.1*
%{_mandir}/man1/tiff2jp2.1*

%changelog
## START: Generated by rpmautospec
* Sun Apr 06 2025 Benjamin A. Beasley <code@musicinmybrain.net> - 0.14.1.post2-1
- Update to 0.14.1.post2

* Sun Apr 06 2025 Benjamin A. Beasley <code@musicinmybrain.net> - 0.14.1.post1-1
- Update to 0.14.1.post1 (close RHBZ#2357703)

* Sun Apr 06 2025 Packit <hello@packit.dev> - 0.14.1-1
- Update to 0.14.1 upstream release
- Resolves: rhbz#2354283

* Sat Jan 25 2025 Benjamin A. Beasley <code@musicinmybrain.net> - 0.13.8-2
- Drop manual BuildRequires on scikit-image
- Remove the scikit_image_tests build conditional, as it no longer works
- Re-enable some still-disabled scikit-image tests in Fedora 42

* Sat Jan 25 2025 Packit <hello@packit.dev> - 0.13.8-1
- Update to 0.13.8 upstream release
- Resolves: rhbz#2342054

* Sat Jan 18 2025 Fedora Release Engineering <releng@fedoraproject.org> - 0.13.7-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild

* Thu Jan 16 2025 Benjamin A. Beasley <code@musicinmybrain.net> - 0.13.7-5
- Improved source URL with a better archive name

* Thu Jan 16 2025 Benjamin A. Beasley <code@musicinmybrain.net> - 0.13.7-4
- Temporarily work around python-scikit-image not rebuilt for numpy 2

* Thu Jan 16 2025 Benjamin A. Beasley <code@musicinmybrain.net> - 0.13.7-3
- Drop i686 support, starting with Fedora 42

* Thu Jan 16 2025 Benjamin A. Beasley <code@musicinmybrain.net> - 0.13.7-2
- Generate BuildRequires for testing

* Wed Jan 15 2025 Packit <hello@packit.dev> - 0.13.7-1
- Update to 0.13.7 upstream release
- Resolves: rhbz#2338121

* Thu Aug 22 2024 Benjamin A. Beasley <code@musicinmybrain.net> - 0.13.6-1
- Update to 0.13.6 (close RHBZ#2306038)

* Mon Jul 29 2024 Benjamin A. Beasley <code@musicinmybrain.net> - 0.13.5-1
- Update to 0.13.5 (close RHBZ#2295855)

* Fri Jul 19 2024 Fedora Release Engineering <releng@fedoraproject.org> - 0.13.3-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild

* Wed Jul 03 2024 Benjamin A. Beasley <code@musicinmybrain.net> - 0.13.3-1
- Update to 0.13.3 (close RHBZ#2295484)

* Tue Jun 18 2024 Python Maint <python-maint@redhat.com> - 0.13.2-4
- Rebuilt for Python 3.13

* Tue May 07 2024 Benjamin A. Beasley <code@musicinmybrain.net> - 0.13.2-3
- Fix test issue on s390x

* Tue May 07 2024 Benjamin A. Beasley <code@musicinmybrain.net> - 0.13.2-2
- Skip a failing new test on s390x

* Tue May 07 2024 Benjamin A. Beasley <code@musicinmybrain.net> - 0.13.2-1
- Update to 0.13.2 (close RHBZ#2279597)

* Tue Apr 23 2024 Benjamin A. Beasley <code@musicinmybrain.net> - 0.13.1-1
- Update to 0.13.1 (close RHBZ#2276644)

* Mon Apr 22 2024 Benjamin A. Beasley <code@musicinmybrain.net> - 0.13.0-1
- Update to 0.13.0 (close RHBZ#2276507)

* Fri Jan 26 2024 Fedora Release Engineering <releng@fedoraproject.org> - 0.12.9-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild

* Mon Jan 22 2024 Fedora Release Engineering <releng@fedoraproject.org> - 0.12.9-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild

* Wed Jan 03 2024 Benjamin A. Beasley <code@musicinmybrain.net> - 0.12.9-3
- Assert a license file is automatically handled; don’t package a duplicate

* Mon Nov 27 2023 Benjamin A. Beasley <code@musicinmybrain.net> - 0.12.9-2
- Fix oversights in the 0.12.9 release process (close RHBZ#2251615)

* Sun Nov 26 2023 Benjamin A. Beasley <code@musicinmybrain.net> - 0.12.9-1
- Update to 0.12.9

* Fri Jul 21 2023 Fedora Release Engineering <releng@fedoraproject.org> - 0.12.8-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild

* Wed Jul 12 2023 Benjamin A. Beasley <code@musicinmybrain.net> - 0.12.8-1
- Update to 0.12.8

* Tue Jul 11 2023 Benjamin A. Beasley <code@musicinmybrain.net> - 0.12.7-3
- Adapt to OrderedDict repr change in Python 3.12 (fix RHBZ#2220255)

* Tue Jul 11 2023 Python Maint <python-maint@redhat.com> - 0.12.7-2
- Rebuilt for Python 3.12

* Tue May 23 2023 Benjamin A. Beasley <code@musicinmybrain.net> - 0.12.7-1
- Update to 0.12.7 (close RHBZ#2208378)

* Tue May 23 2023 Benjamin A. Beasley <code@musicinmybrain.net> - 0.12.6.post1-1
- Update to 0.12.6^post1

* Thu May 04 2023 Benjamin A. Beasley <code@musicinmybrain.net> - 0.12.5-1
- Update to 0.12.5 (close RHBZ#2193080)
- Fixes remaining test failures on s390x
  (https://github.com/quintusdias/glymur/issues/604,
  https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1032291)

* Thu Apr 27 2023 Benjamin A. Beasley <code@musicinmybrain.net> - 0.12.4-1
- Update to 0.12.4 (close RHBZ#2190054)

* Sun Apr 23 2023 Benjamin A. Beasley <code@musicinmybrain.net> - 0.12.3-1
- Update to 0.12.3 (close RHBZ#2188827)

* Tue Apr 18 2023 Benjamin A. Beasley <code@musicinmybrain.net> - 0.12.2-1
- Update to 0.12.2 (close RHBZ#2158610)

* Fri Jan 20 2023 Fedora Release Engineering <releng@fedoraproject.org> - 0.12.1-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild

* Wed Nov 30 2022 Benjamin A. Beasley <code@musicinmybrain.net> - 0.12.1-1
- Update to 0.12.1 (close RHBZ#2148803)

* Sat Oct 29 2022 Benjamin A. Beasley <code@musicinmybrain.net> - 0.12.0-1
- Update to 0.12.0 (close RHBZ#2138301)
- Test failures on s390x are now skipped and tracked upstream (close
  RHBZ#2068124)

* Tue Sep 20 2022 Benjamin A. Beasley <code@musicinmybrain.net> - 0.11.7-1
- Update to 0.11.7 (close RHBZ#2128302)

* Sun Sep 18 2022 Benjamin A. Beasley <code@musicinmybrain.net> - 0.11.6^post2-1
- Update to 0.11.6^post2 (close RHBZ#2127664)

* Wed Sep 14 2022 Benjamin A. Beasley <code@musicinmybrain.net> - 0.11.6^post1-1
- Update to 0.11.6.post1 (close RHBZ#2126581)

* Tue Sep 13 2022 Benjamin A. Beasley <code@musicinmybrain.net> - 0.11.6-1
- Update to 0.11.6 (close RHBZ#2126238)

* Thu Sep 08 2022 Benjamin A. Beasley <code@musicinmybrain.net> - 0.11.5-1
- Update to 0.11.5 (close RHBZ#2118756)

* Thu Aug 11 2022 Benjamin A. Beasley <code@musicinmybrain.net> - 0.11.2-1
- Update to 0.11.2 (close RHBZ#2116095)

* Thu Aug 11 2022 Benjamin A. Beasley <code@musicinmybrain.net> - 0.11.0-2
- Confirm that License is SPDX MIT (no License field change)

* Tue Aug 02 2022 Benjamin A. Beasley <code@musicinmybrain.net> - 0.11.0-1
- Update to 0.11.0 (close RHBZ#2112493)

* Fri Jul 22 2022 Fedora Release Engineering <releng@fedoraproject.org> - 0.10.2-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild

* Sun Jul 17 2022 Benjamin A. Beasley <code@musicinmybrain.net> - 0.10.2-1
- Update to 0.10.2 (close RHBZ#2097446)

* Tue Jun 28 2022 Python Maint <python-maint@redhat.com> - 0.9.9-2
- Rebuilt for Python 3.11

* Thu Mar 24 2022 Benjamin A. Beasley <code@musicinmybrain.net> - 0.9.9-1
- Update to 0.9.9 (fix RHBZ#2060087, close RHBZ#2068123)

* Mon Mar 21 2022 Benjamin A. Beasley <code@musicinmybrain.net> - 0.9.8-1
- Update to 0.9.8 (fix RHBZ#2060033, fix RHBZ#2062941)

* Fri Jan 21 2022 Fedora Release Engineering <releng@fedoraproject.org> - 0.9.4-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild

* Fri Nov 05 2021 Ankur Sinha (Ankur Sinha Gmail) <sanjay.ankur@gmail.com> - 0.9.4-3
- improvement: tweak description

* Mon Nov 01 2021 Vanessa Christopher <vanessaigwe1@gmail.com> 0.9.4-9
- Uncommitted changes

* Fri Oct 29 2021 Vanessa Christopher <vanessaigwe1@gmail.com> 0.9.4-8
- Added man-page to package

* Thu Oct 28 2021 Vanessa Christopher <vanessaigwe1@gmail.com> 0.9.4-7
- added CHANGES.txt to package docs

* Mon Oct 25 2021 Vanessa Christopher <vanessaigwe1@gmail.com> 0.9.4-6
- changed Release = %%autorelease and %%changelog = %%autochangelog

* Mon Oct 25 2021 Vanessa Christopher <vanessaigwe1@gmail.com> 0.9.4-5
- updated spec file

* Fri Oct 22 2021 Vanessa Christopher <vanessaigwe1@gmail.com> 0.9.4-4
- fresh mockbuild for review

* Fri Oct 22 2021 Vanessa Christopher <vanessaigwe1@gmail.com> 0.9.4-3
- sending for review

* Fri Oct 22 2021 Vanessa Christopher <vanessaigwe1@gmail.com> 0.9.4-2
- rpm package created successfully

* Thu Oct 21 2021 Vanessa Christopher <vanessaigwe1@gmail.com> 0.9.4-1
- building process ...


## END: Generated by rpmautospec