%global modname cekit %global _description \ Cekit helps to build container images from image definition files %global commitdate 20190218 %global commit dcb561650f177a800208c89e62d029d5ed9cc912 %global shortcommit dcb5616 Name: %{modname} Version: 3.0.0 Release: 0.2.%{commitdate}git%{shortcommit}%{?dist} Summary: Container image creation tool License: MIT URL: https://github.com/cekit/cekit Source0: %{url}/archive/%{commit}/%{name}-%{shortcommit}.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 %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 Recommends: python3-docker Recommends: python3-docker-squash Recommends: docker Recommends: bash-completion %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-%{commit} %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 completion/bash/cekit %{buildroot}/%{_sysconfdir}/bash_completion.d/cekit mkdir -p %{buildroot}/%{_datadir}/zsh/site-functions cp 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 * Mon Feb 18 2019 Marek Goldmann - 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 - 3.0.0-0.1.20190214gitec3a0b - Initial packaging