#5 Enable python3 package
Closed 2 years ago by fab. Opened 4 years ago by stevetraylen.
rpms/ stevetraylen/python-iso8601 py3  into  el6

file modified
+8 -21
@@ -1,7 +1,3 @@ 

- %if 0%{?fedora}

- %global with_python3 1

- %endif

- 

  %if 0%{?rhel} && 0%{?rhel} <= 6

  %{!?__python2: %global __python2 /usr/bin/python2}

  %{!?python2_sitelib: %global python2_sitelib %(%{__python2} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")}
@@ -11,7 +7,7 @@ 

  

  Name:           python-%{srcname}

  Version:        0.1.10

- Release:        2%{?dist}

+ Release:        3%{?dist}

  Summary:        Simple module to parse ISO 8601 dates

  

  Group:          Development/Languages
@@ -22,63 +18,54 @@ 

  

  BuildArch:      noarch

  BuildRequires:  python2-devel python-setuptools

- %if 0%{?with_python3}

- BuildRequires:  python3-devel python3-setuptools

- %endif

+ BuildRequires:  python%{python3_pkgversion}-devel python%{python3_pkgversion}-setuptools

  

  %description

  This module parses the most common forms of ISO 8601 date strings

  (e.g. 2007-01-14T20:34:22+00:00) into datetime objects.

  

- %if 0%{?with_python3}

- %package -n python3-%{srcname}

+ %package -n python%{python3_pkgversion}-%{srcname}

  Summary:        Simple module to parse ISO 8601 dates

  Group:          Development/Languages

  

- %description -n python3-%{srcname}

+ %description -n python%{python3_pkgversion}-%{srcname}

  This module parses the most common forms of ISO 8601 date strings

  (e.g. 2007-01-14T20:34:22+00:00) into datetime objects.

- %endif

  

  %prep

  %setup -qn %{srcname}-%{version}

  

- %if 0%{?with_python3}

  cp -a . %{py3dir}

- %endif

  

  

  %build

  %{__python2} setup.py build

  

- %if 0%{?with_python3}

  pushd %{py3dir}

  %{__python3} setup.py build

  popd

- %endif

  

  %install

  %{__python2} setup.py install -O1 --skip-build --root %{buildroot}

  

- %if 0%{?with_python3}

  pushd %{py3dir}

  %{__python3} setup.py install --skip-build --root %{buildroot}

  popd

- %endif

  

  %files

  %defattr(-,root,root,-)

  %doc LICENSE README.rst

  %{python2_sitelib}/*

  

- %if 0%{?with_python3}

- %files -n python3-%{srcname}

+ %files -n python%{python3_pkgversion}-%{srcname}

  %defattr(-,root,root,-)

  %doc LICENSE README.rst

  %{python3_sitelib}/*

- %endif

  

  %changelog

+ * Tue Nov 26 2019 Steve Traylen <steve.traylen@cern.ch> - 0.1.10-3

+ - Add python3 package

+ 

  * Wed Apr 23 2014 Pádraig Brady <pbrady@redhat.com> - 0.1.10-2

  - Add python3 package

  

Create a python34-iso8601 package

Pull-Request has been closed by fab

2 years ago