1- %{?scl:%scl_package pytiger}
2- %{! ?scl:%global pkg_name %{name }}
1+ %if 0%{?scl:1 }
2+ %scl_package pytiger
3+ %global py_prefix %{scl_prefix }python
4+ %else
5+ %global pkg_name pytiger
6+ %global py_prefix python%{python3_pkgversion }
7+ %endif
38
49%if 0%{?rhel } == 7 && 0%{!?scl:1 }
510# This flag denotes we want to build python2 and python3 RPMs in one go, which
6- # only applies on CentOS 7 for Python 2.7 and 3.4/3. 6, and only if we are NOT
11+ # only applies on CentOS 7 for Python 2.7 and 3.6, and only if we are NOT
712# building for an SCL Python package.
8- %global _want_dual_pythons 1
9- %endif
10-
11- # The current convention for Python 2.x non-SCL packages is to prefix them
12- # python2-, so conditionally define a macro we can use to add this tag.
13- %if 0%{!?scl:1 }
14- %global python2_pkgtag 2
13+ %global _want_python2 1
1514%endif
1615
1716%global sum Tiger Computing Ltd Python Utilities
1817
19- Name: %{?scl_prefix }pytiger
18+ Name: %{?scl_prefix }%{ pkg_name }
2019Summary: %{sum }
21- Version: 1.2.1
22- Release: 4 %{?dist }
20+ Version: 1.2.2
21+ Release: 1 %{?dist }
2322
2423Group: Development/Libraries
2524License: BSD-3-clause
@@ -28,73 +27,66 @@ Url: https://github.com/tigercomputing/%{pkg_name}
2827
2928BuildArch: noarch
3029BuildRequires: epel-rpm-macros
31-
32- BuildRequires: python%{ python3_pkgversion }-devel
33- BuildRequires: python%{ python3_pkgversion }-setuptools
30+ %{?scl:BuildRequires: %{ scl_prefix }build}
31+ BuildRequires: %{ py_prefix }-devel
32+ BuildRequires: %{ py_prefix }-setuptools
3433
3534# Requirements for RHEL7 py2 only
36- %if 0%{?_want_dual_pythons :1 }
37- BuildRequires: %{? scl_prefix } python-devel
38- BuildRequires: %{? scl_prefix } python-setuptools
35+ %if 0%{?_want_python2 :1 }
36+ BuildRequires: python-devel
37+ BuildRequires: python-setuptools
3938%endif
4039
4140%description
4241This is the Tiger Computing Ltd Python Utility library, pytiger.
4342
44- %package -n python%{ python3_pkgversion }-%{pkg_name }
43+ %package -n %{ py_prefix }-%{pkg_name }
4544Summary: %{sum }
46- Requires: python%{ python3_pkgversion }-six
45+ Requires: %{ py_prefix }-six
4746
48- %description -n python%{ python3_pkgversion }-%{pkg_name }
47+ %description -n %{ py_prefix }-%{pkg_name }
4948This is the Tiger Computing Ltd Python Utility library, pytiger.
5049
5150# For dual pythons, add in the extra binary package
52- %if 0%{?_want_dual_pythons :1 }
53- %package -n %{? scl_prefix }python%{? python2_pkgtag } -%{pkg_name }
51+ %if 0%{?_want_python2 :1 }
52+ %package -n python2 -%{pkg_name }
5453Summary: %{sum }
55- Requires: %{?scl_prefix }python-six
56- %if 0%{!?scl:1 }
57- %{?python_provide:%python_provide python%{?python2_pkgtag }-%{pkg_name }}
58- %endif
54+ Requires: python-six
5955
60- %description -n %{? scl_prefix }python%{? python2_pkgtag } -%{pkg_name }
56+ %description -n python2 -%{pkg_name }
6157This is the Tiger Computing Ltd Python Utility library, pytiger.
6258%endif
6359
6460%prep
6561%setup -n %{pkg_name }-%{version } -q
6662
6763%build
68- %if 0%{?scl:1 }
69- %{? scl:scl enable %{scl } " }
70- %{__python} setup.py build
71- %{?scl:" }
72- %else
73- %py3_build
74- %{? _want_dual_pythons:%py_build }
75- %endif
64+ %{? scl:scl enable %{scl } - << \EOF}
65+ %{__python3} setup.py build
66+ %{?scl:EOF}
67+ %{?_want_python2:%{__python} setup.py build}
7668
7769%install
7870rm -rf $RPM_BUILD_ROOT
79- %if 0%{?scl:1 }
80- %{? scl:scl enable %{scl } " }
81- %{__python} setup.py install --skip-build --root $RPM_BUILD_ROOT \
82- --install-data=%{_datadir}
83- %{?scl:" }
84- %else
85- %py3_install
86- %{? _want_dual_pythons:%py_install }
87- %endif
71+ %{?scl:scl enable %{scl} - << \EOF}
72+ %{__python3} setup.py install -O1 --skip-build --root $RPM_BUILD_ROOT
73+ %{?scl:EOF}
74+ %{?_want_python2:%{__python} setup.py install -O1 --skip-build --root $RPM_BUILD_ROOT }
8875
89- %files -n python%{ python3_pkgversion }-%{pkg_name }
76+ %files -n %{py_prefix }-%{pkg_name}
9077%{python3_sitelib}/*
9178
92- %if 0%{?_want_dual_pythons :1 }
93- %files -n %{? scl_prefix }python%{? python2_pkgtag } -%{pkg_name }
79+ %if 0%{?_want_python2 :1}
80+ %files -n python2 -%{pkg_name}
9481%{python_sitelib}/*
9582%endif
9683
9784%changelog
85+ * Tue Oct 24 2023 Chris Boot <[email protected] > - 1.2.2-1 86+ - Add GitLab CI test runs and RPM building.
87+ - Overhaul the RPM spec file completely.
88+ - Refactor pytiger.utils.plugins for Python 3.12.
89+
9890* Wed Jan 13 2021 Jonathan Wiltshire <[email protected] > - 1.2.1-4 9991- Build for Python 3 by default, and Python 2 as an option.
10092
0 commit comments