commit bd5f9df02d7a4511aba404bf8aad7f7f836f9ab9 Author: Sergey Cherevko Date: Wed Jul 31 21:54:06 2024 +0300 import docker-compose-switch-1.0.5-1.6 diff --git a/.docker-compose-switch.metadata b/.docker-compose-switch.metadata new file mode 100644 index 0000000..471522e --- /dev/null +++ b/.docker-compose-switch.metadata @@ -0,0 +1,2 @@ +b871c471dd066837f10138366fbe837b36c7c754 SOURCES/compose-switch-1.0.5.tar.gz +f8d8411456c0f12f1a3d47a01fb47e98bd12cf88 SOURCES/vendor.tar.gz diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..76d2c39 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +SOURCES/compose-switch-1.0.5.tar.gz +SOURCES/vendor.tar.gz diff --git a/SOURCES/docker-compose-switch-rpmlintrc b/SOURCES/docker-compose-switch-rpmlintrc new file mode 100644 index 0000000..a0ad891 --- /dev/null +++ b/SOURCES/docker-compose-switch-rpmlintrc @@ -0,0 +1,9 @@ +# As this package is written in golang, it does not provide +# python*-docker-compose. But as it obsoletes the v1 package +# written in python, we get a warning. +# In addition docker-compose > 2.0.0 is provided by the +# docker-compose package, that this package requires. So it +# cannot provide what it obsoletes. +# +# The warning can therefore be ignored. +addFilter("obsolete-not-provided") diff --git a/SPECS/docker-compose-switch.spec b/SPECS/docker-compose-switch.spec new file mode 100644 index 0000000..35ad6c1 --- /dev/null +++ b/SPECS/docker-compose-switch.spec @@ -0,0 +1,86 @@ +# +# spec file for package docker-compose-switch +# +# Copyright (c) 2022 SUSE LLC +# +# All modifications and additions to the file contributed by third parties +# remain the property of their copyright owners, unless otherwise agreed +# upon. The license for this file, and modifications and additions to the +# file, is the same license as for the pristine package itself (unless the +# license for the pristine package is not an Open Source License, in which +# case the license is the MIT License). An "Open Source License" is a +# license that conforms to the Open Source Definition (Version 1.9) +# published by the Open Source Initiative. + +# Please submit bugfixes or comments via https://bugs.opensuse.org/ +# + + +%define __arch_install_post export NO_BRP_STRIP_DEBUG=true +Name: docker-compose-switch +Version: 1.0.5 +Release: 1.6 +Summary: Replacement for the docker-compose (python) executable +License: Apache-2.0 +URL: https://github.com/docker/compose-switch +Source: compose-switch-%{version}.tar.gz +Source1: vendor.tar.gz +Source99: docker-compose-switch-rpmlintrc +BuildRequires: golang(API) = 1.18 +Requires: docker +Requires: docker-compose >= 2.0 +Requires(post): update-alternatives +Requires(postun): update-alternatives +# Docker Compose V2 is a major version bump release of Docker Compose. +# It has been completely rewritten from scratch in Golang (V1 was in Python). +Obsoletes: python2-docker-compose < 2.0.0 +Obsoletes: python3-docker-compose < 2.0.0 +Obsoletes: python36-docker-compose < 2.0.0 +Obsoletes: python37-docker-compose < 2.0.0 +Obsoletes: python38-docker-compose < 2.0.0 +Obsoletes: python39-docker-compose < 2.0.0 +Obsoletes: python310-docker-compose < 2.0.0 + +%description +Compose Switch is a replacement to the Compose V1 docker-compose (python) executable. It translates the command line into Compose V2 docker compose then run the latter. + +%prep +%setup -q -a1 -n compose-switch-%{version} + +%build +go build \ + -mod=vendor \ + -buildmode=pie \ + -trimpath \ + -ldflags="-s -w -X github.com/docker/compose-switch/v2/internal.Version=%{version}" \ + -o bin/docker-compose-switch . + +%install +install -D -m 0755 bin/%{name} "%{buildroot}%{_bindir}/%{name}" +mkdir -p %{buildroot}%{_sysconfdir}/alternatives +ln -s -f %{_sysconfdir}/alternatives/docker-compose %{buildroot}%{_bindir}/docker-compose + +%post +update-alternatives --install \ + %{_bindir}/docker-compose docker-compose %{_bindir}/%{name} 2000 + +%postun +if [ ! -f %{_bindir}/%{name} ] ; then + update-alternatives --remove docker-compose %{_bindir}/%{name} +fi + +%files +%doc README.md +%license LICENSE +%{_bindir}/%{name} +%{_bindir}/docker-compose +%ghost %{_sysconfdir}/alternatives/docker-compose + +%changelog +* Tue Aug 2 2022 Dirk Müller +- add explicit golang API dependency +- cleanup +* Wed Jul 6 2022 Johannes Kastl +- add docker-compose-switch-rpmlintrc to ignore obsolete-not-provided error +* Thu Jun 30 2022 Johannes Kastl +- new package docker-compose-switch to ease the transition from docker-compose v1 (Python) to docker-compose v2 (golang), where the latter does no longer have /usr/bin/docker-compose