|
|
a06119 |
#
|
|
|
a06119 |
# spec file for package docker-compose-switch
|
|
|
a06119 |
#
|
|
|
a06119 |
# Copyright (c) 2022 SUSE LLC
|
|
|
a06119 |
#
|
|
|
a06119 |
# All modifications and additions to the file contributed by third parties
|
|
|
a06119 |
# remain the property of their copyright owners, unless otherwise agreed
|
|
|
a06119 |
# upon. The license for this file, and modifications and additions to the
|
|
|
a06119 |
# file, is the same license as for the pristine package itself (unless the
|
|
|
a06119 |
# license for the pristine package is not an Open Source License, in which
|
|
|
a06119 |
# case the license is the MIT License). An "Open Source License" is a
|
|
|
a06119 |
# license that conforms to the Open Source Definition (Version 1.9)
|
|
|
a06119 |
# published by the Open Source Initiative.
|
|
|
a06119 |
|
|
|
a06119 |
# Please submit bugfixes or comments via https://bugs.opensuse.org/
|
|
|
a06119 |
#
|
|
|
a06119 |
|
|
|
a06119 |
|
|
|
a06119 |
%define __arch_install_post export NO_BRP_STRIP_DEBUG=true
|
|
|
a06119 |
Name: docker-compose-switch
|
|
|
a06119 |
Version: 1.0.5
|
|
|
a06119 |
Release: 0
|
|
|
a06119 |
Summary: Replacement for the docker-compose (python) executable
|
|
|
a06119 |
License: Apache-2.0
|
|
|
a06119 |
URL: https://github.com/docker/compose-switch
|
|
|
a06119 |
Source: compose-switch-%{version}.tar.gz
|
|
|
a06119 |
Source1: vendor.tar.gz
|
|
|
a06119 |
Source99: docker-compose-switch-rpmlintrc
|
|
|
a06119 |
BuildRequires: golang(API) = 1.18
|
|
|
a06119 |
Requires: docker
|
|
|
a06119 |
Requires: docker-compose >= 2.0
|
|
|
a06119 |
Requires(post): update-alternatives
|
|
|
a06119 |
Requires(postun): update-alternatives
|
|
|
a06119 |
# Docker Compose V2 is a major version bump release of Docker Compose.
|
|
|
a06119 |
# It has been completely rewritten from scratch in Golang (V1 was in Python).
|
|
|
a06119 |
Obsoletes: python2-docker-compose < 2.0.0
|
|
|
a06119 |
Obsoletes: python3-docker-compose < 2.0.0
|
|
|
a06119 |
Obsoletes: python36-docker-compose < 2.0.0
|
|
|
a06119 |
Obsoletes: python37-docker-compose < 2.0.0
|
|
|
a06119 |
Obsoletes: python38-docker-compose < 2.0.0
|
|
|
a06119 |
Obsoletes: python39-docker-compose < 2.0.0
|
|
|
a06119 |
Obsoletes: python310-docker-compose < 2.0.0
|
|
|
a06119 |
|
|
|
a06119 |
%description
|
|
|
a06119 |
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.
|
|
|
a06119 |
|
|
|
a06119 |
%prep
|
|
|
a06119 |
%setup -q -a1 -n compose-switch-%{version}
|
|
|
a06119 |
|
|
|
a06119 |
%build
|
|
|
a06119 |
go build \
|
|
|
a06119 |
-mod=vendor \
|
|
|
a06119 |
-buildmode=pie \
|
|
|
a06119 |
-trimpath \
|
|
|
a06119 |
-ldflags="-s -w -X github.com/docker/compose-switch/v2/internal.Version=%{version}" \
|
|
|
a06119 |
-o bin/docker-compose-switch .
|
|
|
a06119 |
|
|
|
a06119 |
%install
|
|
|
a06119 |
install -D -m 0755 bin/%{name} "%{buildroot}%{_bindir}/%{name}"
|
|
|
a06119 |
mkdir -p %{buildroot}%{_sysconfdir}/alternatives
|
|
|
a06119 |
ln -s -f %{_sysconfdir}/alternatives/docker-compose %{buildroot}%{_bindir}/docker-compose
|
|
|
a06119 |
|
|
|
a06119 |
%post
|
|
|
a06119 |
update-alternatives --install \
|
|
|
a06119 |
%{_bindir}/docker-compose docker-compose %{_bindir}/%{name} 2000
|
|
|
a06119 |
|
|
|
a06119 |
%postun
|
|
|
a06119 |
if [ ! -f %{_bindir}/%{name} ] ; then
|
|
|
a06119 |
update-alternatives --remove docker-compose %{_bindir}/%{name}
|
|
|
a06119 |
fi
|
|
|
a06119 |
|
|
|
a06119 |
%files
|
|
|
a06119 |
%doc README.md
|
|
|
a06119 |
%license LICENSE
|
|
|
a06119 |
%{_bindir}/%{name}
|
|
|
a06119 |
%{_bindir}/docker-compose
|
|
|
a06119 |
%ghost %{_sysconfdir}/alternatives/docker-compose
|
|
|
a06119 |
|
|
|
a06119 |
%changelog
|