%global pkgname anytemplate %if 0%{?fedora} || 0%{?rhel} > 7 %bcond_without python3 %else %bcond_with python3 %endif %global desc \ Python library works as an abstraction layer for various python template\ engines and rendering libraries, and provide a few very simple and easily\ understandable APIs to render templates.\ \ Also a CLI tool called anytemplate_cli is provided to render templates written\ in these template languages. Name: python-%{pkgname} Version: 0.1.4 Release: 1%{?dist} Summary: Python library provides common APIs for various template engines Group: Development/Tools License: MIT URL: https://github.com/ssato/python-anytemplate Source0: %{url}/archive/RELEASE_%{version}.tar.gz BuildArch: noarch BuildRequires: python2-setuptools BuildRequires: python2-devel %if %{with python3} BuildRequires: python3-devel BuildRequires: python3-setuptools %endif %description %{desc} %package -n python2-%{pkgname} Summary: %{summary} Requires: PyYAML Requires: python2-jinja2 Requires: python2-anyconfig %{?python_provide:%python_provide python2-%{pkgname}} %description -n python2-%{pkgname} %{desc} %if %{with python3} %package -n python3-%{pkgname} Summary: %{summary} Requires: python3-PyYAML Requires: python3-jinja2 Requires: python3-anyconfig %{?python_provide:%python_provide python3-%{pkgname}} %description -n python3-%{pkgname} %{desc} This is a version for python-3.x. %endif %prep %autosetup -n %{pkgname}-%{version} %build %py2_build %if %{with python3} %py3_build %endif %install %py2_install %if %{with python3} %py3_install %endif %files -n python2-%{pkgname} %doc README.rst examples %{python_sitelib}/* %if %{with python3} %files -n python3-%{pkgname} %doc README.rst examples %{python3_sitelib}/* %endif %{_bindir}/* %changelog * Tue May 1 2018 Satoru SATOH - 0.1.4-1 - New upstream release * Fri May 1 2015 Satoru SATOH - 0.0.1-1 - Initial packaging