063d1b2
%global realname parsedatetime
063d1b2
063d1b2
%if 0%{?fedora}
063d1b2
%bcond_without python3
063d1b2
%else
063d1b2
%bcond_with python3
063d1b2
%endif
063d1b2
063d1b2
Name:           python-%{realname}
063d1b2
Version:        1.5
063d1b2
Release:        3%{?dist}
063d1b2
Summary:        Parse human-readable date/time strings in Python
063d1b2
063d1b2
Group:          Development/Languages
063d1b2
License:        ASL 2.0
063d1b2
URL:            https://github.com/bear/%{realname}
063d1b2
Source0:        https://github.com/bear/%{realname}/archive/v%{version}.tar.gz#/%{realname}-%{version}.tar.gz
063d1b2
Patch0:         fix-non-executable-script-init.patch
063d1b2
Patch1:         test-failure-eom-is-correct-but-expectation-is-wrong.patch
063d1b2
063d1b2
BuildArch:      noarch
063d1b2
BuildRequires:  python2-devel
063d1b2
BuildRequires:  python-setuptools
063d1b2
BuildRequires:  epydoc
063d1b2
%if %{with python3}
063d1b2
BuildRequires:  python3-devel
063d1b2
BuildRequires:  python3-setuptools
063d1b2
%endif
063d1b2
063d1b2
%description
063d1b2
parsedatetime is a python module that can parse human-readable date/time
063d1b2
strings.
063d1b2
063d1b2
%package doc
063d1b2
Summary:       Documentation for the parsedatetime python module
063d1b2
063d1b2
%description doc
063d1b2
This package contains the generated HTML documentation for the 
063d1b2
parsedatetime python module
063d1b2
063d1b2
%if %{with python3}
063d1b2
%package -n python3-%{realname}
063d1b2
Summary:        Parse human-readable date/time strings in Python
063d1b2
063d1b2
%description -n python3-%{realname}
063d1b2
parsedatetime is a python module that can parse human-readable date/time
063d1b2
strings.
063d1b2
%endif
063d1b2
063d1b2
%prep
063d1b2
%setup -q -n %{realname}-%{version}
063d1b2
%patch0 -p1
063d1b2
%patch1 -p1
063d1b2
063d1b2
# Fixes spurious-executable-perm warning
063d1b2
chmod 644 implementation_notes.txt
063d1b2
063d1b2
%if %{with python3}
063d1b2
rm -rf %{py3dir}
063d1b2
cp -a . %{py3dir}
063d1b2
%endif
063d1b2
063d1b2
%build
063d1b2
%{__python2} setup.py build
063d1b2
063d1b2
# Build documentation
063d1b2
epydoc --html --config epydoc.conf
063d1b2
063d1b2
%if %{with python3}
063d1b2
pushd %{py3dir}
063d1b2
%{__python3} setup.py build
063d1b2
popd
063d1b2
%endif
063d1b2
063d1b2
063d1b2
%install
063d1b2
063d1b2
%{__python2} setup.py install -O1 --skip-build --root %{buildroot}
063d1b2
# It makes no sense to ship all these tests in the package
063d1b2
# just use them during the build
063d1b2
rm -rf %{buildroot}%{python_sitelib}/%{realname}/tests
063d1b2
063d1b2
%if %{with python3}
063d1b2
pushd %{py3dir}
063d1b2
%{__python3} setup.py install --skip-build --root %{buildroot}
063d1b2
# It makes no sense to ship all these tests in the package
063d1b2
# just use them during the build
063d1b2
rm -rf %{buildroot}%{python3_sitelib}/%{realname}/tests
063d1b2
popd
063d1b2
%endif
063d1b2
063d1b2
%check
063d1b2
%{__python2} run_tests.py
063d1b2
063d1b2
%if %{with python3}
063d1b2
pushd %{py3dir}
063d1b2
%{__python3} run_tests.py test
063d1b2
%endif
063d1b2
063d1b2
063d1b2
%files
063d1b2
%license LICENSE.txt
063d1b2
%doc AUTHORS.txt CHANGES.txt INSTALL.txt README.rst THANKS.txt
063d1b2
%{python2_sitelib}/%{realname}
063d1b2
%{python2_sitelib}/%{realname}-%{version}-*.egg-info
063d1b2
063d1b2
%files doc
063d1b2
%doc docs/ examples/ implementation_notes.txt locale_date_grouping_notes.txt
063d1b2
063d1b2
%if %{with python3}
063d1b2
%files -n python3-%{realname}
063d1b2
%license LICENSE.txt
063d1b2
%doc AUTHORS.txt CHANGES.txt INSTALL.txt README.rst THANKS.txt
063d1b2
%{python3_sitelib}/%{realname}
063d1b2
%{python3_sitelib}/%{realname}*.egg-info
063d1b2
%endif
063d1b2
063d1b2
%changelog
063d1b2
* Fri Dec 04 2015 Robert Buchholz <rbu@goodpoint.de> - 1.5-3
063d1b2
- Fix test failure in December
063d1b2
063d1b2
* Tue Nov 10 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.5-2
063d1b2
- Rebuilt for https://fedoraproject.org/wiki/Changes/python3.5
063d1b2
063d1b2
* Thu Jul 02 2015 Michele Baldessari <michele@acksyn.org> - 1.5-1
063d1b2
- New upstream (BZ#1238670)
063d1b2
* Mon Jun 22 2015 Michele Baldessari <michele@acksyn.org> - 1.4-2
063d1b2
- Fix python --> python2 macros
063d1b2
* Thu Jun 04 2015 Michele Baldessari <michele@acksyn.org> - 1.4-1
063d1b2
- Initial packaging