diff --git a/.gitignore b/.gitignore index 4723f7c..0abdad1 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,4 @@ /kitchen-1.0.0.tar.gz /kitchen-1.1.0.tar.gz /kitchen-1.1.1.tar.gz +/kitchen-1.2.1.tar.gz diff --git a/python-kitchen.spec b/python-kitchen.spec index 3d80a80..4f4f022 100644 --- a/python-kitchen.spec +++ b/python-kitchen.spec @@ -1,8 +1,17 @@ -%{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")} +%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 + + +%if 0%{?fedora} +%global with_python3 1 +%endif Name: python-kitchen -Version: 1.1.1 -Release: 7%{?dist} +Version: 1.2.1 +Release: 1%{?dist} Summary: Small, useful pieces of code to make python coding easier Group: Development/Languages @@ -16,24 +25,34 @@ 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 BuildRequires: python-sphinx %endif + %if 0%{?fedora} || 0%{?rhel} > 6 # At present, chardet isn't present in epel but it's a soft dep BuildRequires: python-chardet Requires: python-chardet %endif +%if 0%{?with_python3} +BuildRequires: python3-devel +BuildRequires: python3-nose +BuildRequires: python3-test +BuildRequires: python3-sphinx +BuildRequires: python3-chardet +%endif + %description 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), and compatibility modules for writing code that uses -python-2.7 modules but needs to run on python-2.3 +python-2.7 modules but needs to run on python-2.3. %package doc -Summary: API documentation for the Kitchen python module +Summary: API documentation for the Kitchen python2 module # Currently discussing guidelines about doc subpackages Requiring the main package: # https://lists.fedoraproject.org/pipermail/packaging/2013-June/009191.html #Requires: %{name} = %{version}-%{release} @@ -41,51 +60,133 @@ Summary: API documentation for the Kitchen python module 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), and compatibility modules for writing code that uses -python-2.7 modules but needs to run on python-2.3 +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. + +%if 0%{?with_python3} +%package -n python3-kitchen +Summary: Small, useful pieces of code to make python 3 coding easier +Group: Development/Languages + +Requires: python3 +Requires: python3-chardet + +%description -n python3-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 python3 version of the kitchen module. + +%package -n python3-kitchen-doc +Summary: API documentation for the Kitchen python3 module +#Requires: %{name} = %{version}-%{release} +%description -n python3-kitchen-doc +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 package contains the API documenation for programming with the -kitchen library. +python-3 version of the kitchen library. +%endif + %prep %setup -q -n kitchen-%{version} +# Remove bundled egg info, if any. +rm -rf *.egg* + +%if 0%{?with_python3} +rm -rf %{py3dir} +cp -a . %{py3dir} +%endif %build -%{__python} setup.py build +%{__python2} setup.py build + +%if 0%{?with_python3} +pushd %{py3dir} +%{__python3} setup.py build +popd +%endif + # Build docs %if 0%{?fedora} || 0%{?rhel} >= 6 -%{__python} setup.py build_sphinx + +sphinx-build kitchen2/docs/ build/sphinx/html cp -pr build/sphinx/html . rm -rf html/.buildinfo +%if 0%{?with_python3} +pushd %{py3dir} +sphinx-build-3 kitchen3/docs/ build/sphinx/html +cp -pr build/sphinx/html . +rm -rf html/.buildinfo +popd +%endif %endif %install rm -rf $RPM_BUILD_ROOT -%{__python} setup.py install --skip-build --root $RPM_BUILD_ROOT +%{__python2} setup.py install --skip-build --root $RPM_BUILD_ROOT + +%if 0%{?with_python3} +pushd %{py3dir} +%{__python3} setup.py install --skip-build --root $RPM_BUILD_ROOT +popd +%endif %check # In current mock, the PATH isn't being reset. This causes failures in some # 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 -nosetests - +PYTHONPATH=.:kitchen2/ nosetests kitchen2/tests/ + +%if 0%{?with_python3} +pushd %{py3dir} +PYTHONPATH=.:kitchen3/ nosetests-%{python3_version} kitchen3/tests/ +popd +%endif + %clean rm -rf $RPM_BUILD_ROOT %files %defattr(-,root,root,-) -%doc COPYING README NEWS COPYING.LESSER -%{python_sitelib}/* +%doc README.rst NEWS.rst COPYING COPYING.LESSER +%{python2_sitelib}/* %files doc -%doc COPYING COPYING.LESSER docs/* +%doc COPYING COPYING.LESSER kitchen2/docs/* %if 0%{?fedora} || 0%{?rhel} >= 6 %doc html %endif +%if 0%{?with_python3} +%files -n python3-kitchen +%defattr(-,root,root,-) +%doc README.rst NEWS.rst COPYING COPYING.LESSER +%{python3_sitelib}/* + +%files -n python3-kitchen-doc +%doc COPYING COPYING.LESSER kitchen3/docs/* +%if 0%{?fedora} || 0%{?rhel} >= 6 +%doc html +%endif +%endif + %changelog +* Tue Dec 02 2014 Ralph Bean - 1.2.1-1 +- Latest upstream, now with python3 support! +- Added python3 subpackages. +- Remove use of build_sphinx. +- Rename README and NEWS with new .rst extension. +- Modernized python2 macros. + * Sat Jun 07 2014 Fedora Release Engineering - 1.1.1-7 - Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild diff --git a/sources b/sources index 9788175..b7b43a6 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -059d7ce048ca1d0fb53e6755145137b0 kitchen-1.1.1.tar.gz +1baa961fda20e47895f5619bde51db20 kitchen-1.2.1.tar.gz