| |
@@ -1,23 +1,16 @@
|
| |
+ %global with_python2 1
|
| |
+
|
| |
Name: python-cheetah
|
| |
- Version: 2.4.4
|
| |
+ Version: 3.0.0
|
| |
Release: 17%{?dist}
|
| |
Summary: Template engine and code generator
|
| |
|
| |
Group: Development/Libraries
|
| |
License: MIT
|
| |
URL: http://cheetahtemplate.org/
|
| |
- Source: http://pypi.python.org/packages/source/C/Cheetah/Cheetah-%{version}.tar.gz
|
| |
-
|
| |
- Patch0: cheetah-2.4.4-dont-run-tests-twice.patch
|
| |
- Patch1: cheetah-optional-deps.patch
|
| |
-
|
| |
- BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
|
| |
+ Source: https://pypi.python.org/packages/5b/22/0238132792f3600717fad9647072486e2c15b7b45f845b52cc484b9af024/Cheetah3-3.0.0.tar.gz
|
| |
|
| |
- BuildRequires: python
|
| |
- BuildRequires: python-devel
|
| |
- BuildRequires: python-setuptools
|
| |
- BuildRequires: python-markdown
|
| |
- BuildRequires: python-pygments
|
| |
+ Patch0: cheetah-3.0.0-dont-run-tests-twice.patch
|
| |
|
| |
%global _description\
|
| |
Cheetah is an open source template engine and code generation tool,\
|
| |
@@ -26,6 +19,12 @@
|
| |
Cheetah is very flexible and is also being used to generate C++ code,\
|
| |
Java, SQL, form emails and even Python code.
|
| |
|
| |
+ %if 0%{?with_python2}
|
| |
+ BuildRequires: python2-devel
|
| |
+ BuildRequires: python2-setuptools
|
| |
+ BuildRequires: python2-markdown
|
| |
+ BuildRequires: python2-pygments
|
| |
+
|
| |
%description %_description
|
| |
|
| |
%package -n python2-cheetah
|
| |
@@ -34,63 +33,77 @@
|
| |
|
| |
%description -n python2-cheetah %_description
|
| |
|
| |
+ %endif
|
| |
+
|
| |
+ %package -n python3-cheetah
|
| |
+ Summary: %summary
|
| |
+ %{?python_provide:%python_provide python3-cheetah}
|
| |
+
|
| |
+ BuildRequires: python3-devel
|
| |
+ BuildRequires: python3-setuptools
|
| |
+ BuildRequires: python3-markdown
|
| |
+ BuildRequires: python3-pygments
|
| |
+
|
| |
+ %description -n python3-cheetah %_description
|
| |
+
|
| |
+
|
| |
%prep
|
| |
- %setup -q -n Cheetah-%{version}
|
| |
+ %setup -q -n Cheetah3-%{version}
|
| |
%patch0 -p1
|
| |
- %patch1 -p1
|
| |
# remove unnecessary shebang lines to silence rpmlint
|
| |
- %{__sed} -i -e '/^#!/,1d' cheetah/Tests/* \
|
| |
- cheetah/DirectiveAnalyzer.py cheetah/Utils/Misc.py
|
| |
+ %{__sed} -i -e '/^#!/,1d' Cheetah/Tests/* \
|
| |
+ Cheetah/DirectiveAnalyzer.py Cheetah/Utils/Misc.py
|
| |
+
|
| |
+ rm -rf %{py3dir}
|
| |
+ cp -a . %{py3dir}
|
| |
|
| |
%build
|
| |
- %{__python} setup.py build
|
| |
+ pushd %{py3dir}
|
| |
+ %py3_build
|
| |
+ popd
|
| |
+
|
| |
+ %if 0%{?with_python2}
|
| |
+ %py2_build
|
| |
+ %endif
|
| |
+
|
| |
|
| |
%install
|
| |
- rm -rf %{buildroot}
|
| |
- %{__python} setup.py install -O1 --skip-build --root %{buildroot}
|
| |
+ %if 0%{?with_python2}
|
| |
+ %py2_install
|
| |
+ %endif
|
| |
+
|
| |
+ pushd %{py3dir}
|
| |
+ %py3_install
|
| |
+ popd
|
| |
+
|
| |
|
| |
%check
|
| |
export PATH="%{buildroot}/%{_bindir}:$PATH"
|
| |
export PYTHONPATH="%{buildroot}/%{python_sitearch}"
|
| |
+ %__python2 %{buildroot}/%{_bindir}/cheetah test
|
| |
+ export PYTHONPATH="%{buildroot}/%{python3_sitearch}"
|
| |
%{buildroot}/%{_bindir}/cheetah test
|
| |
|
| |
%clean
|
| |
rm -rf %{buildroot}
|
| |
|
| |
+ %if 0%{?with_python2}
|
| |
%files -n python2-cheetah
|
| |
%defattr(-,root,root,-)
|
| |
- %{!?_licensedir:%global license %%doc}
|
| |
%license LICENSE
|
| |
- %doc CHANGES README.markdown TODO
|
| |
-
|
| |
- %{_bindir}/cheetah
|
| |
- %{_bindir}/cheetah-analyze
|
| |
- %{_bindir}/cheetah-compile
|
| |
+ %doc ANNOUNCE.rst README.rst TODO BUGS
|
| |
|
| |
- %dir %{python_sitearch}/Cheetah
|
| |
- %{python_sitearch}/Cheetah/*.py*
|
| |
- %{python_sitearch}/Cheetah/_namemapper.so
|
| |
+ %{python_sitearch}/
|
| |
+ %endif
|
| |
|
| |
- %dir %{python_sitearch}/Cheetah/Macros
|
| |
- %{python_sitearch}/Cheetah/Macros/*.py*
|
| |
-
|
| |
- %dir %{python_sitearch}/Cheetah/Templates
|
| |
- %{python_sitearch}/Cheetah/Templates/*.py*
|
| |
- %{python_sitearch}/Cheetah/Templates/*.tmpl
|
| |
-
|
| |
- %dir %{python_sitearch}/Cheetah/Tests
|
| |
- %{python_sitearch}/Cheetah/Tests/*.py*
|
| |
-
|
| |
- %dir %{python_sitearch}/Cheetah/Tools
|
| |
- %{python_sitearch}/Cheetah/Tools/*.py*
|
| |
- %{python_sitearch}/Cheetah/Tools/*.txt
|
| |
+ %files -n python3-cheetah
|
| |
+ %defattr(-,root,root,-)
|
| |
+ %license LICENSE
|
| |
+ %doc ANNOUNCE.rst README.rst TODO BUGS
|
| |
|
| |
- %dir %{python_sitearch}/Cheetah/Utils
|
| |
- %{python_sitearch}/Cheetah/Utils/*.py*
|
| |
+ %{_bindir}/cheetah*
|
| |
|
| |
- %dir %{python_sitearch}/Cheetah-%{version}-*.egg-info
|
| |
- %{python_sitearch}/Cheetah-%{version}-*.egg-info/PKG-INFO
|
| |
- %{python_sitearch}/Cheetah-%{version}-*.egg-info/*.txt
|
| |
+ %{python3_sitearch}/
|
| |
|
| |
%changelog
|
| |
* Sat Aug 19 2017 Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> - 2.4.4-17
|
| |
Add python3 subpackage