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
f850ab0
Release:        1%{?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
9c649fc
BuildRequires:  python2-coverage
c2c17de
BuildRequires:  python2-devel
9c649fc
BuildRequires:  python2-flake8
9c649fc
BuildRequires:  python-mccabe
44da9f2
BuildRequires:  python-nose
9c649fc
BuildRequires:  python2-pytest
9c649fc
BuildRequires:  python2-pytest-runner
9c649fc
BuildRequires:  python2-pytest-cov
9c649fc
BuildRequires:  python-setuptools
44da9f2
BuildRequires:  python-tox
44da9f2
BuildRequires:  pyicu
c2c17de
BuildRequires:  epydoc
c2c17de
%if %{with python3}
9c649fc
BuildRequires:  python3-coverage
c2c17de
BuildRequires:  python3-devel
9c649fc
BuildRequires:  python3-flake8
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
44da9f2
BuildRequires:  python3-tox
c2c17de
%endif
c2c17de
c2c17de
%description
c2c17de
parsedatetime is a python module that can parse human-readable date/time
c2c17de
strings.
c2c17de
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}
c2c17de
Summary:        Parse human-readable date/time strings in Python
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
c2c17de
%files
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
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
9c649fc
- 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