%global modname cekit
%global _description \
CEKit helps to build container images from image definition files
Name: %{modname}
Version: 3.2.0
Release: 1%{?dist}
Summary: Container image creation tool
License: MIT
URL: https://cekit.io
Source0: https://github.com/cekit/cekit/archive/%{version}/%{name}-%{version}.tar.gz
BuildArch: noarch
Requires: PyYAML
Requires: git
BuildRequires: PyYAML
%if 0%{?rhel} && 0%{?rhel} < 8
BuildRequires: python2-devel
BuildRequires: python2-setuptools
BuildRequires: python2-pykwalify
BuildRequires: python2-colorlog
BuildRequires: python-jinja2
Requires: python-jinja2
Requires: python-setuptools
Requires: python2-pykwalify
Requires: python2-colorlog
Requires: python2-click
%else
BuildRequires: python3-devel
BuildRequires: python3-setuptools
BuildRequires: python3-pykwalify
BuildRequires: python3-colorlog
BuildRequires: python3-jinja2
Requires: python3-jinja2
Requires: python3-setuptools
Requires: python3-pykwalify
Requires: python3-colorlog
Requires: python3-click
Suggests: python3-docker
Suggests: python3-docker-squash
Suggests: docker
%endif
%description %_description
%package -n %{modname}-bash-completion
Summary: %{summary}
Requires: bash-completion
%description -n %{modname}-bash-completion %_description
Bash completion.
%package -n %{modname}-zsh-completion
Summary: %{summary}
Requires: zsh
%description -n %{modname}-zsh-completion %_description
ZSH completion.
%prep
%setup -q -n cekit-%{version}
%if 0%{?rhel} && 0%{?rhel} < 8
# In EPEL/RHEL there is the old Docker Python library available only
sed -i 's/^docker$/docker-py/' requirements.txt
%endif
%build
%if 0%{?rhel} && 0%{?rhel} < 8
%py2_build
%else
%py3_build
%endif
%install
mkdir -p %{buildroot}/%{_sysconfdir}/bash_completion.d
cp support/completion/bash/cekit %{buildroot}/%{_sysconfdir}/bash_completion.d/cekit
mkdir -p %{buildroot}/%{_datadir}/zsh/site-functions
cp support/completion/zsh/_cekit %{buildroot}/%{_datadir}/zsh/site-functions/_cekit
%if 0%{?rhel} && 0%{?rhel} < 8
%py2_install
%else
%py3_install
%endif
%files -n %{modname}-bash-completion
%doc README.rst
%license LICENSE
%{_sysconfdir}/bash_completion.d/cekit
%files -n %{modname}-zsh-completion
%doc README.rst
%license LICENSE
%{_datadir}/zsh/site-functions/_cekit
%files -n %{modname}
%doc README.rst
%license LICENSE
%if 0%{?rhel} && 0%{?rhel} < 8
%{python2_sitelib}/cekit/
%{python2_sitelib}/cekit-*.egg-info/
%else
%{python3_sitelib}/cekit/
%{python3_sitelib}/cekit-*.egg-info/
%endif
%{_bindir}/cekit
%{_bindir}/cekit-cache
%changelog
* Wed Jun 26 2019 Marek Goldmann <mgoldman@redhat.com> - 3.2.0-1
- Release 3.2.0
* Mon Jun 03 2019 Marek Goldmann <mgoldman@redhat.com> - 3.1.0-1
- Release 3.1.0
* Tue Apr 30 2019 Marek Goldmann <mgoldman@redhat.com> - 3.0.1-1
- Release 3.0.1
* Wed Apr 17 2019 Marek Goldmann <mgoldman@redhat.com> - 3.0.0-1
- Release 3.0.0
* Mon Apr 08 2019 Marek Goldmann <mgoldman@redhat.com> - 3.0.0-0.7.20190408git45cab46
- Updated revision to 45cab46
* Fri Mar 08 2019 Marek Goldmann <mgoldman@redhat.com> - 3.0.0-0.6.20190308git6318d73
- Rebuild
* Fri Mar 08 2019 Marek Goldmann <mgoldman@redhat.com> - 3.0.0-0.5.20190308git6318d73
- Rebuild
* Fri Mar 08 2019 Marek Goldmann <mgoldman@redhat.com> - 3.0.0-0.4.20190308git6318d73
- Updated revision to 6318d73
* Fri Mar 08 2019 Marek Goldmann <mgoldman@redhat.com> - 3.0.0-0.3.20190308git4f12391
- Updated revision to 4f12391
* Mon Feb 18 2019 Marek Goldmann <mgoldman@redhat.com> - 3.0.0-0.2.20190214git91cb6c1
- Update to commit dcb561650f177a800208c89e62d029d5ed9cc912
- Added support for RHEL 8 in coditionals
- Fixed Release
- Updated Source
* Thu Feb 14 2019 Marek Goldmann <mgoldman@redhat.com> - 3.0.0-0.1.20190214gitec3a0b
- Initial packaging