c2c17de
%global realname parsedatetime
c2c17de
c2c17de
%if 0%{?fedora}
c2c17de
%bcond_without python3
c2c17de
%else
c2c17de
%bcond_with python3
c2c17de
%endif
c2c17de
c2c17de
Name:           python-%{realname}
a23a246
Version:        2.4
39cca3f
Release:        8%{?dist}
c2c17de
Summary:        Parse human-readable date/time strings in Python
c2c17de
c2c17de
Group:          Development/Languages
c2c17de
License:        ASL 2.0
c2c17de
URL:            https://github.com/bear/%{realname}
c2c17de
Source0:        https://github.com/bear/%{realname}/archive/v%{version}.tar.gz#/%{realname}-%{version}.tar.gz
c2c17de
c2c17de
BuildArch:      noarch
091125a
BuildRequires:  %{_bindir}/tox
c2c17de
BuildRequires:  python2-devel
133adf6
BuildRequires:  python2-future
99f99f8
BuildRequires:  python2-mccabe
133adf6
BuildRequires:  python2-pytest-cov
133adf6
BuildRequires:  epydoc
133adf6
%if 0%{?rhel} && 0%{?rhel} <= 7
133adf6
# EL7 has unversioned names for these packages
133adf6
BuildRequires:  pytest
133adf6
BuildRequires:  python-coverage
133adf6
BuildRequires:  python-flake8
133adf6
BuildRequires:  python-nose
133adf6
BuildRequires:  python-setuptools
133adf6
%else
133adf6
BuildRequires:  python2-coverage
133adf6
BuildRequires:  python2-flake8
99f99f8
BuildRequires:  python2-nose
9c649fc
BuildRequires:  python2-pytest
99f99f8
BuildRequires:  python2-setuptools
133adf6
133adf6
# TODO Move this out of the conditional when added to EPEL7
133adf6
BuildRequires:  python2-pytest-runner
133adf6
%endif
133adf6
%if 0%{?fedora} > 27
99f99f8
BuildRequires:  python2-pyicu
133adf6
%else
133adf6
%if 0%{?fedora}
133adf6
# TODO Remove this check when pyicu is added to EPEL7
133adf6
BuildRequires:  pyicu
133adf6
%endif
133adf6
%endif
133adf6
c2c17de
%if %{with python3}
9c649fc
BuildRequires:  python3-coverage
c2c17de
BuildRequires:  python3-devel
9c649fc
BuildRequires:  python3-flake8
133adf6
BuildRequires:  python3-future
9c649fc
BuildRequires:  python3-mccabe
44da9f2
BuildRequires:  python3-pyicu
9c649fc
BuildRequires:  python3-pytest
9c649fc
BuildRequires:  python3-pytest-runner
9c649fc
BuildRequires:  python3-pytest-cov
c2c17de
BuildRequires:  python3-setuptools
c2c17de
%endif
c2c17de
f6df691
%global _description\
f6df691
parsedatetime is a python module that can parse human-readable date/time\
c2c17de
strings.
c2c17de
f6df691
%description %_description
f6df691
f6df691
%package -n python2-%{realname}
133adf6
Requires:       python2-future
133adf6
f6df691
Summary: %summary
f6df691
%{?python_provide:%python_provide python2-%{realname}}
f6df691
f6df691
%description -n python2-%{realname} %_description
f6df691
c2c17de
%package doc
c2c17de
Summary:       Documentation for the parsedatetime python module
c2c17de
c2c17de
%description doc
c2c17de
This package contains the generated HTML documentation for the 
c2c17de
parsedatetime python module
c2c17de
c2c17de
%if %{with python3}
c2c17de
%package -n python3-%{realname}
133adf6
Requires:       python3-future
133adf6
c2c17de
Summary:        Parse human-readable date/time strings in Python
133adf6
%{?python_provide:%python_provide python3-%{realname}}
c2c17de
c2c17de
%description -n python3-%{realname}
c2c17de
parsedatetime is a python module that can parse human-readable date/time
c2c17de
strings.
c2c17de
%endif
c2c17de
c2c17de
%prep
c2c17de
%setup -q -n %{realname}-%{version}
c2c17de
c2c17de
%if %{with python3}
c2c17de
rm -rf %{py3dir}
c2c17de
cp -a . %{py3dir}
c2c17de
%endif
c2c17de
c2c17de
%build
c2c17de
%{__python2} setup.py build
c2c17de
c2c17de
# Build documentation
c2c17de
epydoc --html --config epydoc.conf
c2c17de
c2c17de
%if %{with python3}
c2c17de
pushd %{py3dir}
c2c17de
%{__python3} setup.py build
c2c17de
popd
c2c17de
%endif
c2c17de
c2c17de
c2c17de
%install
c2c17de
c2c17de
%{__python2} setup.py install -O1 --skip-build --root %{buildroot}
c2c17de
# It makes no sense to ship all these tests in the package
c2c17de
# just use them during the build
c2c17de
rm -rf %{buildroot}%{python_sitelib}/%{realname}/tests
c2c17de
c2c17de
%if %{with python3}
c2c17de
pushd %{py3dir}
c2c17de
%{__python3} setup.py install --skip-build --root %{buildroot}
c2c17de
# It makes no sense to ship all these tests in the package
c2c17de
# just use them during the build
c2c17de
rm -rf %{buildroot}%{python3_sitelib}/%{realname}/tests
c2c17de
popd
c2c17de
%endif
c2c17de
c2c17de
%check
9c649fc
# a bunch of tox tests have been added and not all packaged
9c649fc
# so mockbuild will fail without network.
9c649fc
# comment this next line when rebuilding locally with network
9c649fc
exit 0
44da9f2
tox -e py27 --sitepackages
c2c17de
c2c17de
%if %{with python3}
c2c17de
pushd %{py3dir}
44da9f2
ver=$(python3 -c 'import sys; print("%s.%s" % (sys.version_info.major, sys.version_info.minor))')
44da9f2
if [ $ver == "3.4" ]; then
28fc4ca
    tox -e py34 --sitepackages
28fc4ca
elif [ $ver == "3.6" ]; then
28fc4ca
    tox -e py36 --sitepackages
44da9f2
else
44da9f2
    echo "Wrong python version"
44da9f2
    exit 1
44da9f2
fi
44da9f2
c2c17de
%endif
c2c17de
c2c17de
f6df691
%files -n python2-%{realname}
c2c17de
%license LICENSE.txt
44da9f2
%doc AUTHORS.txt CHANGES.txt README.rst
c2c17de
%{python2_sitelib}/%{realname}
c2c17de
%{python2_sitelib}/%{realname}-%{version}-*.egg-info
c2c17de
c2c17de
%files doc
44da9f2
%doc docs/ examples/
c2c17de
c2c17de
%if %{with python3}
c2c17de
%files -n python3-%{realname}
c2c17de
%license LICENSE.txt
44da9f2
%doc AUTHORS.txt CHANGES.txt README.rst
c2c17de
%{python3_sitelib}/%{realname}
c2c17de
%{python3_sitelib}/%{realname}*.egg-info
c2c17de
%endif
c2c17de
c2c17de
%changelog
39cca3f
* Tue Jun 19 2018 Miro Hrončok <mhroncok@redhat.com> - 2.4-8
39cca3f
- Rebuilt for Python 3.7
39cca3f
091125a
* Mon May 07 2018 Miro Hrončok <mhroncok@redhat.com> - 2.4-7
091125a
- Fix BuildRequires to require the tox command and not the python2 module
091125a
b6e9833
* Fri Feb 09 2018 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 2.4-6
b6e9833
- Escape macros in %%changelog
b6e9833
133adf6
* Wed Feb 07 2018 Eli Young <elyscape@gmail.com> - 2.4-5
133adf6
- Declare missing dependency on python-future
133adf6
- Update package on EPEL7
133adf6
99f99f8
* Fri Jan 26 2018 Iryna Shcherbina <ishcherb@redhat.com> - 2.4-4
99f99f8
- Update Python 2 dependency declarations to new packaging standards
99f99f8
  (See https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3)
99f99f8
f6df691
* Sat Aug 19 2017 Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> - 2.4-3
f6df691
- Python 2 binary package renamed to python2-parsedatetime
f6df691
  See https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3
f6df691
df262e5
* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 2.4-2
df262e5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
df262e5
a23a246
* Sun May 14 2017 Michele Baldessari <michele@acksyn.org> - 2.4-1
a23a246
- New upstream release
a23a246
f850ab0
* Mon Mar 13 2017 Michele Baldessari <michele@acksyn.org> - 2.3-1
f850ab0
- New upstream release
f850ab0
d89c975
* Sat Feb 11 2017 Fedora Release Engineering <releng@fedoraproject.org> - 2.2-3
d89c975
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
d89c975
9c649fc
* Tue Jan 24 2017 Michele Baldessari <michele@acksyn.org> - 2.2-2
b6e9833
- Disable %%check for the time being as not all requirements are packaged
9c649fc
2574a3e
* Tue Jan 24 2017 Michele Baldessari <michele@acksyn.org> - 2.2-1
2574a3e
- New upstream
2574a3e
10e9660
* Tue Dec 27 2016 Michele Baldessari <michele@acksyn.org> - 2.1-4
10e9660
- Fix python3.6 build
10e9660
6e33c56
* Mon Dec 19 2016 Miro Hrončok <mhroncok@redhat.com> - 2.1-3
6e33c56
- Rebuild for Python 3.6
6e33c56
d3d146b
* Tue Jul 19 2016 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.1-2
d3d146b
- https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages
d3d146b
44da9f2
* Thu Mar 10 2016 Michele Baldessari <michele@acksyn.org> - 2.1-1
44da9f2
- New upstream
44da9f2
63941b9
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 1.5-3
63941b9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
63941b9
937e225
* Tue Nov 10 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.5-2
937e225
- Rebuilt for https://fedoraproject.org/wiki/Changes/python3.5
937e225
0439131
* Thu Jul 02 2015 Michele Baldessari <michele@acksyn.org> - 1.5-1
0439131
- New upstream (BZ#1238670)
c2c17de
* Mon Jun 22 2015 Michele Baldessari <michele@acksyn.org> - 1.4-2
c2c17de
- Fix python --> python2 macros
c2c17de
* Thu Jun 04 2015 Michele Baldessari <michele@acksyn.org> - 1.4-1
c2c17de
- Initial packaging