From a858188efa33644d78f606c9bce1d176696588fb Mon Sep 17 00:00:00 2001 From: Chandan Kumar Date: Sep 07 2015 14:44:52 +0000 Subject: add python2 along with python3 subpackage Conforming to the latest package guidelines --- diff --git a/python-iso8601.spec b/python-iso8601.spec index 20927fe..66975b5 100644 --- a/python-iso8601.spec +++ b/python-iso8601.spec @@ -1,41 +1,48 @@ +%{!?upstream_version: %global upstream_version %{version}%{?milestone}} + %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())")} -%endif - %global srcname iso8601 Name: python-%{srcname} Version: 0.1.10 -Release: 5%{?dist} +Release: 6%{?dist} Summary: Simple module to parse ISO 8601 dates -Group: Development/Languages 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: python2-devel python-setuptools -%if 0%{?with_python3} -BuildRequires: python3-devel python3-setuptools -%endif %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. +%package -n python2-iso8601 +Summary: Simple module to parse ISO 8601 dates +%{?python_provide:%python_provide python2-iso8601} +# python_provide does not exist in CBS Cloud buildroot +Provides: python-iso8601 = %{version}-%{release} +Obsoletes: python-iso8601 < 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. + %if 0%{?with_python3} -%package -n python3-%{srcname} +%package -n python3-iso8601 Summary: Simple module to parse ISO 8601 dates -Group: Development/Languages +%{?python_provide:%python_provide python3-iso8601} + +BuildRequires: python3-devel python3-setuptools -%description -n python3-%{srcname} +%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. %endif @@ -43,42 +50,34 @@ This module parses the most common forms of ISO 8601 date strings %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,-) +%files -n python2-iso8601 %doc LICENSE README.rst %{python2_sitelib}/* %if 0%{?with_python3} -%files -n python3-%{srcname} -%defattr(-,root,root,-) +%files -n python3-iso8601 %doc LICENSE README.rst %{python3_sitelib}/* %endif %changelog +* Mon Sep 07 2015 Chandan Kumar - 0.1.10-6 +- Added python2 along with python3 subpackage + * Thu Jun 18 2015 Fedora Release Engineering - 0.1.10-5 - Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild