Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pkg/buildx/deb/rules
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ override_dh_dwz:
@# https://packages.ubuntu.com/debhelper

override_dh_auto_install:
install -D -m 0755 /usr/libexec/docker/cli-plugins/docker-buildx debian/docker-buildx-plugin/usr/libexec/docker/cli-plugins/docker-buildx
install -D -p -m 0755 /usr/libexec/docker/cli-plugins/docker-buildx debian/docker-buildx-plugin/usr/libexec/docker/cli-plugins/docker-buildx

override_dh_installinit:
dh_installinit
Expand Down
2 changes: 1 addition & 1 deletion pkg/compose/deb/rules
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ override_dh_dwz:
@# https://packages.ubuntu.com/debhelper

override_dh_auto_install:
install -D -m 0755 /usr/libexec/docker/cli-plugins/docker-compose debian/docker-compose-plugin/usr/libexec/docker/cli-plugins/docker-compose
install -D -p -m 0755 /usr/libexec/docker/cli-plugins/docker-compose debian/docker-compose-plugin/usr/libexec/docker/cli-plugins/docker-compose

override_dh_installinit:
dh_installinit
Expand Down
8 changes: 4 additions & 4 deletions pkg/containerd/deb/rules
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ man: ## Create containerd man pages
# copy the generated man pages instead of using "make install-man" to allow
# dh_installman doing its magic
install -d man
install -D -m 0644 /go/src/github.com/containerd/containerd/man/* man
install -D -p -m 0644 /go/src/github.com/containerd/containerd/man/* man

# force packages to be built with xz compression, as Ubuntu 21.10 and up use
# zstd compression, which is non-standard, and breaks 'dpkg-sig --verify'
Expand All @@ -65,6 +65,6 @@ override_dh_systemd_start:

override_dh_auto_install: binaries bin/runc man
mkdir -p debian/containerd.io/usr/bin
install -D -m 0755 bin/* debian/containerd.io/usr/bin
install -D -m 0644 /common/containerd.service debian/containerd.io/lib/systemd/system/containerd.service
install -D -m 0644 /common/containerd.toml debian/containerd.io/etc/containerd/config.toml
install -D -p -m 0755 bin/* debian/containerd.io/usr/bin
install -D -p -m 0644 /common/containerd.service debian/containerd.io/lib/systemd/system/containerd.service
install -D -p -m 0644 /common/containerd.toml debian/containerd.io/etc/containerd/config.toml
6 changes: 3 additions & 3 deletions pkg/containerd/rpm/containerd.spec
Original file line number Diff line number Diff line change
Expand Up @@ -110,9 +110,9 @@ GO111MODULE=auto make -C /go/src/github.com/opencontainers/runc BINDIR=%{_buildd
%install
cd %{_builddir}
mkdir -p %{buildroot}%{_bindir}
install -D -m 0755 bin/* %{buildroot}%{_bindir}
install -D -m 0644 %{S:1} %{buildroot}%{_unitdir}/containerd.service
install -D -m 0644 %{S:2} %{buildroot}%{_sysconfdir}/containerd/config.toml
install -D -p -m 0755 bin/* %{buildroot}%{_bindir}
install -D -p -m 0644 %{S:1} %{buildroot}%{_unitdir}/containerd.service
install -D -p -m 0644 %{S:2} %{buildroot}%{_sysconfdir}/containerd/config.toml

# install manpages, taking into account that not all sections may be present
for i in $(seq 1 8); do
Expand Down
4 changes: 2 additions & 2 deletions pkg/credential-helpers/deb/rules
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ override_dh_dwz:
@# https://packages.ubuntu.com/debhelper

override_dh_auto_install:
install -D bin/docker-credential-secretservice debian/docker-credential-secretservice/usr/bin/docker-credential-secretservice
install -D bin/docker-credential-pass debian/docker-credential-pass/usr/bin/docker-credential-pass
install -D -p -m 0755 bin/docker-credential-secretservice debian/docker-credential-secretservice/usr/bin/docker-credential-secretservice
install -D -p -m 0755 bin/docker-credential-pass debian/docker-credential-pass/usr/bin/docker-credential-pass

override_dh_auto_test:
ver="$$(bin/docker-credential-secretservice version)"; \
Expand Down
1 change: 0 additions & 1 deletion pkg/docker-cli/deb/docker-ce-cli.bash-completion

This file was deleted.

39 changes: 34 additions & 5 deletions pkg/docker-cli/deb/rules
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ override_dh_auto_build:
mkdir -p /go/src/github.com/docker && \
ln -snf $(CURDIR)/cli /go/src/github.com/docker/cli && \
cd /go/src/github.com/docker/cli && \
VERSION=$(VERSION) GITCOMMIT=$(REVISION) LDFLAGS='' GO_LINKMODE=dynamic ./scripts/build/binary && \
DISABLE_WARN_OUTSIDE_CONTAINER=1 LDFLAGS='' make manpages shell-completion
make DISABLE_WARN_OUTSIDE_CONTAINER=1 VERSION=$(VERSION) GITCOMMIT=$(REVISION) LDFLAGS='' dynbinary manpages shell-completion

override_dh_auto_test:
ver="$$(cli/build/docker --version)"; \
Expand All @@ -26,9 +25,39 @@ override_dh_dwz:
@# https://packages.ubuntu.com/debhelper

override_dh_auto_install:
install -D -m 0644 cli/build/completion/fish/docker.fish debian/docker-ce-cli/usr/share/fish/vendor_completions.d/docker.fish
install -D -m 0644 cli/build/completion/zsh/_docker debian/docker-ce-cli/usr/share/zsh/vendor-completions/_docker
install -D -m 0755 cli/build/docker debian/docker-ce-cli/usr/bin/docker
install -D -p -m 0755 cli/build/docker debian/docker-ce-cli/usr/bin/docker

# docker-ce-cli shell-completion
#
# We are manually installing bash completions instead of using the "dh_bash-completion"
# debhelper (see [1]); dh_bash-completion only supports bash, and none of the other shells,
# which meant that we had to install 2 out of 3 manually, which was confusing ("what about
# Bash?"). Given that locations to install these completion scripts are well-known, we
# can safely use the manual approach for installing them.
#
# In future, can consider using "dh_shell_completions" (see [2]), which supports bash, zsh
# and fish. However, "dh_shell_completions" is still really premature, and not available
# in stable releases. So, currently, adding it as build-dependency, especially since
# these are well-known, may not be a good choice, but we can revisit that in future
# if things mature in this area.
#
# Observant readers may notice that we don't include PowerShell completion in
# this list (even though Cobra provides them, and PowerShell *can* be installed
# oon Linux). The short story is that there's no well-defined location, nor
# a well-defined approach for this.
#
# The PowerShell maintainers (see [3]) considering that no completion scripts
# are needed for anything following the PowerShell specifications, and for
# anything else, PowerShell is capable enough to use zsh and bash completions.
#
# All of the above taken into account; it's fuzzy enough to just leave it as
# an exercise for the user to decide what to do.
#
# [1]: https://manpages.debian.org/bookworm/bash-completion/dh_bash-completion.1.en.html
# [2]: https://manpages.debian.org/testing/dh-shell-completions/dh_shell_completions.1.en.html
# [3]: https://github.com/PowerShell/PowerShell/issues/17582
install -D -p -m 0644 cli/build/completion/fish/docker.fish debian/docker-ce-cli/usr/share/fish/vendor_completions.d/docker.fish
install -D -p -m 0644 cli/build/completion/zsh/_docker debian/docker-ce-cli/usr/share/zsh/vendor-completions/_docker

override_dh_installinit:
dh_installinit
Expand Down
16 changes: 6 additions & 10 deletions pkg/docker-cli/rpm/docker-ce-cli.spec
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ mkdir -p /go/src/github.com/docker
rm -f /go/src/github.com/docker/cli
ln -snf ${RPM_BUILD_DIR}/src/cli /go/src/github.com/docker/cli
pushd /go/src/github.com/docker/cli
VERSION=%{_origversion} GITCOMMIT=%{_commit} GO_LINKMODE=dynamic ./scripts/build/binary && DISABLE_WARN_OUTSIDE_CONTAINER=1 make manpages shell-completion
make DISABLE_WARN_OUTSIDE_CONTAINER=1 VERSION=%{_origversion} GITCOMMIT=%{_commit} dynbinary manpages shell-completion
popd

%check
Expand All @@ -55,16 +55,12 @@ ver="$(cli/build/docker --version)"; \

%install
# install binary
install -d ${RPM_BUILD_ROOT}%{_bindir}
install -p -m 755 cli/build/docker ${RPM_BUILD_ROOT}%{_bindir}/docker
install -D -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/build/completion/bash/docker ${RPM_BUILD_ROOT}%{_datadir}/bash-completion/completions/docker
install -p -m 644 cli/build/completion/zsh/_docker ${RPM_BUILD_ROOT}%{_datadir}/zsh/vendor-completions/_docker
install -p -m 644 cli/build/completion/fish/docker.fish ${RPM_BUILD_ROOT}%{_datadir}/fish/vendor_completions.d/docker.fish
install -D -p -m 644 cli/build/completion/bash/docker ${RPM_BUILD_ROOT}%{_datadir}/bash-completion/completions/docker
install -D -p -m 644 cli/build/completion/zsh/_docker ${RPM_BUILD_ROOT}%{_datadir}/zsh/vendor-completions/_docker
install -D -p -m 644 cli/build/completion/fish/docker.fish ${RPM_BUILD_ROOT}%{_datadir}/fish/vendor_completions.d/docker.fish

# install man-pages
for sec in $(seq 1 9); do
Expand All @@ -77,7 +73,7 @@ done

mkdir -p build-docs
for cli_file in LICENSE MAINTAINERS NOTICE README.md; do
cp "cli/$cli_file" "build-docs/$cli_file"
install -D -p -m 644 "cli/$cli_file" "build-docs/$cli_file"
done

%files
Expand Down
2 changes: 1 addition & 1 deletion pkg/docker-cli/scripts/pkg-deb-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,6 @@ mkdir -p "${pkgoutput}"

set -x

chmod -x debian/control debian/docs debian/*.bash-completion debian/*.manpages
chmod -x debian/control debian/docs debian/*.manpages
VERSION=${GENVER_VERSION} REVISION=${GENVER_COMMIT} dpkg-buildpackage $PKG_DEB_BUILDFLAGS --host-arch $(xx-info debian-arch) --target-arch $(xx-info debian-arch)
cp /root/docker-* "${pkgoutput}"/
16 changes: 8 additions & 8 deletions pkg/docker-engine/deb/rules
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,16 @@ override_dh_dwz:
@# https://packages.ubuntu.com/debhelper

override_dh_auto_install:
install -D -m 0644 /common/systemd/docker.service debian/docker-ce/lib/systemd/system/docker.service
install -D -m 0644 /common/systemd/docker.socket debian/docker-ce/lib/systemd/system/docker.socket
install -D -m 0755 $(shell readlink -e engine/bundles/dynbinary-daemon/dockerd) debian/docker-ce/usr/bin/dockerd
install -D -m 0755 $(shell readlink -e engine/bundles/dynbinary-daemon/docker-proxy) debian/docker-ce/usr/bin/docker-proxy
install -D -m 0755 /usr/local/bin/docker-init debian/docker-ce/usr/libexec/docker/docker-init
install -D -p -m 0644 /common/systemd/docker.service debian/docker-ce/lib/systemd/system/docker.service
install -D -p -m 0644 /common/systemd/docker.socket debian/docker-ce/lib/systemd/system/docker.socket
install -D -p -m 0755 $(shell readlink -e engine/bundles/dynbinary-daemon/dockerd) debian/docker-ce/usr/bin/dockerd
install -D -p -m 0755 $(shell readlink -e engine/bundles/dynbinary-daemon/docker-proxy) debian/docker-ce/usr/bin/docker-proxy
install -D -p -m 0755 /usr/local/bin/docker-init debian/docker-ce/usr/libexec/docker/docker-init

# docker-ce-rootless-extras install
install -D -m 0755 /usr/local/bin/rootlesskit debian/docker-ce-rootless-extras/usr/bin/rootlesskit
install -D -m 0755 engine/contrib/dockerd-rootless.sh debian/docker-ce-rootless-extras/usr/bin/dockerd-rootless.sh
install -D -m 0755 engine/contrib/dockerd-rootless-setuptool.sh debian/docker-ce-rootless-extras/usr/bin/dockerd-rootless-setuptool.sh
install -D -p -m 0755 /usr/local/bin/rootlesskit debian/docker-ce-rootless-extras/usr/bin/rootlesskit
install -D -p -m 0755 engine/contrib/dockerd-rootless.sh debian/docker-ce-rootless-extras/usr/bin/dockerd-rootless.sh
install -D -p -m 0755 engine/contrib/dockerd-rootless-setuptool.sh debian/docker-ce-rootless-extras/usr/bin/dockerd-rootless-setuptool.sh
# TODO: how can we install vpnkit?

override_dh_installinit:
Expand Down
4 changes: 2 additions & 2 deletions pkg/docker-engine/rpm/docker-ce.spec
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,8 @@ install -D -p -m 0755 $(readlink -f engine/bundles/dynbinary-daemon/docker-proxy
install -D -p -m 0755 /usr/local/bin/docker-init ${RPM_BUILD_ROOT}%{_libexecdir}/docker/docker-init

# install systemd scripts
install -D -m 0644 engine/contrib/init/systemd/docker.service ${RPM_BUILD_ROOT}%{_unitdir}/docker.service
install -D -m 0644 engine/contrib/init/systemd/docker.socket ${RPM_BUILD_ROOT}%{_unitdir}/docker.socket
install -D -p -m 0644 engine/contrib/init/systemd/docker.service ${RPM_BUILD_ROOT}%{_unitdir}/docker.service
install -D -p -m 0644 engine/contrib/init/systemd/docker.socket ${RPM_BUILD_ROOT}%{_unitdir}/docker.socket

# install manpages
make -C ${RPM_BUILD_DIR}/src/engine/man DESTDIR=${RPM_BUILD_ROOT} mandir=%{_mandir} install
Expand Down
2 changes: 1 addition & 1 deletion pkg/sbom/deb/rules
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ override_dh_dwz:
@# https://packages.ubuntu.com/debhelper

override_dh_auto_install:
install -D -m 0755 /usr/libexec/docker/cli-plugins/docker-sbom debian/docker-sbom-plugin/usr/libexec/docker/cli-plugins/docker-sbom
install -D -p -m 0755 /usr/libexec/docker/cli-plugins/docker-sbom debian/docker-sbom-plugin/usr/libexec/docker/cli-plugins/docker-sbom

override_dh_installinit:
dh_installinit
Expand Down
2 changes: 1 addition & 1 deletion pkg/scan/deb/rules
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ override_dh_strip:
# Go has lots of problems with stripping, so just don't

override_dh_auto_install:
install -D -m 0755 /usr/libexec/docker/cli-plugins/docker-scan debian/docker-scan-plugin/usr/libexec/docker/cli-plugins/docker-scan
install -D -p -m 0755 /usr/libexec/docker/cli-plugins/docker-scan debian/docker-scan-plugin/usr/libexec/docker/cli-plugins/docker-scan

override_dh_installinit:
dh_installinit
Expand Down