diff --git a/python-yourls.spec b/python-yourls.spec index 632f50b..701c964 100644 --- a/python-yourls.spec +++ b/python-yourls.spec @@ -1,8 +1,8 @@ -%{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")} +%define srcname yourls -Name: python-yourls +Name: python-%{srcname} Version: 0.2.0 -Release: 11%{?dist} +Release: 12%{?dist} Summary: Simple Python client for the YOURLS URL shortener License: GPLv2+ @@ -10,47 +10,75 @@ URL: http://tflink.github.com/python-yourls/ Source0: https://github.com/downloads/tflink/python-yourls/%{name}-%{version}.tar.gz BuildArch: noarch -BuildRequires: python-devel -# This only exists in F16 and newer -BuildRequires: pytest -%global _description\ -Simple Python client for the YOURLS URL shortener +# Required for building the documentation +BuildRequires: python3-sphinx -%description %_description +%description +python-yourls is a simple python based API client for the YOURLS URL shortener -%package -n python2-yourls -Summary: %summary -%{?python_provide:%python_provide python2-yourls} +%package -n python2-%{srcname} +Summary: Simple Python client for the YOURLS URL shortener + +BuildRequires: python2-devel +BuildRequires: python2-pytest + +%{?python_provide:%python_provide python2-%{srcname}} + +%description -n python2-%{srcname} +python-yourls is a simple python based API client for the YOURLS URL shortener + +This is the Python 2 version of the module. + +%package -n python3-%{srcname} +Summary: Simple Python client for the YOURLS URL shortener -%description -n python2-yourls %_description +BuildRequires: python3-devel +BuildRequires: python3-pytest + +%{?python_provide:%python_provide python3-%{srcname}} + +%description -n python3-%{srcname} +python-yourls is a simple python based API client for the YOURLS URL shortener + +This is the Python 3 version of the module. %prep %setup -q -# the dependency needed to run the tests is only included in F16 and newer -# python-pytest > 2.0 -%check -%{__python} setup.py test - %build -%{__python} setup.py build +%py2_build +%py3_build +# Build the documentation +pushd doc +make html +# Remove sphinx leftovers +rm -rf _build/html/.{doctrees,buildinfo} +popd %install -rm -rf %{buildroot} -%{__python} setup.py install -O1 --skip-build --root %{buildroot} +%py2_install +%py3_install -%clean -%{__rm} -rf %{buildroot} +%check +%{__python2} setup.py test +%{__python3} setup.py test -%files -n python2-yourls -%defattr(-,root,root,-) -%doc LICENSE README -%{python_sitelib}/* +%files -n python2-%{srcname} +%license LICENSE +%doc README doc/_build/html/ +%{python2_sitelib}/* +%files -n python3-%{srcname} +%license LICENSE +%doc README doc/_build/html/ +%{python3_sitelib}/* %changelog +* Mon Nov 20 2017 Charalampos Stratakis - 0.2.0-12 +- Provide a Python 3 subpackage + * Sat Aug 19 2017 Zbigniew Jędrzejewski-Szmek - 0.2.0-11 - Python 2 binary package renamed to python2-yourls See https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3