Skip to content

Commit 9bf809c

Browse files
Update RPM spec file to use python3-devel
This ensures that full Python metadata is built and installed with the binary RPM(s)
1 parent 7c0e7c6 commit 9bf809c

File tree

1 file changed

+15
-20
lines changed

1 file changed

+15
-20
lines changed

htgettoken.spec

Lines changed: 15 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -14,22 +14,21 @@ Prefix: %{_prefix}
1414
# https://codeload.github.com/fermitools/htgettoken/tar.gz/%%{version}
1515
Source0: %{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:
3433
Requires: jq
3534
Recommends: 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
7162
for f in %{name} htdestroytoken htdecodetoken httokensh; do
7263
gzip -c $f.1 >%{buildroot}%{_datadir}/man/man1/$f.1.gz
7364
done
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
7768
rm -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

Comments
 (0)