%global pypi_name jinja2-cli
%global _docdir_fmt %{name}
%global sum CLI interface to Jinja2
%global desc A CLI interface to Jinja2 which supports data in ini, json, querystring, yaml, \
yml and toml formats.
Name: python-%{pypi_name}
Version: 0.6.0
Release: 4%{?dist}
Summary: %sum
License: BSD
URL: https://pypi.python.org/pypi/%{pypi_name}
Source0: https://pypi.python.org/packages/50/24/a774867a93c19d21f132154b509ad014ab22106e1927d0241b556cf8c836/jinja2-cli-0.6.0.tar.gz
# Template file used for tests
Source1: https://raw.githubusercontent.com/mattrobenolt/jinja2-cli/de60e677db944ad221d438f50aebbca1fb4e6146/tests/files/template.j2
# Fix StringIO import on Python 3
Patch0: https://github.com/mattrobenolt/jinja2-cli/commit/137fd22a4f31e2c9bea35beb33a2bc9d6e025aa9.patch
BuildArch: noarch
BuildRequires: python2-devel
BuildRequires: python3-devel
# For tests
BuildRequires: python2-pytest
BuildRequires: python2-jinja2
BuildRequires: python3-pytest
BuildRequires: python3-jinja2
%description
%desc
%package -n python2-%{pypi_name}
Summary: %sum
BuildArch: noarch
Requires: python2-jinja2
Requires: python2-pyyaml
Requires: python2-toml
%{?python_provide:%python_provide python2-%{pypi_name}}
%description -n python2-%{pypi_name}
%desc
%package -n python3-%{pypi_name}
Summary: %sum
BuildArch: noarch
Requires: python3-jinja2
Requires: python3-PyYAML
Requires: python3-toml
%{?python_provide:%python_provide python3-%{pypi_name}}
%description -n python3-%{pypi_name}
%desc
%prep
%setup -qn %{pypi_name}-%{version}
%patch0 -p1
%build
%py2_build
%py3_build
%install
%py2_install
mv %{buildroot}%{_bindir}/jinja2 %{buildroot}%{_bindir}/jinja2-%{python2_version}
%py3_install
ln -s %{_bindir}/jinja2 %{buildroot}%{_bindir}/jinja2-%{python3_version}
# Remove tests from install (not good folder)
rm -rf %{buildroot}%{python3_sitelib}/tests
rm -rf %{buildroot}%{python2_sitelib}/tests
%check
# Copy test template
mkdir -p build/lib/tests/files
cp -R %{SOURCE1} build/lib/tests/files
py.test-%{python3_version} build/lib
py.test-%{python2_version} build/lib
%files -n python2-%{pypi_name}
%license LICENSE
%doc README.md
%{_bindir}/jinja2-%{python2_version}
%{python2_sitelib}/jinja2_cli-%{version}-py%{python2_version}.egg-info/
%{python2_sitelib}/jinja2cli/
%files -n python3-%{pypi_name}
%license LICENSE
%doc README.md
%{_bindir}/jinja2
%{_bindir}/jinja2-%{python3_version}
%{python3_sitelib}/jinja2_cli-%{version}-py%{python3_version}.egg-info/
%{python3_sitelib}/jinja2cli/
%changelog
* Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.6.0-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
* Fri Jan 19 2018 Iryna Shcherbina <ishcherb@redhat.com> - 0.6.0-3
- Update Python 2 dependency declarations to new packaging standards
(See https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3)
* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.6.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
* Sun Jul 16 2017 Julien Enselme <jujens@jujens.eu> - 0.6.0-1
- Update to 0.6.0
* Sat Feb 11 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.5.0-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
* Mon Dec 19 2016 Miro HronĨok <mhroncok@redhat.com> - 0.5.0-5
- Rebuild for Python 3.6
* Tue Jul 19 2016 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.5.0-4
- https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 0.5.0-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
* Thu Nov 5 2015 Julien Enselme <jujens@jujens.eu> - 0.5.0-2
- Rebuilt for python 3.5
* Fri Oct 2 2015 Julien Enselme <jujens@jujens.eu> - 0.5.0-1
- Initial package