diff --git a/python-kitchen.spec b/python-kitchen.spec index 756d2aa..ca80dc3 100644 --- a/python-kitchen.spec +++ b/python-kitchen.spec @@ -4,10 +4,9 @@ %{!?python2_sitearch: %global python2_sitearch %(%{__python2} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))")} %endif +%global with_python3 1 %if 0%{?fedora} -# Move this out of the conditional to really support python34 on epel7. -%global with_python3 1 %{!?python3_pkgversion: %global python3_pkgversion 3} %else %{!?python3_pkgversion: %global python3_pkgversion 34} @@ -15,7 +14,7 @@ Name: python-kitchen Version: 1.2.4 -Release: 3%{?dist} +Release: 4%{?dist} Summary: Small, useful pieces of code to make python coding easier Group: Development/Languages @@ -29,13 +28,16 @@ Patch0: python-kitchen-codepoints-table.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildArch: noarch + BuildRequires: python2-devel BuildRequires: python-nose # For the subprocess test BuildRequires: python-test -%if 0%{?fedora} || 0%{?rhel} >= 6 # sphinx needs to be more recent to build the html docs +%if 0%{?fedora} +BuildRequires: python2-sphinx +%else BuildRequires: python-sphinx %endif @@ -75,10 +77,23 @@ python-2.7 modules but needs to run on python-2.3. This package contains the API documenation for programming with the python-2 version of the kitchen library. +%package -n python2-kitchen +Summary: Small, useful pieces of code to make python 2 coding easier +Group: Development/Languages +%{?python_provide:%python_provide python2-kitchen} + +%description -n python2-kitchen +kitchen includes functions to make gettext easier to use, handling unicode +text easier (conversion with bytes, outputting xml, and calculating how many +columns a string takes). + +This is the python2 version of the kitchen module. + %if 0%{?with_python3} %package -n python%{python3_pkgversion}-kitchen Summary: Small, useful pieces of code to make python 3 coding easier Group: Development/Languages +%{?python_provide:%python_provide python%{python3_pkgversion}-kitchen} Requires: python%{python3_pkgversion} Requires: python%{python3_pkgversion}-chardet @@ -117,19 +132,24 @@ cp -a . %{py3dir} %endif %build -%{__python2} setup.py build +%{py2_build} %if 0%{?with_python3} pushd %{py3dir} -%{__python3} setup.py build +%{py3_build} popd %endif # Build docs -%if 0%{?fedora} || 0%{?rhel} >= 6 +%if 0%{?fedora} +sphinx-build-2 kitchen2/docs/ build/sphinx/html +cp -pr build/sphinx/html . +rm -rf html/.buildinfo +%else sphinx-build kitchen2/docs/ build/sphinx/html cp -pr build/sphinx/html . rm -rf html/.buildinfo +%endif %if 0%{?with_python3} && 0%{?fedora} pushd %{py3dir} @@ -138,15 +158,13 @@ cp -pr build/sphinx/html . rm -rf html/.buildinfo popd %endif -%endif %install -rm -rf $RPM_BUILD_ROOT -%{__python2} setup.py install --skip-build --root $RPM_BUILD_ROOT +%{py2_install} %if 0%{?with_python3} pushd %{py3dir} -%{__python3} setup.py install --skip-build --root $RPM_BUILD_ROOT +%{py3_install} popd %endif @@ -155,7 +173,11 @@ popd # subprocess tests as a check tests /root/bin/PROGRAM and fails with Permission # Denied instead of File Not Found. reseting the PATH works around this. PATH=/bin:/usr/bin +%if 0%{?fedora} +PYTHONPATH=.:kitchen2/ nosetests-%{python2_version} kitchen2/tests/ +%else PYTHONPATH=.:kitchen2/ nosetests kitchen2/tests/ +%endif %if 0%{?with_python3} pushd %{py3dir} @@ -163,34 +185,38 @@ PYTHONPATH=.:kitchen3/ nosetests-%{python3_version} kitchen3/tests/ popd %endif -%clean -rm -rf $RPM_BUILD_ROOT - -%files -%defattr(-,root,root,-) -%doc README.rst NEWS.rst COPYING COPYING.LESSER -%{python2_sitelib}/* +%files -n python2-kitchen +%doc README.rst NEWS.rst +%license COPYING COPYING.LESSER +%{python2_sitelib}/kitchen* %files doc -%doc COPYING COPYING.LESSER kitchen2/docs/* +%doc kitchen2/docs/* +%license COPYING COPYING.LESSER %if 0%{?fedora} || 0%{?rhel} >= 6 %doc html %endif %if 0%{?with_python3} %files -n python%{python3_pkgversion}-kitchen -%defattr(-,root,root,-) -%doc README.rst NEWS.rst COPYING COPYING.LESSER -%{python3_sitelib}/* +%doc README.rst NEWS.rst +%license COPYING COPYING.LESSER +%{python3_sitelib}/kitchen* %files -n python%{python3_pkgversion}-kitchen-doc -%doc COPYING COPYING.LESSER kitchen3/docs/* +%doc kitchen3/docs/* +%license COPYING COPYING.LESSER %if 0%{?fedora} %doc html %endif %endif %changelog +* Mon Sep 12 2016 Ralph Bean - 1.2.4-4 +- Explicit python2 subpackage. +- Support python34 on epel7. +- Modernize python macros. + * Tue Jul 19 2016 Fedora Release Engineering - 1.2.4-3 - https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages @@ -201,7 +227,7 @@ rm -rf $RPM_BUILD_ROOT - new version - Apply patch fixing the unicode codepoints table for py3.5. -* Fri Nov 11 2015 Ralph Bean - 1.2.1-5 +* Wed Nov 11 2015 Ralph Bean - 1.2.1-5 - Support python34 on EPEL7. * Tue Nov 10 2015 Fedora Release Engineering - 1.2.1-4