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

%if 0%{?rhel} && 0%{?rhel} <= 6
%{!?__python2:        %global __python2 /usr/bin/python2}
%{!?python2_sitelib:  %global python2_sitelib %(%{__python2} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")}
%{!?python2_sitearch: %global python2_sitearch %(%{__python2} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))")}
%endif

%global pkgname manuel

Name:           python-%{pkgname}
Version:        1.8.0
Release:        3%{?dist}
Summary:        Build tested documentation

License:        ASL 2.0
URL:            https://pypi.python.org/pypi/manuel
Source0:        https://pypi.python.org/packages/source/m/%{pkgname}/%{pkgname}-%{version}.tar.gz

BuildArch:      noarch
BuildRequires:  python-setuptools
BuildRequires:  python-sphinx
BuildRequires:  python-six
BuildRequires:  python-zope-testing
BuildRequires:  python2-devel

%if 0%{?with_python3}
BuildRequires:  python3-setuptools
BuildRequires:  python3-sphinx
BuildRequires:  python3-six
BuildRequires:  python3-zope-testing
BuildRequires:  python3-devel
%endif

Requires:       python-six
Provides:       bundled(jquery)

%description
Manuel lets you mix and match traditional doctests with custom test
syntax.  Several plug-ins are included that provide new test syntax.
You can also create your own plug-ins.


%if 0%{?with_python3}
%package -n python3-manuel
Summary:        Build tested documentation
Requires:       python3-six
Provides:       bundled(jquery)

%description -n python3-manuel
Manuel lets you mix and match traditional doctests with custom test
syntax.  Several plug-ins are included that provide new test syntax.
You can also create your own plug-ins.
%endif

%prep
%setup -q -c

# Remove prebuilt egg
rm -fr %{pkgname}-%{version}/src/%{pkgname}.egg-info

%if 0%{?with_python3}
# Prepare for a python3 build
cp -a %{pkgname}-%{version} python3-%{pkgname}-%{version}
%endif

%build
# Python 2 build
pushd %{pkgname}-%{version}
%{__python2} setup.py build
sphinx-build -c sphinx src/manuel docs
rm -fr docs/.buildinfo docs/.doctrees
popd

%if 0%{?with_python3}
# Python 3 build
pushd python3-%{pkgname}-%{version}
%{__python3} setup.py build
sphinx-build-3 -c sphinx src/manuel docs
rm -fr docs/.buildinfo docs/.doctrees
popd
%endif

%install
# Python 2 install
pushd %{pkgname}-%{version}
%{__python2} setup.py install -O1 --skip-build --root %{buildroot}
popd

%if 0%{?with_python3}
# Python 3 install
pushd python3-%{pkgname}-%{version}
%{__python3} setup.py install -O1 --skip-build --root %{buildroot}
popd
%endif

%check
# Python 2 tests
pushd %{pkgname}-%{version}
%{__python2} setup.py test
popd

%if 0%{?with_python3}
# Python 3 tests
pushd python3-%{pkgname}-%{version}
%{__python3} setup.py test
popd
%endif

%files
%doc %{pkgname}-%{version}/docs
%license %{pkgname}-%{version}/LICENSE.rst
%{python2_sitelib}/manuel/
%{python2_sitelib}/manuel-%{version}-*

%if 0%{?with_python3}
%files -n python3-manuel
%doc python3-%{pkgname}-%{version}/docs
%license python3-%{pkgname}-%{version}/LICENSE.rst
%{python3_sitelib}/manuel/
%{python3_sitelib}/manuel-%{version}-*
%endif

%changelog
* Thu Jun 18 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.8.0-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild

* Sat Feb 21 2015 Jerry James <loganjerry@gmail.com> - 1.8.0-2
- Note bundled jquery

* Wed Jul 23 2014 Jerry James <loganjerry@gmail.com> - 1.8.0-1
- New upstream release
- Drop upstreamed patch
- Drop conf.py, now included in upstream source
- Avoid use of py3dir, which is not cleaned

* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.7.2-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild

* Wed May 14 2014 Bohuslav Kabrda <bkabrda@redhat.com> - 1.7.2-5
- Rebuilt for https://fedoraproject.org/wiki/Changes/Python_3.4

* Fri Jan 24 2014 Ralph Bean <rbean@redhat.com> - 1.7.2-4
- Conditionalized python3 for epel builds.
- Defined python2 macros for el6.
- Added python3 tests to the check section.

* Thu Oct  3 2013 Jerry James <loganjerry@gmail.com> - 1.7.2-3
- Update project and source URLs

* Sun Aug 04 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.7.2-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild

* Mon Mar 18 2013 Jerry James <loganjerry@gmail.com> - 1.7.2-1
- New upstream release

* Wed Feb 27 2013 Jerry James <loganjerry@gmail.com> - 1.7.1-2
- Add python-six Requires (bz 915431)

* Tue Feb 19 2013 Jerry James <loganjerry@gmail.com> - 1.7.1-1
- New upstream release

* Mon Jan 28 2013 Jerry James <loganjerry@gmail.com> - 1.6.1-1
- New upstream release

* Fri Aug 10 2012 Jerry James <loganjerry@gmail.com> - 1.6.0-3
- Rebuild for python 3.3

* Sat Jul 21 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.6.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild

* Mon Apr 23 2012 Jerry James <loganjerry@gmail.com> - 1.6.0-1
- New upstream release
- Python3 subpackage now possible

* Tue Jan 10 2012 Jerry James <loganjerry@gmail.com> - 1.5.0-4
- Rebuild for bz 772699

* Sun Jan  8 2012 Jerry James <loganjerry@gmail.com> - 1.5.0-3
- Mass rebuild for Fedora 17

* Wed Apr 27 2011 Jerry James <loganjerry@gmail.com> - 1.5.0-2
- Do not Require python-zope-testing
- Change Group to Development/Libraries
- Remove text files from python_sitelib; they are already in docs

* Tue Apr 26 2011 Jerry James <loganjerry@gmail.com> - 1.5.0-1
- Initial RPM