Blob Blame History Raw
%if 0%{?fedora} || 0%{?rhel} >= 8
%global with_python3 1

%global srcname pybtex-docutils

Name:           python-%{srcname}
Version:        0.2.1
Release:        4%{?dist}
Summary:        Docutils backend for pybtex

License:        MIT
URL:  {srcname}
BuildArch:      noarch

BuildRequires:  python2-devel
BuildRequires:  python-docutils
BuildRequires:  python2-nose
BuildRequires:  python2-nose-cov
BuildRequires:  python2-pybtex
BuildRequires:  python2-setuptools
BuildRequires:  python2-six
BuildRequires:  python2-sphinx

%if 0%{?with_python3}
BuildRequires:  python3-devel
BuildRequires:  python3-docutils
BuildRequires:  python3-nose
BuildRequires:  python3-nose-cov
BuildRequires:  python3-pybtex
BuildRequires:  python3-setuptools
BuildRequires:  python3-six
BuildRequires:  python3-sphinx

%global common_desc \
This package contains a docutils backend for pybtex, a BibTeX-compatible\
bibliography processor written in Python.  Bibliographic references in\
BibTeX format (or any other format supported by pybtex) can be inserted\
into python documentation to be rendered by docutils.


%package -n python2-%{srcname}
Summary:        Docutils backend for pybtex
Requires:       python-docutils
Requires:       python2-pybtex
Requires:       python2-six

Provides:       bundled(jquery)
Provides:       bundled(js-underscore)
%{?python_provide:%python_provide python2-%{srcname}}

%description -n python2-%{srcname}

%if 0%{?with_python3}
%package -n python3-%{srcname}
Summary:        Docutils backend for pybtex
Requires:       python3-docutils
Requires:       python3-pybtex
Requires:       python3-six

Provides:       bundled(jquery)
Provides:       bundled(js-underscore)
%{?python_provide:%python_provide python3-%{srcname}}

%description -n python3-%{srcname}

%setup -q -c

# Use the new sphinx default theme
sed -i "s/'default'/'alabaster'/" %{srcname}-%{version}/doc/

# Prepare for python3 build
cp -a %{srcname}-%{version} python3-%{srcname}-%{version}

# Fix doc building with python 3
sed -i 's/"rb"/"rt"/' python3-%{srcname}-%{version}/doc/

# Python 2 build
pushd %{srcname}-%{version}
PYTHONPATH=$PWD make -C doc html SPHINXBUILD=%{_bindir}/sphinx-build-%{python2_version}

%if 0%{?with_python3}
# Python 3 build
pushd python3-%{srcname}-%{version}
PYTHONPATH=$PWD make -C doc html SPHINXBUILD=%{_bindir}/sphinx-build-%{python3_version}

# Python 2 install
pushd %{srcname}-%{version}

%if 0%{?with_python3}
# Python 3 install
pushd python3-%{srcname}-%{version}

# Test the python 2 build
pushd %{srcname}-%{version}
PYTHONPATH=$PWD nosetests-%{python2_version} -v

%if 0%{?with_python3}
# Python 3 install
pushd python3-%{srcname}-%{version}
PYTHONPATH=$PWD nosetests-%{python3_version} -v

%files -n python2-%{srcname}
%doc %{srcname}-%{version}/doc/_build/html/*
%license %{srcname}-%{version}/LICENSE.rst

%if 0%{?with_python3}
%files -n python3-%{srcname}
%doc python3-%{srcname}-%{version}/doc/_build/html/*
%license python3-%{srcname}-%{version}/LICENSE.rst

* Mon Dec 19 2016 Miro HronĨok <> - 0.2.1-4
- Rebuild for Python 3.6

* Tue Jul 19 2016 Fedora Release Engineering <> - 0.2.1-3

* Wed Mar  2 2016 Jerry James <> - 0.2.1-2
- Expand package description
- Fix sphinx and noseutils invocations for python 3
- Do not convert license file to HTML

* Thu Feb 25 2016 Jerry James <> - 0.2.1-1
- Initial RPM