%global __python3 /usr/bin/python3.11
%global python3_pkgversion 3.11
Name:           qpc
Summary:        command-line client interface for quipucords

Version:        1.8.0
Release:        1.20240530174758827619.main.3.gc651843%{?dist}
Epoch:          0

License:        GPLv3
URL:            https://github.com/quipucords/qpc
Source0:        qpc-1.8.0.tar.gz

BuildArch:      noarch
BuildRequires:  python%{python3_pkgversion}-devel
BuildRequires:  python%{python3_pkgversion}-setuptools

Requires:       python%{python3_pkgversion}
Requires:       python%{python3_pkgversion}-cryptography
Requires:       python%{python3_pkgversion}-requests
Requires:       python%{python3_pkgversion}-setuptools

%description
qpc is the command-line client interface for the quipucords server.

%prep
%autosetup -n qpc-1.8.0

%build
%py3_build

%install
QPC_VAR_PROGRAM_NAME=qpc %py3_install
mkdir -p %{buildroot}%{_mandir}/man1/
sed \
  -e "s/QPC_VAR_PROGRAM_NAME/qpc/g" \
  -e "s/QPC_VAR_PROJECT/quipucords/g" \
  -e "s/QPC_VAR_CURRENT_YEAR/$(date +'%Y')/g" \
  -e "s/BUILD_DATE/$(date +'%B %d, %Y')/g" \
  docs/_build/QPC_VAR_PROGRAM_NAME.1 > \
  %{buildroot}%{_mandir}/man1/qpc.1

%files
%license LICENSE
%doc README.md
%doc %{_mandir}/man1/qpc.*
%{_bindir}/qpc
%{python3_sitelib}/qpc/
%{python3_sitelib}/qpc-*.egg-info/

%changelog
* Thu May 30 2024 Packit <hello@packit.dev> - 0:1.8.0-1.20240530174758827619.main.3.gc651843
- build(deps-dev): bump jinja2 from 3.1.3 to 3.1.4 (dependabot[bot])
- build(deps): bump requests from 2.31.0 to 2.32.2 (dependabot[bot])
- refactor: build and test on both python 3.11 and 3.12 (Brad Smith)

* Mon May 13 2024 Bruno Ciconelle <bciconel@redhat.com> - 0:1.8.0-1
- Drop support to Decision Manager (BRMS).
- Refactor report upload to use the async view.
- Optimize report merge.
- Deprecate report merge-status; scan job should be used instead.

* Fri Apr 26 2024 Brad Smith <brasmith@redhat.com> - 0:1.7.0-1
- Improve user experience with paginated results.

* Tue Mar 26 2024 Brad Smith <brasmith@redhat.com> - 0:1.6.0-1
- Optimize "clear --all" commands by using new bulk delete APIs.

* Mon Feb 12 2024 Brad Smith <brasmith@redhat.com> - 0:1.5.1-1
- Minor updates and cleanup.

* Mon Jan 22 2024 Brad Smith <brasmith@redhat.com> - 0:1.5.0-1
- Initial release of qpc CLI as an RPM.