#1 Build for Python3 on EPEL
Closed 6 years ago by abompard. Opened 6 years ago by abompard.
rpms/ abompard/python-iso8601 epel7  into  master

file modified
+49 -25
@@ -1,29 +1,32 @@ 

  %{!?upstream_version: %global upstream_version %{version}%{?milestone}}

  

- %if 0%{?fedora}

+ %if 0%{?fedora} || 0%{?epel} >= 7

  %global with_python3 1

  %endif

  

  %global srcname iso8601

+ %global summary Simple module to parse ISO 8601 dates

+ %global _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.

  

  Name:           python-%{srcname}

  Version:        0.1.11

- Release:        1%{?dist}

- Summary:        Simple module to parse ISO 8601 dates

+ Release:        2%{?dist}

+ Summary:        %{summary}

  

  License:        MIT

  URL:            http://pypi.python.org/pypi/%{srcname}/

  Source0:        http://pypi.python.org/packages/source/i/%{srcname}/%{srcname}-%{version}.tar.gz

- BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)

  

  BuildArch:      noarch

  

- %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.

+ BuildRequires:  python-srpm-macros

+ 

+ %description %{_description}

  

  %package -n python2-iso8601

- Summary:        Simple module to parse ISO 8601 dates

+ Summary:        %{summary}

  %{?python_provide:%python_provide python2-iso8601}

  # python_provide does not exist in CBS Cloud buildroot

  Provides:       python-iso8601 = %{version}-%{release}
@@ -31,50 +34,71 @@ 

  

  BuildRequires:  python2-devel python-setuptools

  

- %description -n python2-iso8601

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

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

+ %description -n python2-iso8601 %{_description}

  

  %if 0%{?with_python3}

- %package -n python3-iso8601

- Summary:        Simple module to parse ISO 8601 dates

- %{?python_provide:%python_provide python3-iso8601}

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

+ Summary:        %{summary}

+ %{?python_provide:%python_provide python%{python3_pkgversion}-%{srcname}}

  

- BuildRequires:  python3-devel python3-setuptools

+ BuildRequires:  python%{python3_pkgversion}-devel

+ BuildRequires:  python%{python3_pkgversion}-setuptools

  

- %description -n python3-iso8601

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

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

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

+ 

+ %if 0%{?with_python3_other}

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

+ Summary:        %{summary}

+ %{?python_provide:%python_provide python%{python3_other_pkgversion}-%{srcname}}

+ BuildRequires:  python%{python3_other_pkgversion}-devel

+ BuildRequires:  python%{python3_other_pkgversion}-setuptools

+ 

+ %description -n python%{python3_other_pkgversion}-%{srcname} %{_description}

  %endif

+ %endif # with_python3

  

  %prep

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

  

  %build

- %{__python2} setup.py build

- 

+ %py2_build

  %if 0%{?with_python3}

- %{__python3} setup.py build

+ %py3_build

+ %if 0%{?with_python3_other}

+ %py3_other_build

  %endif

+ %endif # with_python3

  

  %install

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

- 

+ %py2_install

  %if 0%{?with_python3}

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

+ %py3_install

+ %if 0%{?with_python3_other}

+ %py3_other_install

  %endif

+ %endif # with_python3

  

  %files -n python2-iso8601

  %doc LICENSE README.rst

  %{python2_sitelib}/*

  

  %if 0%{?with_python3}

- %files -n python3-iso8601

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

  %doc LICENSE README.rst

  %{python3_sitelib}/*

+ 

+ %if 0%{?with_python3_other}

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

+ %doc LICENSE README.rst

+ %{python3_other_sitelib}/*

  %endif

+ %endif # with_python3

  

  %changelog

+ * Wed Aug 16 2017 Aurelien Bompard <abompard@fedoraproject.org> - 0.1.11-2

+ - Build for Python3 on EPEL

+ - Modernize the spec a bit (build and install macros, no explicit buildroot)

+ 

  * Tue Jan 26 2016 Haïkel Guémar <hguemar@fedoraproject.org> - 0.1.11-1

  - Upstream 0.1.11

  

  • Apply the the Python3 on EPEL spec template
  • Modernize the spec a bit (build and install macros, no explicit
    buildroot)

Ah, I requested the PR on the master branch, not epel7. My bad.

Pull-Request has been closed by abompard

6 years ago
Metadata