84ef9a7
%if 0%{?rhel} && 0%{?rhel} <= 6
84ef9a7
%{!?__python2:        %global __python2 /usr/bin/python2}
84ef9a7
%{!?python2_sitelib:  %global python2_sitelib %(%{__python2} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")}
84ef9a7
%{!?python2_sitearch: %global python2_sitearch %(%{__python2} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))")}
84ef9a7
%endif
84ef9a7
84ef9a7
84ef9a7
%if 0%{?fedora}
7b16d49
# Move this out of the conditional to really support python34 on epel7.
84ef9a7
%global with_python3 1
7b16d49
%{!?python3_pkgversion: %global python3_pkgversion 3}
7b16d49
%else
7b16d49
%{!?python3_pkgversion: %global python3_pkgversion 34}
84ef9a7
%endif
3d528eb
3d528eb
Name:           python-kitchen
84ef9a7
Version:        1.2.1
ac1f5e3
Release:        5%{?dist}
3d528eb
Summary:        Small, useful pieces of code to make python coding easier
3d528eb
3d528eb
Group:          Development/Languages
3d528eb
License:        LGPLv2+
d0a4490
URL:            https://pypi.python.org/pypi/kitchen/
ba0f0c6
Source0:        https://pypi.python.org/packages/source/k/kitchen/kitchen-%{version}.tar.gz
59ce39b
59ce39b
# http://git.io/8KLw1Q
59ce39b
Patch0:         python-kitchen-expose-base64-py34.patch
59ce39b
3d528eb
BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
3d528eb
3d528eb
BuildArch:      noarch
3d528eb
BuildRequires:  python2-devel
3d528eb
BuildRequires:  python-nose
79d554a
# For the subprocess test
79d554a
BuildRequires:  python-test
84ef9a7
d0a4490
%if 0%{?fedora} || 0%{?rhel} >=  6
d0a4490
# sphinx needs to be more recent to build the html docs
d0a4490
BuildRequires: python-sphinx
d0a4490
%endif
84ef9a7
d0a4490
%if 0%{?fedora} || 0%{?rhel} >  6
d0a4490
# At present, chardet isn't present in epel but it's a soft dep
3d528eb
BuildRequires: python-chardet
3d528eb
Requires: python-chardet
3d528eb
%endif
3d528eb
84ef9a7
%if 0%{?with_python3}
7b16d49
BuildRequires:  python%{python3_pkgversion}-devel
7b16d49
BuildRequires:  python%{python3_pkgversion}-nose
7b16d49
BuildRequires:  python%{python3_pkgversion}-test
7b16d49
BuildRequires:  python%{python3_pkgversion}-chardet
7b16d49
%if 0%{?fedora}
7b16d49
BuildRequires:  python%{python3_pkgversion}-sphinx
7b16d49
%endif
84ef9a7
%endif
84ef9a7
3d528eb
%description
3d528eb
kitchen includes functions to make gettext easier to use, handling unicode
3d528eb
text easier (conversion with bytes, outputting xml, and calculating how many
3d528eb
columns a string takes), and compatibility modules for writing code that uses
84ef9a7
python-2.7 modules but needs to run on python-2.3.
3d528eb
79d554a
%package doc
84ef9a7
Summary:        API documentation for the Kitchen python2 module
79d554a
# Currently discussing guidelines about doc subpackages Requiring the main package:
79d554a
# https://lists.fedoraproject.org/pipermail/packaging/2013-June/009191.html
79d554a
#Requires: %{name} = %{version}-%{release}
79d554a
%description doc
79d554a
kitchen includes functions to make gettext easier to use, handling unicode
79d554a
text easier (conversion with bytes, outputting xml, and calculating how many
79d554a
columns a string takes), and compatibility modules for writing code that uses
84ef9a7
python-2.7 modules but needs to run on python-2.3.
84ef9a7
84ef9a7
This package contains the API documenation for programming with the
84ef9a7
python-2 version of the kitchen library.
84ef9a7
84ef9a7
%if 0%{?with_python3}
7b16d49
%package -n python%{python3_pkgversion}-kitchen
84ef9a7
Summary:    Small, useful pieces of code to make python 3 coding easier
84ef9a7
Group:      Development/Languages
84ef9a7
7b16d49
Requires:   python%{python3_pkgversion}
7b16d49
Requires:   python%{python3_pkgversion}-chardet
84ef9a7
7b16d49
%description -n python%{python3_pkgversion}-kitchen
84ef9a7
kitchen includes functions to make gettext easier to use, handling unicode
84ef9a7
text easier (conversion with bytes, outputting xml, and calculating how many
84ef9a7
columns a string takes).
84ef9a7
84ef9a7
This is the python3 version of the kitchen module.
84ef9a7
7b16d49
%package -n python%{python3_pkgversion}-kitchen-doc
84ef9a7
Summary:    API documentation for the Kitchen python3 module
84ef9a7
#Requires: %{name} = %{version}-%{release}
7b16d49
%description -n python%{python3_pkgversion}-kitchen-doc
84ef9a7
kitchen includes functions to make gettext easier to use, handling unicode
84ef9a7
text easier (conversion with bytes, outputting xml, and calculating how many
84ef9a7
columns a string takes).
79d554a
79d554a
This package contains the API documenation for programming with the
84ef9a7
python-3 version of the kitchen library.
84ef9a7
%endif
84ef9a7
79d554a
3d528eb
%prep
d0a4490
%setup -q -n kitchen-%{version}
3d528eb
59ce39b
%patch0 -p1
59ce39b
84ef9a7
# Remove bundled egg info, if any.
84ef9a7
rm -rf *.egg*
84ef9a7
84ef9a7
%if 0%{?with_python3}
84ef9a7
rm -rf %{py3dir}
84ef9a7
cp -a . %{py3dir}
84ef9a7
%endif
3d528eb
3d528eb
%build
84ef9a7
%{__python2} setup.py build
84ef9a7
84ef9a7
%if 0%{?with_python3}
84ef9a7
pushd %{py3dir}
84ef9a7
%{__python3} setup.py build
84ef9a7
popd
84ef9a7
%endif
84ef9a7
d0a4490
# Build docs
d0a4490
%if 0%{?fedora} || 0%{?rhel} >= 6
84ef9a7
sphinx-build kitchen2/docs/ build/sphinx/html
d0a4490
cp -pr build/sphinx/html .
532ff47
rm -rf html/.buildinfo
532ff47
7b16d49
%if 0%{?with_python3} && 0%{?fedora}
84ef9a7
pushd %{py3dir}
84ef9a7
sphinx-build-3 kitchen3/docs/ build/sphinx/html
84ef9a7
cp -pr build/sphinx/html .
84ef9a7
rm -rf html/.buildinfo
84ef9a7
popd
84ef9a7
%endif
d0a4490
%endif
3d528eb
3d528eb
%install
3d528eb
rm -rf $RPM_BUILD_ROOT
84ef9a7
%{__python2} setup.py install --skip-build --root $RPM_BUILD_ROOT
84ef9a7
84ef9a7
%if 0%{?with_python3}
84ef9a7
pushd %{py3dir}
84ef9a7
%{__python3} setup.py install --skip-build --root $RPM_BUILD_ROOT
84ef9a7
popd
84ef9a7
%endif
3d528eb
3d528eb
%check
3d528eb
# In current mock, the PATH isn't being reset.  This causes failures in some
3d528eb
# subprocess tests as a check tests /root/bin/PROGRAM and fails with Permission
3d528eb
# Denied instead of File Not Found.  reseting the PATH works around this.
3d528eb
PATH=/bin:/usr/bin
84ef9a7
PYTHONPATH=.:kitchen2/ nosetests kitchen2/tests/
84ef9a7
84ef9a7
%if 0%{?with_python3}
84ef9a7
pushd %{py3dir}
84ef9a7
PYTHONPATH=.:kitchen3/ nosetests-%{python3_version} kitchen3/tests/
84ef9a7
popd
84ef9a7
%endif
84ef9a7
3d528eb
%clean
3d528eb
rm -rf $RPM_BUILD_ROOT
3d528eb
3d528eb
%files
3d528eb
%defattr(-,root,root,-)
84ef9a7
%doc README.rst NEWS.rst COPYING COPYING.LESSER
84ef9a7
%{python2_sitelib}/*
3d528eb
79d554a
%files doc
84ef9a7
%doc COPYING COPYING.LESSER kitchen2/docs/*
f820c8b
%if 0%{?fedora} || 0%{?rhel} >= 6
f820c8b
%doc html
f820c8b
%endif
3d528eb
84ef9a7
%if 0%{?with_python3}
7b16d49
%files -n python%{python3_pkgversion}-kitchen
84ef9a7
%defattr(-,root,root,-)
84ef9a7
%doc README.rst NEWS.rst COPYING COPYING.LESSER
84ef9a7
%{python3_sitelib}/*
84ef9a7
7b16d49
%files -n python%{python3_pkgversion}-kitchen-doc
84ef9a7
%doc COPYING COPYING.LESSER kitchen3/docs/*
7b16d49
%if 0%{?fedora}
84ef9a7
%doc html
84ef9a7
%endif
84ef9a7
%endif
84ef9a7
3d528eb
%changelog
ac1f5e3
* Mon Jun 29 2015 Ralph Bean <rbean@redhat.com> - 1.2.1-5
7b16d49
- Support python34 on EPEL7.
7b16d49
7f2e790
* Tue Nov 10 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.2.1-4
7f2e790
- Rebuilt for https://fedoraproject.org/wiki/Changes/python3.5
7f2e790
0584361
* Thu Jun 18 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.2.1-3
0584361
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
0584361
59ce39b
* Tue Dec 02 2014 Ralph Bean <rbean@redhat.com> - 1.2.1-2
59ce39b
- Include patch to get py34 tests working for rawhide.
59ce39b
84ef9a7
* Tue Dec 02 2014 Ralph Bean <rbean@redhat.com> - 1.2.1-1
84ef9a7
- Latest upstream, now with python3 support!
84ef9a7
- Added python3 subpackages.
84ef9a7
- Remove use of build_sphinx.
84ef9a7
- Rename README and NEWS with new .rst extension.
84ef9a7
- Modernized python2 macros.
84ef9a7
2e57794
* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.1.1-7
2e57794
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
2e57794
f820c8b
* Sat May 31 2014 Peter Robinson <pbrobinson@fedoraproject.org> 1.1.1-6
f820c8b
- Move the html docs to the docs package
f820c8b
2fd8407
* Sun Aug 04 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.1.1-5
2fd8407
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
2fd8407
79d554a
* Tue Jun 25 2013 Toshio Kuratomi <toshio@fedoraproject.org> - 1.1.1-4
79d554a
- Move the api documentation into its own subpackage
79d554a
97df64a
* Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.1.1-3
97df64a
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
97df64a
e371b53
* Sat Jul 21 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.1.1-2
e371b53
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
e371b53
0f0248f
* Tue Feb 14 2012 Toshio Kuratomi <toshio@fedoraproject.org> - 1.1.1-1
0f0248f
- Bugfix for using easy_gettext_setup or get_translation_object with the
0f0248f
  default localedirs
0f0248f
3537375
* Thu Jan 12 2012 Toshio Kuratomi <toshio@fedoraproject.org> - 1.1.0-1
3537375
- Update to 1.1.0 final
3537375
532ff47
* Thu Apr 14 2011 Toshio Kuratomi <toshio@fedoraproject.org> - 1.0.0-1
532ff47
- Upstream update to 1.0 final
532ff47
2ef50ea
* Sun Feb 20 2011 Toshio Kuratomi <toshio@fedoraproject.org> - 0.2.4-1
2ef50ea
- Upstream update 0.2.4
2ef50ea
  - Changes i18n.easy_gettext_setup() to return lgettext functions when
2ef50ea
    byte strings are requested.
2ef50ea
cf85fcd
* Tue Feb 08 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.2.3-3
cf85fcd
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
cf85fcd
05107df
* Wed Jan 5 2011 Toshio Kuratomi <toshio@fedoraproject.org> - 0.2.3-2
05107df
- Upstream respin of the tarball
05107df
05107df
* Wed Jan 5 2011 Toshio Kuratomi <toshio@fedoraproject.org> - 0.2.3-1
105630c
- Upstream update to 0.2.3
105630c
- Fixes https://bugzilla.redhat.com/show_bug.cgi?id=667433
105630c
d0a4490
* Mon Jan 3 2011 Toshio Kuratomi <toshio@fedoraproject.org> - 0.2.2-1
d0a4490
- Upstream update 0.2.2
d0a4490
  - Adds exception to message functions
d0a4490
- Build html docs
d0a4490
b46f1e9
* Thu Sep 2 2010 Toshio Kuratomi <toshio@fedoraproject.org> - 0.2.1-0.1.a1
b46f1e9
- Update to upstream 0.2.1a1 release.
b46f1e9
- Fixes build on python-2.7, adds iterutils module, optimizes some functions,
b46f1e9
  increases documentation
b46f1e9
3d528eb
* Thu Jul 29 2010 Dennis Gilmore <dennis@ausil.us> - 0.2-0.1.a2
3d528eb
- propoerlly version accrding to pre-release guidelines
3d528eb
- run tests
3d528eb
- update to 0.2a2
3d528eb
- include COPYING.LESSER and docs dir
3d528eb
3d528eb
* Thu Jul 29 2010 Dennis Gilmore <dennis@ausil.us> - 0.2a1-2
3d528eb
- rename to python-kitchen
3d528eb
3d528eb
* Thu Jul 29 2010 Dennis Gilmore <dennis@ausil.us> - 0.2a1-1
3d528eb
- update to 0.2a1
3d528eb
3d528eb
* Thu Jul 15 2010 Dennis Gilmore <dennis@ausil.us> - 0.1a3-3
3d528eb
- fix spelling mistake in description
3d528eb
3d528eb
* Thu Jul 15 2010 Dennis Gilmore <dennis@ausil.us> - 0.1a3-2
3d528eb
- add documentaion
3d528eb
- fix description
3d528eb
3d528eb
* Thu Jul 15 2010 Dennis Gilmore <dennis@ausil.us> - 0.1a3-1
3d528eb
- initial package