@@ -41,7 +41,11 @@ Group: System Environment/Base
4141URL: http://cea-hpc.github.io/clustershell/
4242Source0: https://files.pythonhosted.org/packages/source/C/%{srcname}/%{srcname}-%{version}.tar.gz
4343BuildArch: noarch
44+ %if 0%{?rhel} >= 8
45+ Requires: python3-%{name} = %{version}-%{release}
46+ %else
4447Requires: python2-%{name} = %{version}-%{release}
48+ %endif
4549%if 0%{?rhel} >= 7 || 0%{?fedora}
4650Requires: vim-filesystem
4751%else if 0%{?suse_version}
@@ -62,7 +66,7 @@ server farms. Command line utilities like clush, clubak and nodeset (or
6266cluset) allow traditional shell scripts to take benefit of the features
6367offered by the library.
6468
65-
69+ %if 0%{?rhel} < 8
6670%package -n python2-%{name}
6771Summary: ClusterShell module for Python 2
6872BuildRequires: %{python2_pkgprefix}-devel
@@ -77,7 +81,7 @@ Requires: PyYAML
7781
7882%description -n python2-%{name}
7983ClusterShell Python 2 module and related command line tools.
80-
84+ %endif
8185
8286%package -n %{python3_pkgprefix}-%{name}
8387Summary: 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
104109pushd %{buildroot}%{_bindir}
105110for i in clubak cluset clush nodeset; do
106111 mv $i $i-%{python3_shortver}
107112done
108113popd
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
144150rm -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