013b4ac
%global srcname  cookiecutter
013b4ac
%global pkgname  python-cookiecutter
013b4ac
%global forgeurl https://github.com/audreyr/cookiecutter
013b4ac
%global common_description %{expand:
f735ac3
A command-line utility that creates projects from cookiecutters (project
f735ac3
templates), e.g. creating a Python package project from a Python package
013b4ac
project template.}
f735ac3
d1d8269
%bcond_without tests
f735ac3
013b4ac
Name:      %{pkgname}
49eb319
Version:   2.6.0
013b4ac
%forgemeta
013b4ac
Release:   %autorelease
013b4ac
Summary:   CLI utility to create projects from templates
303f69d
License:   BSD-3-Clause
013b4ac
URL:       %{forgeurl}
013b4ac
Source0:   https://github.com/audreyr/%{srcname}/archive/%{version}.tar.gz
013b4ac
BuildArch: noarch
013b4ac
013b4ac
BuildRequires: python3-devel
013b4ac
BuildRequires: pyproject-rpm-macros
d1d8269
%if %{with tests}
d1d8269
BuildRequires: python3-pytest-cov
d1d8269
BuildRequires: python3-freezegun
d1d8269
BuildRequires: python3-pytest-mock
d1d8269
BuildRequires: git
d1d8269
%endif
013b4ac
013b4ac
%description %{common_description}
013b4ac
013b4ac
%package -n python-%{srcname}-doc
013b4ac
Summary: Documentation for %{srcname}
013b4ac
%description -n python-%{srcname}-doc
013b4ac
Documentation for %{srcname}
013b4ac
013b4ac
%package -n python3-%{srcname}
013b4ac
Summary: %summary
013b4ac
013b4ac
Recommends: python-%{srcname}-doc
013b4ac
Requires: python3-binaryornot
013b4ac
Requires: python3-click
013b4ac
Requires: python3-jinja2
013b4ac
Requires: python3-jinja2-time
303f69d
Requires: python3-pyyaml
013b4ac
Requires: python3-requests
303f69d
Requires: python3-slugify
f735ac3
013b4ac
%description -n python3-%{srcname} %{common_description}
013b4ac
013b4ac
%prep
013b4ac
%autosetup -n %{srcname}-%{version}
f735ac3
sed -i 's#python -c#%{__python3} -c#' Makefile
f735ac3
013b4ac
%generate_buildrequires
013b4ac
%pyproject_buildrequires -r %{?with_tests:-x testing}
013b4ac
f735ac3
%build
013b4ac
%pyproject_wheel
f735ac3
013b4ac
%if %{with doc}
f735ac3
make docs
013b4ac
%endif
f735ac3
f735ac3
%install
013b4ac
%pyproject_install
f735ac3
013b4ac
%if %{with tests}
f735ac3
%check
1ea7e0a
%{python3} -m pytest tests -v
013b4ac
%endif
f735ac3
013b4ac
%files -n python3-%{srcname}
f735ac3
%license LICENSE
f735ac3
# For noarch packages: sitelib
f735ac3
%{python3_sitelib}/*
013b4ac
%{_bindir}/%{srcname}
f735ac3
013b4ac
%files -n python-%{srcname}-doc
f735ac3
%license LICENSE
f735ac3
%doc docs
1ea7e0a
%doc *.md
f735ac3
f735ac3
%changelog
303f69d
%autochangelog