You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
docker-ce-cli/SPECS/docker-ce-cli.spec

129 lines
4.1 KiB

%global debug_package %{nil}
%global _version 27.2.1
%global _release 1
%global _origversion %{_version}
Summary: The open-source application container engine
Name: docker-ce-cli
Version: %{_version}
Release: %{_release}%{?dist}.inferit
Epoch: 1
URL: https://www.docker.com
License: ASL 2.0
Source0: cli.tgz
Source1: man.tgz
# required packages on install
Requires: /bin/sh
Requires: /usr/sbin/groupadd
# CentOS 7 and RHEL 7 do not yet support weak dependencies
#
# Note that we're not using <= 7 here, to account for other RPM distros, such
# as Fedora, which would not have the rhel macro set (so default to 0).
%if 0%{?rhel} == 7
Requires: docker-buildx-plugin
Requires: docker-compose-plugin
%else
Recommends: docker-buildx-plugin
Recommends: docker-compose-plugin
%endif
BuildRequires: make
BuildRequires: golang
BuildRequires: libtool-ltdl-devel
BuildRequires: git
BuildRequires: kernel-rpm-macros
# conflicting packages
Conflicts: docker
Conflicts: docker-io
Conflicts: docker-ee
Conflicts: docker-ee-cli
%description
Docker is is a product for you to build, ship and run any application as a
lightweight container.
Docker containers are both hardware-agnostic and platform-agnostic. This means
they can run anywhere, from your laptop to the largest cloud compute instance
and everything in between - and they don't require you to use a particular
language, framework or packaging system. That makes them great building blocks
for deploying and scaling web apps, databases, and backend services without
depending on a particular stack or provider.
%prep
%setup -q -c -n src -a 1
%build
mkdir -p ${RPM_BUILD_DIR}/go/src/github.com/docker
rm -f ${RPM_BUILD_DIR}/go/src/github.com/docker/cli
ln -s ${RPM_BUILD_DIR}/src/cli ${RPM_BUILD_DIR}/go/src/github.com/docker/cli
pushd ${RPM_BUILD_DIR}/go/src/github.com/docker/cli
GOPATH="${RPM_BUILD_DIR}/go" VERSION=%{_origversion} GITCOMMIT=%{_gitcommit_cli} GO_LINKMODE=dynamic ./scripts/build/binary
popd
%check
ver="$(cli/build/docker --version)"; \
test "$ver" = "Docker version %{_origversion}, build %{_gitcommit_cli}" && echo "PASS: cli version OK" || (echo "FAIL: cli version ($ver) did not match" && exit 1)
%install
# install binary
install -d ${RPM_BUILD_ROOT}%{_bindir}
install -p -m 755 cli/build/docker ${RPM_BUILD_ROOT}%{_bindir}/docker
# add bash, zsh, and fish completions
install -d ${RPM_BUILD_ROOT}%{_datadir}/bash-completion/completions
install -d ${RPM_BUILD_ROOT}%{_datadir}/zsh/vendor-completions
install -d ${RPM_BUILD_ROOT}%{_datadir}/fish/vendor_completions.d
install -p -m 644 cli/contrib/completion/bash/docker ${RPM_BUILD_ROOT}%{_datadir}/bash-completion/completions/docker
install -p -m 644 cli/contrib/completion/zsh/_docker ${RPM_BUILD_ROOT}%{_datadir}/zsh/vendor-completions/_docker
install -p -m 644 cli/contrib/completion/fish/docker.fish ${RPM_BUILD_ROOT}%{_datadir}/fish/vendor_completions.d/docker.fish
# install manpages
install -d ${RPM_BUILD_ROOT}%{_mandir}/man1
install -p -m 644 man/man1/*.1.gz ${RPM_BUILD_ROOT}%{_mandir}/man1
install -d ${RPM_BUILD_ROOT}%{_mandir}/man5
install -p -m 644 man/man5/*.5.gz ${RPM_BUILD_ROOT}%{_mandir}/man5
install -d ${RPM_BUILD_ROOT}%{_mandir}/man8
install -p -m 644 man/man8/*.8.gz ${RPM_BUILD_ROOT}%{_mandir}/man8
mkdir -p build-docs
for cli_file in LICENSE MAINTAINERS NOTICE README.md; do
cp "cli/$cli_file" "build-docs/$cli_file"
done
# list files owned by the package here
%files
%doc build-docs/LICENSE build-docs/MAINTAINERS build-docs/NOTICE build-docs/README.md
%{_bindir}/docker
%{_datadir}/bash-completion/completions/docker
%{_datadir}/zsh/vendor-completions/_docker
%{_datadir}/fish/vendor_completions.d/docker.fish
%doc
%{_mandir}/man1/*
%{_mandir}/man5/*
%{_mandir}/man8/*
%post
if ! getent group docker > /dev/null; then
groupadd --system docker
fi
%changelog
* Tue Sep 18 2024 Dmitry Samoylik <Dmitriy.Samoylik@softline.com> - 27.2.1-1.inferit
- Update to 27.2.1
* Tue Aug 06 2024 Arkady L. Shane <tigro@msvsphere-os.ru> - 1:27.1.1-1.inferit
- Update to 27.1.1
- Clean up spec
* Tue Jul 23 2024 Sergey Cherevko <s.cherevko@msvsphere-os.ru> - 1:27.0.3-1.inferit
- Adapted for MSVphere 9 build
- Rebuilt for MSVSphere 9.4