Blame python-sphinxcontrib-bibtex.spec

d046a07
%if 0%{?fedora} || 0%{?rhel} >= 8
d046a07
%global with_python3 1
d046a07
%endif
d046a07
d046a07
%global srcname sphinxcontrib-bibtex
d046a07
d046a07
Name:           python-%{srcname}
d369d45
Version:        0.3.5
d046a07
Release:        1%{?dist}
d046a07
Summary:        Sphinx extension for BibTeX style citations
d046a07
d046a07
License:        BSD
d046a07
URL:            https://github.com/mcmtroffaes/sphinxcontrib-bibtex
e82ea3f
Source0:        https://github.com/mcmtroffaes/%{srcname}/archive/%{version}.tar.gz
d046a07
BuildArch:      noarch
d046a07
# Use orderedset instead of oset; the latter has a dead upstream
d046a07
Patch0:         %{name}-orderedset.patch
d046a07
d046a07
BuildRequires:  python2-coverage
d046a07
BuildRequires:  python2-devel
d046a07
BuildRequires:  python2-latexcodec
d046a07
BuildRequires:  python2-nose
d046a07
BuildRequires:  python2-orderedset
d046a07
BuildRequires:  python2-pybtex
d046a07
BuildRequires:  python2-pybtex-docutils
d046a07
BuildRequires:  python2-setuptools
d046a07
BuildRequires:  python2-six
d046a07
BuildRequires:  python2-sphinx
d046a07
BuildRequires:  python2-sphinx-testing
d046a07
d046a07
%if 0%{?with_python3}
d046a07
BuildRequires:  python3-coverage
d046a07
BuildRequires:  python3-devel
d046a07
BuildRequires:  python3-latexcodec
d046a07
BuildRequires:  python3-nose
d046a07
BuildRequires:  python3-orderedset
d046a07
BuildRequires:  python3-pybtex
d046a07
BuildRequires:  python3-pybtex-docutils
d046a07
BuildRequires:  python3-setuptools
d046a07
BuildRequires:  python3-six
d046a07
BuildRequires:  python3-sphinx
d046a07
BuildRequires:  python3-sphinx-testing
d046a07
%endif
d046a07
d046a07
%global common_desc \
d046a07
This package contains a Sphinx extension for BibTeX style citations.\
d046a07
\
d046a07
This extension allows BibTeX citations to be inserted into documentation\
d046a07
generated by Sphinx, via a bibliography directive, and a cite role,\
d046a07
which work similarly to LaTeX's thebibliography environment and \\cite\
d046a07
command.\
d046a07
\
d046a07
For formatting, the extension relies on pybtex, written by Andrey\
d046a07
Golovizin.
d046a07
d046a07
%description
d046a07
%common_desc
d046a07
d046a07
%package -n python2-%{srcname}
d046a07
Summary:        Sphinx extension for BibTeX style citations
d046a07
Requires:       python2-latexcodec
d046a07
Requires:       python2-orderedset
d046a07
Requires:       python2-pybtex
d046a07
Requires:       python2-pybtex-docutils
d046a07
Requires:       python2-six
d046a07
d046a07
Provides:       bundled(jquery)
d046a07
Provides:       bundled(js-underscore)
d046a07
%{?python_provide:%python_provide python2-%{srcname}}
d046a07
d046a07
%description -n python2-%{srcname}
d046a07
%common_desc
d046a07
d046a07
%if 0%{?with_python3}
d046a07
%package -n python3-%{srcname}
d046a07
Summary:        Sphinx extension for BibTeX style citations
d046a07
Requires:       python3-latexcodec
d046a07
Requires:       python3-orderedset
d046a07
Requires:       python3-pybtex
d046a07
Requires:       python3-pybtex-docutils
d046a07
Requires:       python3-six
d046a07
d046a07
Provides:       bundled(jquery)
d046a07
Provides:       bundled(js-underscore)
d046a07
%{?python_provide:%python_provide python3-%{srcname}}
d046a07
d046a07
%description -n python3-%{srcname}
d046a07
%common_desc
d046a07
%endif
d046a07
d046a07
%package doc
d046a07
Summary:        Documentation for python-%{srcname}
d046a07
53db7c3
%description doc
d046a07
Documentation for python-%{srcname}.
d046a07
d046a07
%prep
d046a07
%setup -q -c
d046a07
pushd %{srcname}-%{version}
d046a07
%patch0
d046a07
popd
d046a07
d046a07
# Don't run the tinkerer integration test since Fedora doesn't have tinkerer
d046a07
rm -fr %{srcname}-%{version}/test/{test_issue1.py,issue1}
d046a07
d369d45
# Fix a typo in one test
d369d45
sed -i 's/?}/?/' %{srcname}-%{version}/test/test_latex_refs.py
d369d45
d046a07
# Prepare for python3 build
d046a07
cp -a %{srcname}-%{version} python3-%{srcname}-%{version}
d046a07
d046a07
%build
d046a07
# Python 2 build
d046a07
pushd %{srcname}-%{version}
d046a07
%py2_build
d046a07
popd
d046a07
d046a07
%if 0%{?with_python3}
d046a07
# Python 3 build
d046a07
pushd python3-%{srcname}-%{version}
d046a07
%py3_build
d046a07
popd
d046a07
%endif
d046a07
d046a07
# Build documentation
d046a07
%if 0%{?with_python3}
d046a07
pushd python3-%{srcname}-%{version}
d046a07
PYTHONPATH=$PWD sphinx-build-%{python3_version} doc html
d046a07
%else
d046a07
pushd %{srcname}-%{version}
d369d45
PYTHONPATH=$PWD sphinx-build-%{python2_version} doc html
d046a07
%endif
d046a07
rm -fr html/{.buildinfo,.doctrees}
d046a07
popd
d046a07
d046a07
%install
d046a07
# Python 2 install
d046a07
pushd %{srcname}-%{version}
d046a07
%py2_install
d046a07
popd
d046a07
d046a07
%if 0%{?with_python3}
d046a07
# Python 3 install
d046a07
pushd python3-%{srcname}-%{version}
d046a07
%py3_install
d046a07
popd
d046a07
%endif
d046a07
d046a07
%check
d046a07
# Test the python 2 build
d046a07
pushd %{srcname}-%{version}
d046a07
PYTHONPATH=$PWD nosetests-%{python2_version} -v
d046a07
popd
d046a07
d046a07
%if 0%{?with_python3}
d046a07
# Test the python 3 build
d046a07
export LANG=en_US.UTF-8
d046a07
pushd python3-%{srcname}-%{version}
d046a07
PYTHONPATH=$PWD nosetests-%{python3_version} -v
d046a07
popd
d046a07
%endif
d046a07
d046a07
%files -n python2-%{srcname}
d046a07
%license %{srcname}-%{version}/LICENSE.rst
d046a07
%{python2_sitelib}/sphinxcontrib/
d046a07
%{python2_sitelib}/sphinxcontrib_bibtex*
d046a07
d046a07
%if 0%{?with_python3}
d046a07
%files -n python3-%{srcname}
d046a07
%license python3-%{srcname}-%{version}/LICENSE.rst
d046a07
%{python3_sitelib}/sphinxcontrib/
d046a07
%{python3_sitelib}/sphinxcontrib_bibtex*
d046a07
%endif
d046a07
d046a07
%files doc
d046a07
%if 0%{?with_python3}
d046a07
%doc python3-%{srcname}-%{version}/html/*
d046a07
%else
d046a07
%doc %{srcname}-%{version}/html/*
d046a07
%endif
d046a07
d046a07
%changelog
d369d45
* Wed Feb 22 2017 Jerry James <loganjerry@gmail.com> - 0.3.5-1
d369d45
- New upstream version
d369d45
e82ea3f
* Mon May 23 2016 Jerry James <loganjerry@gmail.com> - 0.3.4-1
e82ea3f
- New upstream version
e82ea3f
d046a07
* Thu Feb 25 2016 Jerry James <loganjerry@gmail.com> - 0.3.3-1
d046a07
- Initial RPM