Blob Blame History Raw
%bcond_without tests

# We need to use the GitHub tarball to get the tests; but upstream does not
# reliably tag releases.
%global commit 70e0e7759f477337b683bd06c387c1d3612b2850
%global shortcommit %(c=%{commit}; echo ${c:0:7})

%global pypi_name airspeed

%global _description %{expand:
Airspeed is a powerful and easy-to-use templating engine for Python that aims
for a high level of compatibility with the popular Velocity library for Java.

- Compatible with Velocity templates
- Compatible with Python 2.6 and greater, including Jython
- Features include macros definitions, conditionals, sub-templates and much more
- Airspeed is already being put to serious use
- Comprehensive set of unit tests; the entire library was written test-first
- Reasonably fast
- A single Python module of a few kilobytes, and not the 500kb of Velocity
- Liberal license (BSD-style)}

Name:           python-%{pypi_name}
Version:        0.5.17
Release:        1%{?dist}
Summary:        A lightweight template engine compatible with Velocity

License:        BSD
URL:            https://github.com/purcell/%{pypi_name}
Source0:        %{url}/archive/%{commit}/%{name}-%{shortcommit}.tar.gz

# Remove shebang and execute bit from __init__.py
# https://github.com/purcell/airspeed/pull/53
Patch0:         https://github.com/purcell/airspeed/pull/53.patch

BuildArch:      noarch

%description %_description

%package -n python3-%{pypi_name}
Summary:        %{summary}
BuildRequires:  python3-devel
BuildRequires:  %{py3_dist cachetools}
BuildRequires:  %{py3_dist six}
BuildRequires:  %{py3_dist setuptools}
%if %{with tests}
BuildRequires:  %{py3_dist pytest}
%endif

%description -n python3-%{pypi_name} %_description

%prep
%autosetup -n %{pypi_name}-%{commit} -p1
rm -rf %{pypi_name}.egg-info

%build
%py3_build

%install
%py3_install

%check
%if %{with tests}
%pytest
%endif

%files -n python3-%{pypi_name}
%license LICENCE
%doc README.md
%{python3_sitelib}/%{pypi_name}-%{version}-py%{python3_version}.egg-info
%{python3_sitelib}/%{pypi_name}

%changelog
* Sat Sep 04 2021 Benjamin A. Beasley <code@musicinmybrain.net> - 0.5.17-1
- Update to 0.5.17 (close RHBZ#1956518)
- Remove obsolete macros
- Better preserve upstream mtimes; send a shebang removal PR upstream
- Since “setup.py test” is deprecated, and uses deprecated nose to collect
  tests, use pytest as the runner instead

* Fri Jul 23 2021 Fedora Release Engineering <releng@fedoraproject.org> - 0.5.16-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild

* Fri Jun 04 2021 Python Maint <python-maint@redhat.com> - 0.5.16-5
- Rebuilt for Python 3.10

* Wed Jan 27 2021 Fedora Release Engineering <releng@fedoraproject.org> - 0.5.16-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild

* Tue Jul 28 2020 Fedora Release Engineering <releng@fedoraproject.org> - 0.5.16-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild

* Thu Jun 25 2020 Ankur Sinha <ankursinha AT fedoraproject DOT org> - 0.5.16-2
- Explicitly BR setuptools

* Sun Jun 21 2020 Ankur Sinha <ankursinha AT fedoraproject DOT org> - 0.5.16-1
- Update to 0.5.16

* Tue May 26 2020 Miro Hrončok <mhroncok@redhat.com> - 0.5.15-2
- Rebuilt for Python 3.9

* Fri May 01 2020 Ankur Sinha <ankursinha AT fedoraproject DOT org> - 0.5.15-1
- Update to latest release
- Use git release for tests

* Tue Apr 21 2020 Ankur Sinha <ankursinha AT fedoraproject DOT org> - 0.5.14-1
- Update 0.5.14
- use github commit hash, upstream did not tag release

* Thu Jan 30 2020 Fedora Release Engineering <releng@fedoraproject.org> - 0.5.13-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild

* Wed Oct 23 2019 Aniket Pradhan <major AT fedoraproject DOT org> - 0.5.13-1
- Upgraded to v0.5.12

* Thu Oct 03 2019 Miro Hrončok <mhroncok@redhat.com> - 0.5.12-2
- Rebuilt for Python 3.8.0rc1 (#1748018)

* Thu Aug 29 2019 Aniket Pradhan <major AT fedoraproject DOT org> - 0.5.12-1
- Upgraded to v0.5.12

* Mon Aug 19 2019 Miro Hrončok <mhroncok@redhat.com> - 0.5.11-3
- Rebuilt for Python 3.8

* Fri Jul 26 2019 Fedora Release Engineering <releng@fedoraproject.org> - 0.5.11-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild

* Sat Jul 20 2019 Ankur Sinha <ankursinha AT fedoraproject DOT org> - 0.5.11-1
- Initial build