diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..08588f8 --- /dev/null +++ b/.gitignore @@ -0,0 +1,5 @@ +/tw2.core-2.0.5.tar.gz +/tw2.core-2.1.5.tar.gz +/tw2.core-2.2.1.1.tar.gz +/tw2.core-2.2.2.tar.gz +/tw2.core-2.2.3.tar.gz diff --git a/dead.package b/dead.package deleted file mode 100644 index cf09f0d..0000000 --- a/dead.package +++ /dev/null @@ -1 +0,0 @@ -python-tw2-core fails to build from source: https://bugzilla.redhat.com/show_bug.cgi?id=1675798 diff --git a/python-tw2-core-escape_silent-is-too-new.patch b/python-tw2-core-escape_silent-is-too-new.patch new file mode 100644 index 0000000..117beba --- /dev/null +++ b/python-tw2-core-escape_silent-is-too-new.patch @@ -0,0 +1,27 @@ +From 97ca3f2ee6e9232391df38b51ec0f77381314c55 Mon Sep 17 00:00:00 2001 +From: Ralph Bean +Date: Thu, 28 Feb 2013 13:39:58 -0500 +Subject: [PATCH] escape_silent is too new + +--- + tw2/core/templating.py | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/tw2/core/templating.py b/tw2/core/templating.py +index d0e962e..ed15963 100644 +--- a/tw2/core/templating.py ++++ b/tw2/core/templating.py +@@ -131,8 +131,8 @@ def get_render_callable(engine_name, displays_on, src, filename=None, inline=Fal + + if engine_name == 'mako': + import mako.template +- args = dict(text=src, imports=["from markupsafe import escape_silent"], +- default_filters=['escape_silent']) ++ args = dict(text=src, imports=["from markupsafe import escape"], ++ default_filters=['escape']) + + if directory: + args['filename'] = relpath(filename, directory) +-- +1.8.1.2 + diff --git a/python-tw2-core-mako-unicode.patch b/python-tw2-core-mako-unicode.patch new file mode 100644 index 0000000..921532c --- /dev/null +++ b/python-tw2-core-mako-unicode.patch @@ -0,0 +1,28 @@ +From ecc33fc211b904c5aa0c88647245d37fe8cd7338 Mon Sep 17 00:00:00 2001 +From: Ralph Bean +Date: Fri, 16 Oct 2015 16:03:55 -0400 +Subject: [PATCH] Use mako's render_unicode method. + +This avoids tw2 playing a role in unnecessarily coercing strings to from +unicode to bytestrings and back again. We can just keep things unicode +until the very last moment. +--- + tw2/core/templating.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/tw2/core/templating.py b/tw2/core/templating.py +index f71a2a3..f6e9c6f 100644 +--- a/tw2/core/templating.py ++++ b/tw2/core/templating.py +@@ -146,7 +146,7 @@ def get_render_callable(engine_name, displays_on, src, filename=None, inline=Fal + directories=[directory]) + + tmpl = mako.template.Template(**args) +- return lambda kwargs: Markup(tmpl.render(**kwargs)) ++ return lambda kwargs: Markup(tmpl.render_unicode(**kwargs)) + + elif engine_name in ('genshi', 'genshi_abs'): + import genshi.template +-- +2.4.3 + diff --git a/python-tw2-core.spec b/python-tw2-core.spec new file mode 100644 index 0000000..474e29b --- /dev/null +++ b/python-tw2-core.spec @@ -0,0 +1,348 @@ +%if 0%{?rhel} && 0%{?rhel} <= 7 +%global with_python3 0 +%else +%global with_python3 1 +%endif + +%global modname tw2.core + +Name: python-tw2-core +Version: 2.2.3 +Release: 15%{?dist} +Summary: Web widget creation toolkit based on TurboGears widgets + +License: MIT +URL: http://toscawidgets.org +Source0: http://pypi.python.org/packages/source/t/%{modname}/%{modname}-%{version}.tar.gz + +# python-markupsafe is too old in rhel6. +Patch0: python-tw2-core-escape_silent-is-too-new.patch + +# fix unicode issues https://github.com/toscawidgets/tw2.core/pull/117 +Patch1: python-tw2-core-mako-unicode.patch + +BuildArch: noarch + +# For building, generally +BuildRequires: python2-devel +BuildRequires: python2-setuptools +%if 0%{?rhel} && 0%{?rhel} <= 6 +BuildRequires: python-webob1.0 >= 0.9.7 +%else +BuildRequires: python2-webob >= 0.9.7 +%endif +BuildRequires: python2-simplejson >= 2.0 +BuildRequires: python2-decorator +BuildRequires: python2-markupsafe +BuildRequires: python2-speaklater +BuildRequires: python2-paste-deploy +BuildRequires: python2-six +BuildRequires: python2-nine + +# Specifically for the test suite +BuildRequires: python2-unittest2 +BuildRequires: python2-nose +BuildRequires: python2-coverage +BuildRequires: python2-formencode +BuildRequires: python2-webtest +BuildRequires: python2-sieve + +# Templating languages for the test suite +BuildRequires: python2-mako +BuildRequires: python2-genshi +BuildRequires: python2-chameleon +BuildRequires: python2-kajiki +BuildRequires: python2-jinja2 + +%if 0%{?with_python3} +# General +BuildRequires: python3-devel +BuildRequires: python3-setuptools +BuildRequires: python3-webob >= 0.9.7 +BuildRequires: python3-simplejson >= 2.0 +BuildRequires: python3-decorator +BuildRequires: python3-markupsafe +BuildRequires: python3-speaklater +BuildRequires: python3-paste-deploy +BuildRequires: python3-six +BuildRequires: python3-nine + +# Specifically for the test suite +BuildRequires: python3-unittest2 +BuildRequires: python3-nose +BuildRequires: python3-coverage +BuildRequires: python3-formencode +BuildRequires: python3-webtest +BuildRequires: python3-sieve + +# Templating languages for the test suite +BuildRequires: python3-mako +BuildRequires: python3-genshi +BuildRequires: python3-chameleon +BuildRequires: python3-kajiki +BuildRequires: python3-jinja2 +%endif + +%if 0%{?rhel} && 0%{?rhel} <= 6 +BuildRequires: python-ordereddict +%endif + +%description + +ToscaWidgets is a web widget toolkit for Python to aid in the creation, +packaging and distribution of common view elements normally used in the web. + +The tw2.core package is lightweight and intended for run-time use only; +development tools are in tw2.devtools. + + +%package -n python2-tw2-core +Summary: %summary + +# Runtime requirements +%if 0%{?rhel} && 0%{?rhel} <= 6 +Requires: python-ordereddict +Requires: python-webob1.0 >= 0.9.7 +%else +Requires: python2-webob >= 0.9.7 +%endif +Requires: python2-simplejson >= 2.0 +Requires: python2-decorator +Requires: python2-markupsafe +Requires: python2-speaklater +Requires: python2-paste-deploy +Requires: python2-six +Requires: python2-nine + +%{?python_provide:%python_provide python2-tw2-core} + + +%description -n python2-tw2-core +ToscaWidgets is a web widget toolkit for Python to aid in the creation, +packaging and distribution of common view elements normally used in the web. + +The tw2.core package is lightweight and intended for run-time use only; +development tools are in tw2.devtools. + +This package contains the python2 version of the toolkit + +%if 0%{?with_python3} +%package -n python3-tw2-core +Summary: Web widget creation toolkit based on TurboGears widgets +Requires: python3-webob >= 0.9.7 +Requires: python3-simplejson >= 2.0 +Requires: python3-decorator +Requires: python3-markupsafe +Requires: python3-speaklater +Requires: python3-paste-deploy +Requires: python3-six +Requires: python3-nine + +%{?python_provide:%python_provide python3-tw2-core} + +%description -n python3-tw2-core +ToscaWidgets is a web widget toolkit for Python to aid in the creation, +packaging and distribution of common view elements normally used in the web. + +The tw2.core package is lightweight and intended for run-time use only; +development tools are in tw2.devtools. + +This package contains the python3 version of the toolkit +%endif + +%prep +%setup -q -n %{modname}-%{version} + +%if 0%{?rhel} && 0%{?rhel} <= 6 +%patch0 -p1 +# Old mako in el6 doesn't have "loop.last" +sed -i 's/for c in w.children/for i, c in enumerate(w.children)/' tw2/core/templates/display_children.mak +sed -i 's/loop.last/(i == len(w.children) - 1)/' tw2/core/templates/display_children.mak +%endif + +%patch1 -p1 + +%if 0%{?rhel} && 0%{?rhel} <= 6 +# Make sure that epel/rhel picks up the correct version of webob +awk 'NR==1{print "import __main__; __main__.__requires__ = __requires__ = [\"WebOb>=1.0\"]; import pkg_resources"}1' setup.py > setup.py.tmp +mv setup.py.tmp setup.py + +# Remove all the fancy nosetests configuration for older python +rm setup.cfg + +%endif + +%if 0%{?with_python3} +rm -rf %{py3dir} +cp -a . %{py3dir} +%endif # with_python3 + +%build +%{__python2} setup.py build + +%if 0%{?with_python3} +pushd %{py3dir} +# Fix shebang +sed -i '1s=^#!/usr/bin/\(python\|env python\)[0-9.]*=#!%{__python3}=' tw2/core/testbase/xhtmlify.py +%{__python3} setup.py build +popd +%endif # with_python3 + +%install +%{__python2} setup.py install --skip-build \ + --install-data=%{_datadir} --root=%{buildroot} + +%if 0%{?with_python3} +pushd %{py3dir} +%{__python3} setup.py install --skip-build \ + --install-data=%{_datadir} --root=%{buildroot} +popd +%endif # with_python3 + +%check +PYTHONPATH=$(pwd) %{__python2} setup.py test + +%if 0%{?with_python3} +pushd %{py3dir} +PYTHONPATH=$(pwd) %{__python3} setup.py test +popd +%endif # with_python3 + +%files -n python2-tw2-core +%{!?_licensedir:%global license %%doc} +%license LICENSE.txt +%doc README.rst +%{python2_sitelib}/tw2 +%{python2_sitelib}/%{modname}-%{version}* + +%if 0%{?with_python3} +%files -n python3-tw2-core +%{!?_licensedir:%global license %%doc} +%license LICENSE.txt +%doc README.rst +%{python3_sitelib}/tw2 +%{python3_sitelib}/%{modname}-%{version}* +%endif + +%changelog +* Fri Jul 26 2019 Fedora Release Engineering - 2.2.3-15 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild + +* Sat Feb 02 2019 Fedora Release Engineering - 2.2.3-14 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild + +* Sat Jul 14 2018 Fedora Release Engineering - 2.2.3-13 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild + +* Tue Jun 19 2018 Miro Hrončok - 2.2.3-12 +- Rebuilt for Python 3.7 + +* Thu Mar 15 2018 Jan Beran - 2.2.3-11 +- Fix of python3-tw2-core requires both Python 2 and Python 3 (rhbz #1546817) + +* Wed Feb 28 2018 Iryna Shcherbina - 2.2.3-10 +- Update Python 2 dependency declarations to new packaging standards + (See https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3) + +* Fri Feb 09 2018 Igor Gnatenko - 2.2.3-9 +- Escape macros in %%changelog + +* Tue Oct 17 2017 Petr Viktorin - 2.2.3-8 +- Python 2 binary package renamed to python2-tw2-core + +* Thu Jul 27 2017 Fedora Release Engineering - 2.2.3-7 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild + +* Sat Feb 11 2017 Fedora Release Engineering - 2.2.3-6 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild + +* Mon Dec 19 2016 Miro Hrončok - 2.2.3-5 +- Rebuild for Python 3.6 + +* Tue Jul 19 2016 Fedora Release Engineering - 2.2.3-4 +- https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages + +* Thu Feb 04 2016 Fedora Release Engineering - 2.2.3-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild + +* Wed Jan 6 2016 Toshio Kuratomi - 2.2.3-2 +- Python3 subpackage + +* Fri Dec 11 2015 Ralph Bean - 2.2.3-1 +- new version + +* Fri Oct 16 2015 Ralph Bean - 2.2.2-3 +- Apply patch from upstream to fix unicode issues with mako. + +* Thu Jun 18 2015 Fedora Release Engineering - 2.2.2-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild + +* Fri Feb 20 2015 Ralph Bean - 2.2.2-1 +- new version + +* Fri Feb 20 2015 Ralph Bean - 2.2.2-1 +- new version +- Further fix rhel6 conditionals. + +* Thu Nov 13 2014 Ralph Bean - 2.2.1.1-5 +- Spec bump to deal with ridiculous epel7 merge. ;( + +* Wed Nov 12 2014 Ralph Bean - 2.2.1.1-3 +- Update rhel6 conditionals. + +* Sat Jun 07 2014 Fedora Release Engineering - 2.2.1.1-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild + +* Tue Jan 28 2014 Ralph Bean - 2.2.1.1-1 +- Latest upstream. + +* Sun Aug 04 2013 Fedora Release Engineering - 2.1.5-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild + +* Thu Feb 28 2013 Ralph Bean - 2.1.5-3 +- Patch for python-markupsafe usage on el6. + +* Thu Feb 28 2013 Ralph Bean - 2.1.5-2 +- Added requirement on python-markupsafe. +- Added el6 conditional requirement on python-ordereddict. + +* Fri Feb 22 2013 Ralph Bean - 2.1.5-1 +- Latest upstream + +* Thu Feb 14 2013 Fedora Release Engineering - 2.0.5-5 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild + +* Mon Aug 06 2012 Ralph Bean - 2.0.5-4 +- Test change for fedmsg hook. + +* Sat Jul 21 2012 Fedora Release Engineering - 2.0.5-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild + +* Thu Jun 07 2012 Ralph Bean - 2.0.5-2 +- Correct directory ownership. + +* Tue Apr 24 2012 Ralph Bean - 2.0.5-1 +- Packaged latest version of tw2.core which fixes streaming WSGI compliance. +- Removed defattr in the files section. +- Removed clean section. Not supporting EPEL5. +- Removed references to buildroot. + +* Mon Apr 16 2012 Ralph Bean - 2.0.4-1 +- Packaged latest version of tw2.core which fixes tests on py2.6. +- Added awk line to make sure pkg_resources picks up the right WebOb on el6 +- Added dependency on python-unittest2 + +* Wed Apr 11 2012 Ralph Bean - 2.0.3-1 +- Packaged the latest release of tw2.core. +- Fixed rpmlint - python-bytecode-without-source +- Fixed rpmlint - non-executable-script + +* Tue Apr 10 2012 Ralph Bean - 2.0.2-1 +- Packaged the latest release of tw2.core. +- Added the %%{?dist} macro to Release: + +* Wed Apr 04 2012 Ralph Bean - 2.0.1-1 +- Update for latest tw2.core release. + +* Thu Jun 16 2011 Luke Macken - 2.0-0.1.b4 +- Initial package diff --git a/sources b/sources new file mode 100644 index 0000000..76f36fa --- /dev/null +++ b/sources @@ -0,0 +1 @@ +d9777a45593465b20b5a7301c24e62fa tw2.core-2.2.3.tar.gz