f735ac3
# sitelib for noarch packages, sitearch for others (remove the unneeded one)
f735ac3
%{!?__python2: %global __python2 %__python}
f735ac3
%{!?python2_sitelib: %global python2_sitelib %(%{__python2} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")}
f735ac3
f735ac3
%if 0%{?fedora}
f735ac3
%bcond_without python3
f735ac3
%else
f735ac3
%bcond_with python3
f735ac3
%endif
f735ac3
f735ac3
%global pkgname cookiecutter
f735ac3
f735ac3
Name:           python-cookiecutter
f735ac3
Version:        1.6.0
0cb16ad
Release:        5%{?dist}
f735ac3
Summary:        CLI utility to create projects from templates
f735ac3
License:        BSD
f735ac3
URL:            https://github.com/audreyr/cookiecutter
f735ac3
Source0:        https://github.com/audreyr/%{pkgname}/archive/%{version}.tar.gz
f735ac3
BuildArch:      noarch
f735ac3
f735ac3
BuildRequires:  python2-devel
f735ac3
f735ac3
# doc deps
f735ac3
BuildRequires:  python2-sphinx
f735ac3
BuildRequires:  python2-click
f735ac3
BuildRequires:  python2-whichcraft
f735ac3
BuildRequires:  python2-binaryornot
f735ac3
BuildRequires:  python2-poyo
f735ac3
BuildRequires:  python2-jinja2-time
f735ac3
f735ac3
# testing deps
f735ac3
BuildRequires:  python2-pytest
f735ac3
BuildRequires:  python2-pytest-cov
f735ac3
BuildRequires:  python2-pytest-mock
f735ac3
BuildRequires:  python2-pytest-catchlog
f735ac3
BuildRequires:  python2-freezegun
f735ac3
BuildRequires:  python2-jinja2
f735ac3
BuildRequires:  python2-future
f735ac3
BuildRequires:  python2-arrow
f735ac3
f735ac3
%if %{with python3}
f735ac3
BuildRequires:  python3-devel
f735ac3
BuildRequires:  python3-sphinx
f735ac3
BuildRequires:  python3-click
f735ac3
BuildRequires:  python3-whichcraft
f735ac3
BuildRequires:  python3-binaryornot
f735ac3
BuildRequires:  python3-poyo
f735ac3
BuildRequires:  python3-jinja2-time
f735ac3
BuildRequires:  python3-future
f735ac3
BuildRequires:  python3-arrow
f735ac3
f735ac3
BuildRequires:  python3-pytest
f735ac3
BuildRequires:  python3-pytest-cov
f735ac3
BuildRequires:  python3-pytest-mock
f735ac3
BuildRequires:  python3-pytest-catchlog
f735ac3
BuildRequires:  python3-freezegun
f735ac3
BuildRequires:  python3-jinja2
f735ac3
%endif # with python3
f735ac3
f735ac3
%description
f735ac3
A command-line utility that creates projects from cookiecutters (project
f735ac3
templates), e.g. creating a Python package project from a Python package
f735ac3
project template.
f735ac3
f735ac3
%package     -n python2-%{pkgname}
f735ac3
Summary: %{summary}
f735ac3
Recommends: python-%{pkgname}-doc
b58855e
Requires:  python2-binaryornot
b58855e
Requires:  python2-click
b58855e
Requires:  python2-jinja2
b58855e
Requires:  python2-jinja2-time
b58855e
Requires:  python2-poyo
b58855e
Requires:  python2-requests
b58855e
Requires:  python2-whichcraft
f735ac3
%{?python_provide:%python_provide python2-%{pkgname}}
f735ac3
%description -n python2-%{pkgname}
f735ac3
A command-line utility that creates projects from cookiecutters (project
f735ac3
templates), e.g. creating a Python package project from a Python package
f735ac3
project template.
f735ac3
f735ac3
%package     -n python-%{pkgname}-doc
f735ac3
Summary: Documentation for %{pkgname}
f735ac3
%description -n python-%{pkgname}-doc
f735ac3
Documentation for %{pkgname}
f735ac3
f735ac3
%if %{with python3}
f735ac3
%package     -n python3-%{pkgname}
f735ac3
Summary: %{summary}
f735ac3
Recommends: python-%{pkgname}-doc
b58855e
Requires:  python3-binaryornot
b58855e
Requires:  python3-click
7062010
Requires:  python3-future
b58855e
Requires:  python3-jinja2
b58855e
Requires:  python3-jinja2-time
b58855e
Requires:  python3-poyo
b58855e
Requires:  python3-requests
b58855e
Requires:  python3-whichcraft
f735ac3
%{?python_provide:%python_provide python3-%{pkgname}}
f735ac3
%description -n python3-%{pkgname}
f735ac3
A command-line utility that creates projects from cookiecutters (project
f735ac3
templates), e.g. creating a Python package project from a Python package
f735ac3
project template.
f735ac3
%endif # with python3
f735ac3
f735ac3
f735ac3
%prep
f735ac3
%autosetup -n %{pkgname}-%{version}
f735ac3
f735ac3
# fix invocation of /usr/bin/python
f735ac3
%if %{with python3}
f735ac3
sed -i 's#python -c#%{__python3} -c#' Makefile
f735ac3
%else
f735ac3
sed -i 's#python -c#%{__python2} -c#' Makefile
f735ac3
%endif # with python3
f735ac3
f735ac3
%build
f735ac3
%{py2_build}
f735ac3
f735ac3
%if %{with python3}
f735ac3
%{py3_build}
f735ac3
%endif # with python3
f735ac3
f735ac3
# make sphinx docs
f735ac3
make docs
f735ac3
f735ac3
%install
f735ac3
%{py2_install}
f735ac3
f735ac3
%if %{with python3}
f735ac3
%{py3_install}
f735ac3
%endif # with python3
f735ac3
f735ac3
%check
f735ac3
%{__python2} setup.py test
f735ac3
f735ac3
%if %{with python3}
f735ac3
%{__python3} setup.py test
f735ac3
%endif # with python3
f735ac3
f735ac3
%files -n python2-%{pkgname}
f735ac3
%license LICENSE
f735ac3
# For noarch packages: sitelib
f735ac3
%{python2_sitelib}/*
f735ac3
f735ac3
%if %{with python3}
f735ac3
%files -n python3-%{pkgname}
f735ac3
%license LICENSE
f735ac3
# For noarch packages: sitelib
f735ac3
%{python3_sitelib}/*
f735ac3
%endif # with python3
f735ac3
%{_bindir}/%{pkgname}
f735ac3
f735ac3
%files -n python-%{pkgname}-doc
f735ac3
%license LICENSE
f735ac3
%doc docs
f735ac3
%doc *.rst
f735ac3
f735ac3
%changelog
0cb16ad
* Fri Jul 13 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.6.0-5
0cb16ad
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
0cb16ad
ec5a101
* Tue Jun 19 2018 Miro HronĨok <mhroncok@redhat.com> - 1.6.0-4
ec5a101
- Rebuilt for Python 3.7
ec5a101
7062010
* Tue May 29 2018 Brett Lentz <brett.lentz@gmail.com> - 1.6.0-3
7062010
- fix deps
7062010
b58855e
* Tue Apr  3 2018 Brett Lentz <brett.lentz@gmail.com> - 1.6.0-2
b58855e
- fix deps
b58855e
f735ac3
* Thu Mar  1 2018 Brett Lentz <brett.lentz@gmail.com> - 1.6.0-1
f735ac3
- initial packaging