8f08240
%if 0%{?fedora} || 0%{?rhel} >= 8
8f08240
%global with_python3 1
8f08240
%endif
8f08240
8f08240
%global srcname pybtex-docutils
8f08240
8f08240
Name:           python-%{srcname}
8f08240
Version:        0.2.1
ea42108
Release:        8%{?dist}
8f08240
Summary:        Docutils backend for pybtex
8f08240
8f08240
License:        MIT
8f08240
URL:            https://github.com/mcmtroffaes/%{srcname}
e5e7913
Source0:        https://files.pythonhosted.org/packages/source/p/%{srcname}/%{srcname}-%{version}.tar.gz
8f08240
BuildArch:      noarch
8f08240
8f08240
BuildRequires:  python2-devel
ea42108
BuildRequires:  python2-docutils
8f08240
BuildRequires:  python2-nose
8f08240
BuildRequires:  python2-nose-cov
8f08240
BuildRequires:  python2-pybtex
8f08240
BuildRequires:  python2-setuptools
8f08240
BuildRequires:  python2-six
8f08240
BuildRequires:  python2-sphinx
8f08240
8f08240
%if 0%{?with_python3}
8f08240
BuildRequires:  python3-devel
8f08240
BuildRequires:  python3-docutils
8f08240
BuildRequires:  python3-nose
8f08240
BuildRequires:  python3-nose-cov
8f08240
BuildRequires:  python3-pybtex
8f08240
BuildRequires:  python3-setuptools
8f08240
BuildRequires:  python3-six
8f08240
BuildRequires:  python3-sphinx
8f08240
%endif
8f08240
8f08240
%global common_desc \
8f08240
This package contains a docutils backend for pybtex, a BibTeX-compatible\
8f08240
bibliography processor written in Python.  Bibliographic references in\
8f08240
BibTeX format (or any other format supported by pybtex) can be inserted\
8f08240
into python documentation to be rendered by docutils.
8f08240
8f08240
%description
8f08240
%common_desc
8f08240
8f08240
%package -n python2-%{srcname}
8f08240
Summary:        Docutils backend for pybtex
ea42108
Requires:       python2-docutils
8f08240
Requires:       python2-pybtex
8f08240
Requires:       python2-six
8f08240
8f08240
Provides:       bundled(jquery)
8f08240
Provides:       bundled(js-underscore)
8f08240
%{?python_provide:%python_provide python2-%{srcname}}
8f08240
8f08240
%description -n python2-%{srcname}
8f08240
%common_desc
8f08240
8f08240
%if 0%{?with_python3}
8f08240
%package -n python3-%{srcname}
8f08240
Summary:        Docutils backend for pybtex
8f08240
Requires:       python3-docutils
8f08240
Requires:       python3-pybtex
8f08240
Requires:       python3-six
8f08240
8f08240
Provides:       bundled(jquery)
8f08240
Provides:       bundled(js-underscore)
8f08240
%{?python_provide:%python_provide python3-%{srcname}}
8f08240
8f08240
%description -n python3-%{srcname}
8f08240
%common_desc
8f08240
%endif
8f08240
8f08240
%prep
8f08240
%setup -q -c
8f08240
8f08240
# Use the new sphinx default theme
8f08240
sed -i "s/'default'/'alabaster'/" %{srcname}-%{version}/doc/conf.py
8f08240
8f08240
# Prepare for python3 build
8f08240
cp -a %{srcname}-%{version} python3-%{srcname}-%{version}
8f08240
8f08240
# Fix doc building with python 3
8f08240
sed -i 's/"rb"/"rt"/' python3-%{srcname}-%{version}/doc/conf.py
8f08240
8f08240
%build
8f08240
# Python 2 build
8f08240
pushd %{srcname}-%{version}
8f08240
%py2_build
e5e7913
PYTHONPATH=$PWD make -C doc html SPHINXBUILD=%{_bindir}/sphinx-build-%{python2_version}
8f08240
popd
8f08240
8f08240
%if 0%{?with_python3}
8f08240
# Python 3 build
8f08240
pushd python3-%{srcname}-%{version}
8f08240
%py3_build
8f08240
PYTHONPATH=$PWD make -C doc html SPHINXBUILD=%{_bindir}/sphinx-build-%{python3_version}
8f08240
popd
8f08240
%endif
8f08240
8f08240
%install
8f08240
# Python 2 install
8f08240
pushd %{srcname}-%{version}
8f08240
%py2_install
8f08240
popd
8f08240
8f08240
%if 0%{?with_python3}
8f08240
# Python 3 install
8f08240
pushd python3-%{srcname}-%{version}
8f08240
%py3_install
8f08240
popd
8f08240
%endif
8f08240
8f08240
%check
8f08240
# Test the python 2 build
8f08240
pushd %{srcname}-%{version}
8f08240
PYTHONPATH=$PWD nosetests-%{python2_version} -v
8f08240
popd
8f08240
8f08240
%if 0%{?with_python3}
8f08240
# Python 3 install
8f08240
pushd python3-%{srcname}-%{version}
8f08240
PYTHONPATH=$PWD nosetests-%{python3_version} -v
8f08240
popd
8f08240
%endif
8f08240
8f08240
%files -n python2-%{srcname}
8f08240
%doc %{srcname}-%{version}/doc/_build/html/*
8f08240
%license %{srcname}-%{version}/LICENSE.rst
8f08240
%{python2_sitelib}/pybtex_docutils*
8f08240
8f08240
%if 0%{?with_python3}
8f08240
%files -n python3-%{srcname}
8f08240
%doc python3-%{srcname}-%{version}/doc/_build/html/*
8f08240
%license python3-%{srcname}-%{version}/LICENSE.rst
8f08240
%{python3_sitelib}/pybtex_docutils*
8f08240
%{python3_sitelib}/__pycache__/pybtex_docutils*
8f08240
%endif
8f08240
8f08240
%changelog
ea42108
* Mon Feb 12 2018 Iryna Shcherbina <ishcherb@redhat.com> - 0.2.1-8
ea42108
- Update Python 2 dependency declarations to new packaging standards
ea42108
  (See https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3)
ea42108
b47882f
* Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.2.1-7
b47882f
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
b47882f
a7b589b
* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.2.1-6
a7b589b
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
a7b589b
b9ec3de
* Sat Feb 11 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.2.1-5
b9ec3de
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
b9ec3de
1079c75
* Mon Dec 19 2016 Miro HronĨok <mhroncok@redhat.com> - 0.2.1-4
1079c75
- Rebuild for Python 3.6
1079c75
d38cc7a
* Tue Jul 19 2016 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.2.1-3
d38cc7a
- https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages
d38cc7a
8f08240
* Wed Mar  2 2016 Jerry James <loganjerry@gmail.com> - 0.2.1-2
8f08240
- Expand package description
8f08240
- Fix sphinx and noseutils invocations for python 3
8f08240
- Do not convert license file to HTML
8f08240
8f08240
* Thu Feb 25 2016 Jerry James <loganjerry@gmail.com> - 0.2.1-1
8f08240
- Initial RPM