## START: Set by rpmautospec ## (rpmautospec version 0.8.1) ## RPMAUTOSPEC: autorelease, autochangelog %define autorelease(e:s:pb:n) %{?-p:0.}%{lua: release_number = 1; 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 %global srcname beangulp %bcond check 1 Name: python-%{srcname} Version: 0.2.0 Release: %autorelease Summary: Importers Framework for Beancount License: GPL-2.0-only URL: https://github.com/beancount/beangulp # PyPI tarball doesn't include test artifacts Source: %{url}/archive/v%{version}/%{srcname}-%{version}.tar.gz BuildArch: noarch BuildRequires: python3-devel BuildRequires: sed %if %{with check} # Not packaged yet # BuildRequires: python3dist(petl) BuildRequires: python3dist(pytest) %endif %global _description %{expand: beangulp provides a framework for importing transactions into a Beancount ledger from account statements and other documents and for managing documents.} %description %_description %package -n python3-%{srcname} Summary: %{summary} %description -n python3-%{srcname} %_description %prep %autosetup -p1 -n %{srcname}-%{version} # petl isn't packaged yet rm beangulp/{petl_utils,petl_utils_test}.py # Installed without executable permissions, so the shebang is useless # (and contains prohibited /usr/bin/env anyway): sed -r -i '1{/^#!/d}' beangulp/file_type_testdata/example.py %generate_buildrequires %pyproject_buildrequires %build %pyproject_wheel %install %pyproject_install %pyproject_save_files -l %{srcname} # Remove spurious directories rm -r %{buildroot}%{python3_sitelib}/{examples,tools} %check %if %{with check} %pytest -v %else %pyproject_check_import %endif %files -n python3-%{srcname} -f %{pyproject_files} %doc README.rst %changelog ## START: Generated by rpmautospec * Fri May 30 2025 Davide Cavalca - 0.2.0-1 - Initial import; Fixes: RHBZ#2351111 ## END: Generated by rpmautospec