From 485ab2c9134b2ad28dd876c91c7f0c4390a60c65 Mon Sep 17 00:00:00 2001 From: eabdullin Date: Tue, 31 May 2022 10:57:05 +0300 Subject: [PATCH] Initial commit --- .docker-compose-plugin.metadata | 1 + SPECS/docker-compose-plugin.spec | 63 ++++++++++++++++++++++++++++++++ 2 files changed, 64 insertions(+) create mode 100644 .docker-compose-plugin.metadata create mode 100644 SPECS/docker-compose-plugin.spec diff --git a/.docker-compose-plugin.metadata b/.docker-compose-plugin.metadata new file mode 100644 index 0000000..0e913e1 --- /dev/null +++ b/.docker-compose-plugin.metadata @@ -0,0 +1 @@ +18d85f44f8115025c680ed1108d6ce17c3645d59 SOURCES/compose.tgz diff --git a/SPECS/docker-compose-plugin.spec b/SPECS/docker-compose-plugin.spec new file mode 100644 index 0000000..5b0478f --- /dev/null +++ b/SPECS/docker-compose-plugin.spec @@ -0,0 +1,63 @@ +%global debug_package %{nil} + +Name: docker-compose-plugin +Version: %{_compose_rpm_version} +Release: %{_release}%{?dist} +Epoch: 0 +Source0: compose.tgz +Summary: Docker Compose (V2) plugin for the Docker CLI +Group: Tools/Docker +License: ASL 2.0 +URL: https://github.com/docker/compose/ +Vendor: Docker +Packager: Docker + +BuildRequires: bash +BuildRequires: golang + +%description +Docker Compose (V2) plugin for the Docker CLI. + +This plugin provides the 'docker compose' subcommand. + +The binary can also be run standalone as a direct replacement for +Docker Compose V1 ('docker-compose'). + +%prep +%setup -q -c -n src -a 0 + +%build +pushd ${RPM_BUILD_DIR}/src/compose + # FIXME: using GOPROXY, to work around: + # go: github.com/Azure/azure-sdk-for-go@v48.2.0+incompatible: reading github.com/Azure/azure-sdk-for-go/go.mod at revision v48.2.0: unknown revision v48.2.0 + GOPROXY="https://proxy.golang.org" GO111MODULE=on go mod download + GOPROXY="https://proxy.golang.org" GO111MODULE=on GIT_TAG="%{_compose_version}" \ + make COMPOSE_BINARY="bin/docker-compose" -f builder.Makefile compose-plugin +popd + +%check +ver="$(${RPM_BUILD_ROOT}%{_libexecdir}/docker/cli-plugins/docker-compose docker-cli-plugin-metadata | awk '{ gsub(/[",:]/,"")}; $1 == "Version" { print $2 }')"; \ + test "$ver" = "%{_compose_version}" && echo "PASS: docker-compose version OK" || (echo "FAIL: docker-compose version ($ver) did not match" && exit 1) + +%install +pushd ${RPM_BUILD_DIR}/src/compose + install -D -p -m 0755 bin/docker-compose ${RPM_BUILD_ROOT}%{_libexecdir}/docker/cli-plugins/docker-compose +popd + +for f in LICENSE MAINTAINERS NOTICE README.md; do + install -D -p -m 0644 "${RPM_BUILD_DIR}/src/compose/$f" "docker-compose-plugin-docs/$f" +done + +%files +%doc docker-compose-plugin-docs/* +%license docker-compose-plugin-docs/LICENSE +%license docker-compose-plugin-docs/NOTICE +%{_libexecdir}/docker/cli-plugins/docker-compose + +%post + +%preun + +%postun + +%changelog