@@ -14,22 +14,21 @@ Prefix: %{_prefix}
1414# https://codeload.github.com/fermitools/htgettoken/tar.gz/%%{version}
1515Source0: %{name }-%{version }.tar.gz
1616
17- # rpmbuild dependencies
18- BuildRequires: python-rpm-macros
19- BuildRequires: python3-rpm-macros
20-
2117# build dependencies
22- BuildRequires: python3
23- BuildRequires: python%{ python3_pkgversion }- pip
24- BuildRequires: python%{ python3_pkgversion }- setuptools
25- BuildRequires: python%{ python3_pkgversion }- wheel
18+ BuildRequires: python3-devel
19+ BuildRequires: python3dist( pip)
20+ BuildRequires: python3dist( setuptools)
21+ BuildRequires: python3dist( wheel)
2622
2723# -- Package: htgettoken
2824
2925# /usr/bin/htgettoken:
30- Requires: python%{python3_pkgversion }-gssapi
31- Requires: python%{python3_pkgversion }-paramiko
32- Requires: python%{python3_pkgversion }-urllib3
26+ # For RHEL>=9 all requirements automatically provided by Python metadata
27+ %if 0%{?rhel } && 0%{?rhel } < 9
28+ Requires: python3dist(gssapi)
29+ Requires: python3dist(paramiko)
30+ Requires: python3dist(urllib3)
31+ %endif
3332# /usr/bin/httokendecode:
3433Requires: jq
3534Recommends: scitokens-cpp
@@ -50,19 +49,11 @@ htgettoken gets OIDC bearer tokens by interacting with Hashicorp vault
5049%autosetup -n %{name }-%{version }
5150
5251%build
53- %if 0%{?rhel } > = 9
5452%py3_build_wheel
55- %else
56- %py3_build
57- %endif
5853
5954%install
6055# install the Python project
61- %if 0%{?rhel } > = 9
6256%py3_install_wheel %{name }-%{version }-* .whl
63- %else
64- %py3_install
65- %endif
6657# link httokendecode to htdecodetoken
6758(cd %{buildroot}%{_bindir}/; ln -s htdecodetoken httokendecode)
6859# install man pages
@@ -71,7 +62,7 @@ gzip -c %{name}.1 >%{buildroot}%{_datadir}/man/man1/%{name}.1.gz
7162for f in %{name} htdestroytoken htdecodetoken httokensh; do
7263 gzip -c $f .1 > %{buildroot}%{_datadir}/man/man1/$f .1.gz
7364done
74- ln -s htdecodetoken.1 %{buildroot }%{_datadir }/man/man1/httokendecode.1.gz
65+ ln -s htdecodetoken.1 %{buildroot }%{_datadir }/man/man1/httokendecode.1.gz
7566
7667%clean
7768rm -rf $RPM_BUILD_ROOT
@@ -80,6 +71,10 @@ rm -rf $RPM_BUILD_ROOT
8071
8172
8273%changelog
74+ # - Add BuildRequires python3-devel to generate correct Python metadata.
75+ # - Remove explicit Requires for python dependencies, rely on Python metadata.
76+ # - Always build with wheels.
77+
8378* Tue Feb 25 2025 Dave Dykstra <dwd@fnal.gov> 2.1-1
8479- Fix htdecodetoken to work with token files that do not end in a newline.
8580- Support args in htgettoken.main() Python entry point.
0 commit comments