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

file modified
+50 -38
@@ -1,80 +1,92 @@ 

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

  

- %if 0%{?fedora}

- %global with_python3 1

- %endif

- 

  %global srcname iso8601

+ %global sum Simple module to parse ISO 8601 dates

+ %global pkgdesc \

+ 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:        %{sum}

  

  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

+ BuildRequires:  python-srpm-macros

  

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

+ %description %{pkgdesc}

  

- %package -n python2-iso8601

- Summary:        Simple module to parse ISO 8601 dates

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

+ %package -n python2-%{srcname}

+ Summary:        %{sum}

+ %{?python_provide:%python_provide python2-%{srcname}}

  # python_provide does not exist in CBS Cloud buildroot

- Provides:       python-iso8601 = %{version}-%{release}

- Obsoletes:      python-iso8601 < 0.1.10-6

+ Provides:       python-%{srcname} = %{version}-%{release}

+ Obsoletes:      python-%{srcname} < 0.1.10-6

  

  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-%{srcname} %{pkgdesc}

  

- %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:        %{sum}

+ %{?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} %{pkgdesc}

+ 

+ %if 0%{?with_python3_other}

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

+ Summary:        %{sum}

+ %{?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} %{pkgdesc}

  %endif

  

  %prep

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

+ %autosetup -n %{srcname}-%{version}

  

  %build

- %{__python2} setup.py build

- 

- %if 0%{?with_python3}

- %{__python3} setup.py build

+ %py2_build

+ %py3_build

+ %if 0%{?with_python3_other}

+ %py3_other_build

  %endif

  

  %install

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

- 

- %if 0%{?with_python3}

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

+ %py2_install

+ %py3_install

+ %if 0%{?with_python3_other}

+ %py3_other_install

  %endif

  

- %files -n python2-iso8601

+ %files -n python2-%{srcname}

  %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

  

  %changelog

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

+ - Build for Python3 on EPEL:

+   http://fedoraproject.org/wiki/PackagingDrafts:Python3EPEL

+ - 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)

rebased

6 years ago

rebased

6 years ago

Thanks!

Is it appropriate to apply these changes as-is to Fedora branches as well? It appears to be, and I am considering applying this to master, updating to 0.1.12, and building rawhide/f27/f26/epel7.

Yeah, it should work on Fedora too, I have a few packages that follow this template with Fedora & EPEL branches.
Would you prefer me to make a pull request on master instead?

That would be best I think.

Pull-Request has been closed by abompard

6 years ago
Metadata