From 4c4f1b34fb1cd26cd6a398258d123eca3cd7ac41 Mon Sep 17 00:00:00 2001 From: kenzok8 Date: Thu, 24 Oct 2024 16:37:51 +0800 Subject: [PATCH] update 2024-10-24 16:37:51 --- docker/Makefile | 75 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 75 insertions(+) create mode 100644 docker/Makefile diff --git a/docker/Makefile b/docker/Makefile new file mode 100644 index 000000000..58b43334a --- /dev/null +++ b/docker/Makefile @@ -0,0 +1,75 @@ +include $(TOPDIR)/rules.mk + +PKG_NAME:=docker +PKG_VERSION:=27.3.1 +PKG_RELEASE:=1 +PKG_LICENSE:=Apache-2.0 +PKG_LICENSE_FILES:=LICENSE + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_GIT_URL:=github.com/docker/cli +PKG_GIT_REF:=v$(PKG_VERSION) +PKG_SOURCE_URL:=https://codeload.$(PKG_GIT_URL)/tar.gz/$(PKG_GIT_REF)? +PKG_HASH:=df7d44387166d90954e290dfbe0a278649bf71d0e89933615bdc0757580b68e4 +PKG_GIT_SHORT_COMMIT:=ce12230 # SHA1 used within the docker executables + +PKG_MAINTAINER:=Gerard Ryan + +PKG_BUILD_DEPENDS:=golang/host +PKG_BUILD_PARALLEL:=1 +PKG_BUILD_FLAGS:=no-mips16 + +GO_PKG:=$(PKG_GIT_URL) + +include $(INCLUDE_DIR)/package.mk +include $(TOPDIR)/feeds/packages/lang/golang/golang-package.mk + +define Package/docker + SECTION:=utils + CATEGORY:=Utilities + TITLE:=Docker Community Edition CLI + URL:=https://www.docker.com/ + DEPENDS:=$(GO_ARCH_DEPENDS) +endef + +define Package/docker/description +The CLI used in the Docker CE and Docker EE products. +endef + +GO_PKG_INSTALL_EXTRA:=\ + cli/compose/schema/data \ + vendor/google.golang.org/protobuf/internal/editiondefaults/editions_defaults.binpb + +TAR_OPTIONS:=--strip-components 1 $(TAR_OPTIONS) +TAR_CMD=$(HOST_TAR) -C $(1) $(TAR_OPTIONS) +TARGET_LDFLAGS += $(if $(CONFIG_USE_GLIBC),-lc -lgcc_eh) + +define Build/Prepare + $(Build/Prepare/Default) + + # Verify PKG_GIT_SHORT_COMMIT + ( \ + EXPECTED_PKG_GIT_SHORT_COMMIT=$$$$( $(CURDIR)/../dockerd/git-short-commit.sh '$(PKG_GIT_URL)' '$(PKG_GIT_REF)' '$(TMP_DIR)/git-short-commit/$(PKG_NAME)-$(PKG_VERSION)' ); \ + if [ "$$$${EXPECTED_PKG_GIT_SHORT_COMMIT}" != "$(strip $(PKG_GIT_SHORT_COMMIT))" ]; then \ + echo "ERROR: Expected 'PKG_GIT_SHORT_COMMIT:=$$$${EXPECTED_PKG_GIT_SHORT_COMMIT}', found 'PKG_GIT_SHORT_COMMIT:=$(strip $(PKG_GIT_SHORT_COMMIT))'"; \ + exit 1; \ + fi \ + ) +endef + +define Build/Compile + ( \ + cd $(PKG_BUILD_DIR); \ + $(GO_PKG_VARS) \ + GITCOMMIT=$(PKG_GIT_SHORT_COMMIT) \ + VERSION=$(PKG_VERSION) \ + ./scripts/build/binary; \ + ) +endef + +define Package/docker/install + $(INSTALL_DIR) $(1)/usr/bin/ + $(INSTALL_BIN) $(PKG_BUILD_DIR)/build/docker $(1)/usr/bin/ +endef + +$(eval $(call BuildPackage,docker))