Blob Blame History Raw
%global srcname  cookiecutter
%global pkgname  python-cookiecutter
%global forgeurl
%global common_description %{expand:
A command-line utility that creates projects from cookiecutters (project
templates), e.g. creating a Python package project from a Python package
project template.}

%bcond_with tests

Name:      %{pkgname}
Version:   2.1.1
Release:   %autorelease
Summary:   CLI utility to create projects from templates
License:   BSD
URL:       %{forgeurl}
BuildArch: noarch

BuildRequires: python3-devel
BuildRequires: pyproject-rpm-macros

%description %{common_description}

%package -n python-%{srcname}-doc
Summary: Documentation for %{srcname}
%description -n python-%{srcname}-doc
Documentation for %{srcname}

%package -n python3-%{srcname}
Summary: %summary

Recommends: python-%{srcname}-doc
Requires: python3-binaryornot
Requires: python3-click
Requires: python3-future
Requires: python3-jinja2
Requires: python3-jinja2-time
Requires: python3-poyo
Requires: python3-requests

%description -n python3-%{srcname} %{common_description}

%autosetup -n %{srcname}-%{version}
sed -i 's#python -c#%{__python3} -c#' Makefile

%pyproject_buildrequires -r %{?with_tests:-x testing}


%if %{with doc}
make docs


%if %{with tests}
%{python3} -m pytest tests -v

%files -n python3-%{srcname}
%license LICENSE
# For noarch packages: sitelib

%files -n python-%{srcname}-doc
%license LICENSE
%doc docs
%doc *.md