| |
@@ -1,113 +1,75 @@
|
| |
- %bcond_with python2
|
| |
-
|
| |
Name: python-cheetah
|
| |
- Version: 3.2.4
|
| |
- Release: 9%{?dist}
|
| |
+ Version: 3.2.6.post1
|
| |
+ Release: 1%{?dist}
|
| |
Summary: Template engine and code generator
|
| |
|
| |
License: MIT
|
| |
URL: https://cheetahtemplate.org/
|
| |
- Source: https://github.com/CheetahTemplate3/cheetah3/archive/%{version}/%{name}-%{version}.tar.gz
|
| |
+ Source: https://github.com/CheetahTemplate3/cheetah3/archive/%{version}/Cheetah3-%{version}.tar.gz
|
| |
|
| |
- # Skip test_import_bootlocale() on Python 3.10
|
| |
- # _bootlocale was removed in Python 3.10:
|
| |
- # https://bugs.python.org/issue42208
|
| |
- Patch1: https://github.com/CheetahTemplate3/cheetah3/commit/1041d5485c.patch
|
| |
+ # https://github.com/CheetahTemplate3/cheetah3/commit/6be6bc10a46f61c640ca0f7de42af56a84a3a0fc
|
| |
+ Patch: 0001-Tests-tox-Add-Python-3.10-to-tox.ini.patch
|
| |
|
| |
BuildRequires: gcc
|
| |
+ BuildRequires: python3-devel
|
| |
|
| |
- %global _description\
|
| |
- Cheetah is an open source template engine and code generation tool,\
|
| |
- written in Python. It can be used standalone or combined with other\
|
| |
- tools and frameworks. Web development is its principal use, but\
|
| |
- Cheetah is very flexible and is also being used to generate C++ code,\
|
| |
- Java, SQL, form emails and even Python code.
|
| |
+ %global _description %{expand:
|
| |
+ Cheetah3 is a free and open source template engine and code generation tool.
|
| |
+ It can be used standalone or combined with other tools and frameworks. Web
|
| |
+ development is its principle use, but Cheetah is very flexible and is also
|
| |
+ being used to generate C++ game code, Java, sql, form emails and even Python
|
| |
+ code.}
|
| |
|
| |
%description %{_description}
|
| |
|
| |
- %if %{with python2}
|
| |
- %package -n python2-cheetah
|
| |
- Summary: %summary
|
| |
- %{?python_provide:%python_provide python2-cheetah}
|
| |
-
|
| |
- BuildRequires: python2-devel
|
| |
- BuildRequires: python2-setuptools
|
| |
- # There is python2-markdown up to f30
|
| |
- %if 0%{?fedora} && 0%{?fedora} < 31
|
| |
- BuildRequires: python2-markdown
|
| |
- %endif
|
| |
- BuildRequires: python2-pygments
|
| |
-
|
| |
- %description -n python2-cheetah %_description
|
| |
-
|
| |
- %endif
|
| |
|
| |
%package -n python3-cheetah
|
| |
- Summary: %summary
|
| |
- %{?python_provide:%python_provide python3-cheetah}
|
| |
+ Summary: %{summary}
|
| |
|
| |
- BuildRequires: python3-devel
|
| |
- BuildRequires: python3-setuptools
|
| |
- BuildRequires: python3-markdown
|
| |
- BuildRequires: python3-pygments
|
| |
|
| |
- %description -n python3-cheetah %_description
|
| |
+ %description -n python3-cheetah %{_description}
|
| |
|
| |
|
| |
%prep
|
| |
%autosetup -p1 -n cheetah3-%{version}
|
| |
|
| |
+ # remove upper bound on markdown test dependency
|
| |
+ sed -e 's|, < 3.2||' -i tox.ini
|
| |
+
|
| |
# remove unnecessary shebang lines to silence rpmlint
|
| |
- %{__sed} -i -e '/^#!/,1d' Cheetah/Tests/*.py \
|
| |
- Cheetah/CheetahWrapper.py Cheetah/DirectiveAnalyzer.py \
|
| |
- Cheetah/Filters.py Cheetah/NameMapper.py Cheetah/Servlet.py \
|
| |
- Cheetah/Templates/SkeletonPage.py Cheetah/Tools/SiteHierarchy.py \
|
| |
- Cheetah/Version.py
|
| |
+ find Cheetah -type f -name '*.py' -print0 | xargs -0 sed -i -e '1 {/^#!/d}'
|
| |
|
| |
- %build
|
| |
- %if %{with python2}
|
| |
- %py2_build
|
| |
- %endif
|
| |
|
| |
- %py3_build
|
| |
+ %generate_buildrequires
|
| |
+ %pyproject_buildrequires -t
|
| |
|
| |
- %install
|
| |
- %if %{with python2}
|
| |
- %py2_install
|
| |
|
| |
- EGG_INFO=(%{buildroot}/%{python2_sitearch}/Cheetah*.egg-info)
|
| |
- cp -r $EGG_INFO ${EGG_INFO//Cheetah3/Cheetah}
|
| |
- sed -i "s/Name: Cheetah3/Name: Cheetah/" ${EGG_INFO//Cheetah3/Cheetah}/PKG-INFO
|
| |
- rm %{buildroot}%{_bindir}/*
|
| |
- %endif
|
| |
+ %build
|
| |
+ %pyproject_wheel
|
| |
|
| |
- %py3_install
|
| |
|
| |
+ %install
|
| |
+ %pyproject_install
|
| |
+ %pyproject_save_files Cheetah
|
| |
|
| |
- %check
|
| |
- export PATH="%{buildroot}/%{_bindir}:$PATH"
|
| |
- export PYTHONPATH="%{buildroot}/%{python3_sitearch}"
|
| |
- %{buildroot}/%{_bindir}/cheetah test
|
| |
|
| |
- %if %{with python2}
|
| |
- %files -n python2-cheetah
|
| |
- %license LICENSE
|
| |
- %doc ANNOUNCE.rst README.rst TODO BUGS
|
| |
+ %check
|
| |
+ # changing this in %%prep would cause an rpmlint error (rpm-buildroot-usage),
|
| |
+ # so do it here instead
|
| |
+ sed -e 's|{envsitepackagesdir}|%{buildroot}%{python3_sitearch}|' -i tox.ini
|
| |
+ %tox
|
| |
|
| |
- %{python2_sitearch}/Cheetah
|
| |
- %{python2_sitearch}/Cheetah*.egg-info
|
| |
- %endif
|
| |
|
| |
- %files -n python3-cheetah
|
| |
- %license LICENSE
|
| |
+ %files -n python3-cheetah -f %{pyproject_files}
|
| |
%doc ANNOUNCE.rst README.rst TODO BUGS
|
| |
-
|
| |
%{_bindir}/cheetah*
|
| |
|
| |
- %{python3_sitearch}/Cheetah
|
| |
- %{python3_sitearch}/Cheetah*.egg-info
|
| |
|
| |
%changelog
|
| |
+ * Thu Apr 07 2022 Carl George <carl@george.computer> - 3.2.6.post1-1
|
| |
+ - Update to 3.2.6.post1
|
| |
+ - Convert to pyproject macros
|
| |
+
|
| |
* Fri Jan 21 2022 Fedora Release Engineering <releng@fedoraproject.org> - 3.2.4-9
|
| |
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
|
| |
|
| |