5528128
%{!?python2_shortver: %global python2_shortver %(%{__python2} -c 'import sys; print(str(sys.version_info.major) + "." + str(sys.version_info.minor))')}
5528128
%{!?python3_shortver: %global python3_shortver %(%{__python3} -c 'import sys; print(str(sys.version_info.major) + "." + str(sys.version_info.minor))')}
5528128
04b202f
%global pypi_name pytimeparse
04b202f
5528128
%if 0%{?fedora} >= 24
5528128
%global with_python3 1
5528128
%endif
5528128
5528128
04b202f
Name:           python-pytimeparse
cd02706
Version:        1.1.5
9fa4038
Release:        6%{?dist}
04b202f
Summary:        Python time expression parse library
cd02706
License:        MIT
cd02706
URL:            https://github.com/wroberts/pytimeparse
cd02706
Source0:        https://pypi.python.org/packages/source/p/%{pypi_name}/%{pypi_name}-%{version}.tar.gz
04b202f
BuildArch:      noarch
04b202f
5528128
%package -n python2-%{pypi_name}
5528128
Summary:        Python time expression parse library
5528128
%{?python_provide:%python_provide python2-pytimeparse}
5528128
5528128
BuildRequires:    python-setuptools
5528128
BuildRequires:    python2-devel
5528128
5528128
%description -n python2-%{pypi_name}
5528128
A small Python library to parse various kinds of time expressions
5528128
5528128
%if 0%{?with_python3}
5528128
%package -n python3-%{pypi_name}
5528128
5528128
Summary:        Python time expression parse library
5528128
%{?python_provide:%python_provide python3-pytimeparse}
5528128
cd02706
BuildRequires:    python3-setuptools
cd02706
BuildRequires:    python3-devel
04b202f
5528128
%description -n python3-%{pypi_name}
5528128
A small Python library to parse various kinds of time expressions
5528128
5528128
%endif
5528128
04b202f
%description
04b202f
A small Python library to parse various kinds of time expressions
04b202f
04b202f
%prep
04b202f
%setup -q -n %{pypi_name}-%{version}
04b202f
04b202f
%build
5528128
%py2_build
5528128
5528128
%if 0%{?with_python3}
cd02706
%py3_build
5528128
%endif
5528128
04b202f
cd02706
# Find all *.py files with the exact line '#!/usr/bin/env python' and for each
cd02706
# such file replace the line with nothing (if it's the 1st line).
cd02706
grep -ilrx build -e '#!/usr/bin/env python' --include '*.py'| xargs sed -i '1s\^#!/usr/bin/env python$\\'
04b202f
04b202f
%install
5528128
%if 0%{?with_python3}
cd02706
%py3_install
5528128
%endif
5528128
5528128
%{__python2} setup.py install --skip-build --root %{buildroot}
04b202f
5528128
%files -n python2-%{pypi_name}
5528128
%doc README.rst
5528128
%{python2_sitelib}/*
5528128
5528128
%if 0%{?with_python3}
5528128
%files -n python3-%{pypi_name}
04b202f
%doc README.rst
cd02706
%{python3_sitelib}/*
5528128
%endif
04b202f
04b202f
04b202f
%changelog
9fa4038
* Tue Jul 19 2016 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.1.5-6
9fa4038
- https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages
9fa4038
5528128
* Fri Jun 17 2016 Pradeep Kilambi <pkilambi@redhat.com> - 1.1.5-5
5528128
- Add support so we build both py2 and py3
5528128
cd02706
* Fri Apr 08 2016 Dominika Krejci <dkrejci@redhat.com> - 1.1.5-4
cd02706
- Remove unnecessary shebang lines
cd02706
cd02706
* Mon Feb 08 2016 Matej Dujava <mdujava@redhat.com> - 1.1.5-3
cd02706
- Add python3
cd02706
f6c537f
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 1.1.5-2
f6c537f
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
f6c537f
4bcae73
* Tue Aug 04 2015 Pradeep Kilambi <pkilambi@redhat.com> - 1.1.5-1
4bcae73
- new version build
4bcae73
6efc4bb
* Thu Jun 18 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.1.4-2
6efc4bb
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
6efc4bb
04b202f
* Tue May 05 2015 Pradeep Kilambi <pkilambi@redhat.com> 1.1.4
04b202f
- initial package release
04b202f