Skip to content

Commit d9ec7c4

Browse files
johnnykeatsthiell
authored andcommitted
Adding RHEL 8 in spec file (#413)
* Adding RHEL 8 in spec file * Using unversioned python3 for rhel8, keeping versioned for others.
1 parent 36b4302 commit d9ec7c4

File tree

1 file changed

+25
-3
lines changed

1 file changed

+25
-3
lines changed

clustershell.spec.in

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,11 @@ Group: System Environment/Base
4141
URL: http://cea-hpc.github.io/clustershell/
4242
Source0: https://files.pythonhosted.org/packages/source/C/%{srcname}/%{srcname}-%{version}.tar.gz
4343
BuildArch: noarch
44+
%if 0%{?rhel} >= 8
45+
Requires: python3-%{name} = %{version}-%{release}
46+
%else
4447
Requires: python2-%{name} = %{version}-%{release}
48+
%endif
4549
%if 0%{?rhel} >= 7 || 0%{?fedora}
4650
Requires: vim-filesystem
4751
%else if 0%{?suse_version}
@@ -62,7 +66,7 @@ server farms. Command line utilities like clush, clubak and nodeset (or
6266
cluset) allow traditional shell scripts to take benefit of the features
6367
offered by the library.
6468

65-
69+
%if 0%{?rhel} < 8
6670
%package -n python2-%{name}
6771
Summary: ClusterShell module for Python 2
6872
BuildRequires: %{python2_pkgprefix}-devel
@@ -77,7 +81,7 @@ Requires: PyYAML
7781

7882
%description -n python2-%{name}
7983
ClusterShell Python 2 module and related command line tools.
80-
84+
%endif
8185

8286
%package -n %{python3_pkgprefix}-%{name}
8387
Summary: ClusterShell module for Python 3
@@ -101,13 +105,15 @@ ClusterShell Python 3 module and related command line tools.
101105
%install
102106
%{__python3} setup.py install -O1 --skip-build --root %{buildroot}
103107

108+
%if 0%{?rhel} < 8
104109
pushd %{buildroot}%{_bindir}
105110
for i in clubak cluset clush nodeset; do
106111
mv $i $i-%{python3_shortver}
107112
done
108113
popd
109114

110115
%{__python2} setup.py install -O1 --skip-build --root %{buildroot}
116+
%endif
111117

112118
# move config dir away from default setuptools /usr prefix (if rpm-building as user)
113119
[ -d %{buildroot}/usr/etc ] && mv %{buildroot}/usr/etc %{buildroot}/%{_sysconfdir}
@@ -144,6 +150,8 @@ install -p -m 0644 doc/extras/vim/syntax/groupsconf.vim %{buildroot}/%{vimdatadi
144150
rm -rf %{buildroot}
145151
%endif
146152

153+
# Unversioned python3 for rhel8
154+
%if 0%{?rhel} < 8
147155
%files -n python2-%{name}
148156
%if 0%{?rhel}
149157
%defattr(-,root,root,-)
@@ -166,6 +174,20 @@ rm -rf %{buildroot}
166174
%{python3_sitelib}/ClusterShell/
167175
%{python3_sitelib}/ClusterShell-*-py?.?.egg-info
168176

177+
%else
178+
%files -n %{python3_pkgprefix}-%{name}
179+
%if 0%{?rhel}
180+
%defattr(-,root,root,-)
181+
%endif
182+
%{_bindir}/clubak
183+
%{_bindir}/cluset
184+
%{_bindir}/clush
185+
%{_bindir}/nodeset
186+
%{python3_sitelib}/ClusterShell/
187+
%{python3_sitelib}/ClusterShell-*-py?.?.egg-info
188+
%endif
189+
190+
169191
%files
170192
%if 0%{?rhel}
171193
%defattr(-,root,root,-)
@@ -196,7 +218,7 @@ rm -rf %{buildroot}
196218
%{vimdatadir}/syntax/groupsconf.vim
197219

198220
%changelog
199-
- Tue Oct 30 2018 Stephane Thiell <[email protected]> 1.8.1-1
221+
* Tue Oct 30 2018 Stephane Thiell <[email protected]> 1.8.1-1
200222
- update to 1.8.1
201223

202224
* Mon Oct 23 2017 Stephane Thiell <[email protected]> 1.8-1

0 commit comments

Comments
 (0)