From d01abf10388d9383c6d679df9aaddc5c95d4184cf1a9ed7559e678ca3934f384 Mon Sep 17 00:00:00 2001 From: Dirk Mueller Date: Tue, 2 Aug 2022 09:23:27 +0000 Subject: [PATCH] Accepting request 987335 from home:ojkastl_buildservice:docker_compose_etc new package docker-compose-switch: 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. OBS-URL: https://build.opensuse.org/request/show/987335 OBS-URL: https://build.opensuse.org/package/show/Virtualization:containers/docker-compose-switch?expand=0&rev=1 --- .gitattributes | 23 ++++++++++ _service | 21 +++++++++ _servicedata | 4 ++ compose-switch-1.0.5.tar.gz | 3 ++ docker-compose-switch-rpmlintrc | 9 ++++ docker-compose-switch.changes | 9 ++++ docker-compose-switch.spec | 80 +++++++++++++++++++++++++++++++++ vendor.tar.gz | 3 ++ 8 files changed, 152 insertions(+) create mode 100644 .gitattributes create mode 100644 _service create mode 100644 _servicedata create mode 100644 compose-switch-1.0.5.tar.gz create mode 100644 docker-compose-switch-rpmlintrc create mode 100644 docker-compose-switch.changes create mode 100644 docker-compose-switch.spec create mode 100644 vendor.tar.gz diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..9b03811 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,23 @@ +## Default LFS +*.7z filter=lfs diff=lfs merge=lfs -text +*.bsp filter=lfs diff=lfs merge=lfs -text +*.bz2 filter=lfs diff=lfs merge=lfs -text +*.gem filter=lfs diff=lfs merge=lfs -text +*.gz filter=lfs diff=lfs merge=lfs -text +*.jar filter=lfs diff=lfs merge=lfs -text +*.lz filter=lfs diff=lfs merge=lfs -text +*.lzma filter=lfs diff=lfs merge=lfs -text +*.obscpio filter=lfs diff=lfs merge=lfs -text +*.oxt filter=lfs diff=lfs merge=lfs -text +*.pdf filter=lfs diff=lfs merge=lfs -text +*.png filter=lfs diff=lfs merge=lfs -text +*.rpm filter=lfs diff=lfs merge=lfs -text +*.tbz filter=lfs diff=lfs merge=lfs -text +*.tbz2 filter=lfs diff=lfs merge=lfs -text +*.tgz filter=lfs diff=lfs merge=lfs -text +*.ttf filter=lfs diff=lfs merge=lfs -text +*.txz filter=lfs diff=lfs merge=lfs -text +*.whl filter=lfs diff=lfs merge=lfs -text +*.xz filter=lfs diff=lfs merge=lfs -text +*.zip filter=lfs diff=lfs merge=lfs -text +*.zst filter=lfs diff=lfs merge=lfs -text diff --git a/_service b/_service new file mode 100644 index 0000000..5075812 --- /dev/null +++ b/_service @@ -0,0 +1,21 @@ + + + https://github.com/docker/compose-switch + git + .git + v1.0.5 + @PARENT_TAG@ + enable + v(.*) + + + compose-switch + + + *.tar + gz + + + compose-switch-1.0.5.tar.gz + + diff --git a/_servicedata b/_servicedata new file mode 100644 index 0000000..c764d71 --- /dev/null +++ b/_servicedata @@ -0,0 +1,4 @@ + + + https://github.com/docker/compose-switch + c108cab13aa8ace270da9133f127f83f491121f0 \ No newline at end of file diff --git a/compose-switch-1.0.5.tar.gz b/compose-switch-1.0.5.tar.gz new file mode 100644 index 0000000..11a13fc --- /dev/null +++ b/compose-switch-1.0.5.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4000f622093e67777b4c160137be7c3cda44ac22105ea72b30f74126d39aeaf8 +size 23133 diff --git a/docker-compose-switch-rpmlintrc b/docker-compose-switch-rpmlintrc new file mode 100644 index 0000000..0458c4f --- /dev/null +++ b/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/docker-compose-switch.changes b/docker-compose-switch.changes new file mode 100644 index 0000000..4234ff9 --- /dev/null +++ b/docker-compose-switch.changes @@ -0,0 +1,9 @@ +------------------------------------------------------------------- +Wed Jul 6 18:02:54 UTC 2022 - Johannes Kastl + +- add docker-compose-switch-rpmlintrc to ignore obsolete-not-provided error + +------------------------------------------------------------------- +Thu Jun 30 11:06:29 UTC 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 diff --git a/docker-compose-switch.spec b/docker-compose-switch.spec new file mode 100644 index 0000000..8a13b0a --- /dev/null +++ b/docker-compose-switch.spec @@ -0,0 +1,80 @@ +# +# 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: 0 +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 +BuildRequires: go >= 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 -n compose-switch-%{version} +%setup -q -T -D -a 1 -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 diff --git a/vendor.tar.gz b/vendor.tar.gz new file mode 100644 index 0000000..7566702 --- /dev/null +++ b/vendor.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0483fafbbe38fe3f1d63d70878740a5ec1fbd12186e90c6b689374d342541348 +size 331753