%global pypi_name obal

Name:           %{pypi_name}
Version:        0.12.1
Release:        1%{?dist}
Summary:        packaging wrapper using ansible

License:        GPLv2
URL:            https://github.com/theforeman/obal
Source0:        %{pypi_source}
Patch0:         ansible-core.patch
BuildArch:      noarch

BuildRequires:  python3-devel
BuildRequires:  python3-setuptools

# TODO: autogenerated from extra?
Requires:       %{py3_dist argcomplete}

Requires: git-annex
Requires: koji
Requires: rpm-build
Requires: rpmlint
Requires: scl-utils
Requires: scl-utils-build
Requires: tito
Requires: yum-utils

Obsoletes:      python2-obal < %{version}
Conflicts:      python2-obal
Obsoletes:      python3-obal < %{version}
Conflicts:      python3-obal

%description
Obal is an Ansible wrapper with a set of Ansible playbooks to ease maintanance
of packaging repositories like foreman-packaging and pulp-packaging.

%generate_buildrequires
%pyproject_buildrequires

%prep
%autosetup -p1 -n %{pypi_name}-%{version}

%build
%pyproject_wheel

%install
%pyproject_install
%pyproject_save_files obal

%check
# Test files aren't included in the release
%py3_check_import obal

%files -f %{pyproject_files}
%license LICENSE
%doc README.md
%{_bindir}/obal

%changelog
* Thu Dec 28 2023 Ewoud Kohl van Wijngaarden <ewoud@kohlvanwijngaarden.nl> - 0.12.1-1
- Update to 0.12.1

* Sat Nov 19 2022 Ewoud Kohl van Wijngaarden <ewoud@kohlvanwijngaarden.nl> - 0.11.0-1
- Update to 0.11.0

* Fri Aug 27 2021 Ewoud Kohl van Wijngaarden <ewoud@kohlvanwijngaarden.nl> - 0.9.0-2
- Fedora 35/Python 3.10 compatibility
- Build with Python 3 on EL > 7

* Fri Aug 27 2021 Ewoud Kohl van Wijngaarden <ewoud@kohlvanwijngaarden.nl> - 0.9.0-1
- Update to 0.9.0

* Wed Feb 24 2021 Ewoud Kohl van Wijngaarden <ewoud@kohlvanwijngaarden.nl> - 0.8.0-1
- Update to 0.8.0

* Thu Feb 28 2019 Ewoud Kohl van Wijngaarden <ewoud@kohlvanwijngaarden.nl> - 0.3.0-1
- Update to 0.3.0
- Use current Fedora Python RPM packaging macros

* Tue Dec 18 2018 Ewoud Kohl van Wijngaarden <ewoud@kohlvanwijngaarden.nl> - 0.2.0-1
- Update to 0.2.0

* Wed Oct 24 2018 Ewoud Kohl van Wijngaarden <ewoud@kohlvanwijngaarden.nl> - 0.1.0-1
- Update to 0.1.0

* Fri Sep 14 2018 Ewoud Kohl van Wijngaarden <ewoud@kohlvanwijngaarden.nl> - 0.0.6-2
- Add runtime dependencies