Name: python-libzim Version: 4.0.0 Release: 1%{?dist} Summary: Python bindings for libzim, to read and write ZIM archives License: GPL-3.0-or-later URL: https://github.com/openzim/python-libzim Source0: %{url}/archive/v%{version}/%{name}-%{version}.tar.gz BuildRequires: python3-devel BuildRequires: gcc-c++ BuildRequires: pkgconfig(libzim) BuildRequires: python3-pytest %global _description %{expand: Python bindings for libzim, the reference library for ZIM, the archive format Kiwix uses to carry Wikipedia and other websites for offline reading. They can read articles, metadata and illustrations, run full-text searches and suggestions, and create new ZIM files.} %description %{_description} %package -n python3-libzim Summary: %{summary} %description -n python3-libzim %{_description} %prep %autosetup -p1 # Upstream pins exact build tool versions. sed -i -e '/^\[build-system\]/,/^\]/{s/"setuptools == [^"]*"/"setuptools"/; s/"wheel == [^"]*"/"wheel"/; s/"cython == [^"]*"/"cython"/}' \ pyproject.toml grep -A4 '^\[build-system\]' pyproject.toml | grep -q '"cython",' %generate_buildrequires # setup.py runs here too: link Fedora's libzim, never download one. export USE_SYSTEM_LIBZIM=1 DONT_DOWNLOAD_LIBZIM=1 %pyproject_buildrequires %build export USE_SYSTEM_LIBZIM=1 DONT_DOWNLOAD_LIBZIM=1 %pyproject_wheel %install %pyproject_install %pyproject_save_files -l libzim %check %pyproject_check_import # OFFLINE skips the tests that fetch sample ZIM files from GitHub. # test_creator_verbose[False] counts libzim's progress lines, which differ # between libzim releases (2 with 9.4, 6 with 9.8). # test_reader_get_random_entry downloads too but lacks the OFFLINE marker. OFFLINE=1 %pytest tests -k 'not (test_creator_verbose and False) and not test_reader_get_random_entry' %files -n python3-libzim -f %{pyproject_files} %doc README.md CHANGELOG.md %changelog * Sat Oct 31 2026 Morgan Hough - 4.0.0-1 - Initial package