Blob Blame History Raw
%if 0%{?rhel} && 0%{?rhel} <= 7
%bcond_with python3
%else
%bcond_without python3
%endif

%global modname docker-squash

Name:           python-%{modname}
Version:        1.0.5
Release:        7%{?dist}
Summary:        Docker layer squashing tool
License:        MIT
URL:            https://github.com/goldmann/docker-squash
Source0:        %{url}/archive/%{version}/%{name}-%{version}.tar.gz

# This is already upstream, but not yet released in a stable version. We need
# this to support the latest docker python bindings
#   https://github.com/goldmann/docker-squash/pull/143
Patch0:         python-docker-squash-1.0.5-docker-py2.patch

BuildArch:      noarch

%global _description \
Tool to squash layers in Docker images.

%description %_description

%package -n python2-docker-squash
Summary:        %{summary}

BuildRequires:  python2-devel
BuildRequires:  python2-setuptools
BuildRequires:  python2-pytest
BuildRequires:  python2-mock
BuildRequires:  python2-six
BuildRequires:  python-docker
Requires:       python2-six
Requires:       python-docker

Provides:       python-docker-scripts = %{version}-%{release}
Obsoletes:      python-docker-scripts <= 1.0.0-0.2.rc2
%{?python_provide:%python_provide python2-%{modname}}

%description -n python2-%{modname} %_description

Python 2 version.

%if %{with python3}
%package -n python3-%{modname}
Summary:        %{summary}

BuildRequires:  python3-devel
BuildRequires:  python3-setuptools
BuildRequires:  python3-pytest
BuildRequires:  python3-mock
BuildRequires:  python3-six
BuildRequires:  python3-docker
Requires:       python3-six
Requires:       python3-docker

Provides:       python3-docker-scripts = %{version}-%{release}
Obsoletes:      python3-docker-scripts <= 1.0.0-0.2.rc2
%{?python_provide:%python_provide python3-%{modname}}

%description -n python3-%{modname} %_description

Python 3 version.
%endif

%prep
%setup -q -n %{modname}-%{version}

%patch0 -p1

%build
%py2_build
%if %{with python3}
%py3_build
%endif

%check
py.test-%{python2_version} -v tests/test_unit*.py
%if %{with python3}
py.test-%{python3_version} -v tests/test_unit*.py
%endif

%install
%py2_install
%if %{with python3}
%py3_install
%endif

%files -n python2-%{modname}
%doc README.rst
%license LICENSE
%{python2_sitelib}/docker_squash/
%{python2_sitelib}/docker_squash-*.egg-info/

%if %{with python3}
%files -n python3-%{modname}
%doc README.rst
%license LICENSE
%{python3_sitelib}/docker_squash/
%{python3_sitelib}/docker_squash-*.egg-info/
%endif

# This file ends up in py3 subpackage if enabled, otherwise in py2
%{_bindir}/docker-squash

%changelog
* Wed Aug 23 2017 Adam Miller <maxamillion@gmail.com> - 1.0.5-7
- Include the docker-squash upstream patch to add docker client api 2.x support

* Wed Aug 23 2017 Adam Miller <maxamillion@gmail.com> - 1.0.5-6
- Migrate from python-docker-py to python-docker, the former is deprecated
  upstream

* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.0.5-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild

* Sat Feb 11 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.0.5-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild

* Mon Dec 19 2016 Miro Hrončok <mhroncok@redhat.com> - 1.0.5-3
- Rebuild for Python 3.6

* Wed Dec 07 2016 Marek Goldmann <mgoldman@redhat.com> - 1.0.5-2
- Added missing sources

* Wed Dec 07 2016 Marek Goldmann <mgoldman@redhat.com> - 1.0.5-1
- Upstream release 1.0.5

* Tue Nov 08 2016 Igor Gnatenko <i.gnatenko.brain@gmail.com> - 1.0.4-1
- Update to 1.0.4

* Thu Sep 01 2016 Igor Gnatenko <ignatenko@redhat.com> - 1.0.3-1
- Update to 1.0.3

* Thu Aug 25 2016 Igor Gnatenko <ignatenko@redhat.com> - 1.0.2-1
- Update to 1.0.2

* Tue Aug 16 2016 Marek Goldmann <mgoldman@redhat.com> - 1.0.1-1
- 1.0.1 release

* Wed Jul 27 2016 Marek Goldmann <mgoldman@redhat.com> - 1.0.0-1
- 1.0.0 upstream release

* Tue Jul 19 2016 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.0.0-0.9.rc6
- https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages

* Fri May 27 2016 Marek Goldmann <mgoldman@redhat.com> - 1.0.0-0.8.rc6
- Upstream 1.0.0rc6 release

* Mon May 23 2016 Marek Goldmann <mgoldman@redhat.com> - 1.0.0-0.7.rc5
- 1.0.0rc5 release

* Tue May 10 2016 Marek Goldmann <mgoldman@redhat.com> - 1.0.0-0.6.rc4
- Release bump

* Wed Apr 13 2016 Marek Goldmann <mgoldman@redhat.com> - 1.0.0-0.5.rc4
- Adapt to current guidelines thanks to Zbigniew Jędrzejewski-Szmek

* Fri Apr 08 2016 Marek Goldmann <mgoldman@redhat.com> - 1.0.0-0.4.rc4
- Upstream release 1.0.0rc4

* Fri Apr 01 2016 Marek Goldmann <mgoldman@redhat.com> - 1.0.0-0.3.rc3
- Project rename and new 1.0.0rc3 release

* Fri Apr 01 2016 Marek Goldmann <mgoldman@redhat.com> - 1.0.0-0.2.rc2
- Someone forgot to upload sources...

* Fri Apr 01 2016 Marek Goldmann - 1.0.0-0.1.rc2
- Upstream release 1.0.0rc2

* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 0.4.4-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild

* Mon Jan 18 2016 Martin Milata <mmilata@redhat.com> - 0.4.4-1
- Upstream release 0.4.4

* Tue Nov 10 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.4.2-3
- Rebuilt for https://fedoraproject.org/wiki/Changes/python3.5

* Thu Jun 18 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.4.2-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild

* Thu Jun 11 2015 Marek Goldmann <mgoldman@redhat.com> - 0.4.2-1
- Upstream release 0.4.2

* Tue Jun 02 2015 Marek Goldmann <mgoldman@redhat.com> - 0.4.1-1
- Upstream release 0.4.1

* Wed May 27 2015 Marek Goldmann <mgoldman@redhat.com> - 0.4.0-1
- Upstream release 0.4.0
- Run unit tests at build time

* Mon May 18 2015 Marek Goldmann <mgoldman@redhat.com> - 0.3.8-1
- Upstream release 0.3.8

* Fri May 15 2015 Marek Goldmann <mgoldman@redhat.com> - 0.3.7-1
- Upstream release 0.3.7
- Make sure the /usr/lib/python2.7/site-packages/docker_scripts
  is owned by this package

* Thu May 14 2015 Marek Goldmann <mgoldman@redhat.com> - 0.3.6-1
- Upstream release 0.3.6

* Tue May 12 2015 Marek Goldmann <mgoldman@redhat.com> - 0.3.4-1
- Initial packaging