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.

72 lines
2.0 KiB

  1. include $(TOPDIR)/rules.mk
  2. PKG_NAME:=docker
  3. PKG_VERSION:=20.10.16
  4. PKG_RELEASE:=$(AUTORELEASE)
  5. PKG_LICENSE:=Apache-2.0
  6. PKG_LICENSE_FILES:=LICENSE
  7. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
  8. PKG_GIT_URL:=github.com/docker/cli
  9. PKG_GIT_REF:=v$(PKG_VERSION)
  10. PKG_SOURCE_URL:=https://codeload.$(PKG_GIT_URL)/tar.gz/$(PKG_GIT_REF)?
  11. PKG_HASH:=af34131b1f08a068906336092a4dc3dfd8921c8039528cb698b32491951c33e2
  12. PKG_GIT_SHORT_COMMIT:=aa7e414 # SHA1 used within the docker executables
  13. PKG_MAINTAINER:=Gerard Ryan <G.M0N3Y.2503@gmail.com>
  14. PKG_BUILD_DEPENDS:=golang/host
  15. PKG_BUILD_PARALLEL:=1
  16. PKG_USE_MIPS16:=0
  17. GO_PKG:=$(PKG_GIT_URL)
  18. include $(INCLUDE_DIR)/package.mk
  19. include ../../lang/golang/golang-package.mk
  20. define Package/docker
  21. SECTION:=utils
  22. CATEGORY:=Utilities
  23. TITLE:=Docker Community Edition CLI
  24. URL:=https://www.docker.com/
  25. DEPENDS:=$(GO_ARCH_DEPENDS)
  26. endef
  27. define Package/docker/description
  28. The CLI used in the Docker CE and Docker EE products.
  29. endef
  30. GO_PKG_BUILD_VARS += GO111MODULE=auto
  31. TAR_OPTIONS:=--strip-components 1 $(TAR_OPTIONS)
  32. TAR_CMD=$(HOST_TAR) -C $(1) $(TAR_OPTIONS)
  33. TARGET_LDFLAGS += $(if $(CONFIG_USE_GLIBC),-lc -lgcc_eh)
  34. define Build/Prepare
  35. $(Build/Prepare/Default)
  36. # Verify PKG_GIT_SHORT_COMMIT
  37. ( \
  38. 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)' ); \
  39. if [ "$$$${EXPECTED_PKG_GIT_SHORT_COMMIT}" != "$(strip $(PKG_GIT_SHORT_COMMIT))" ]; then \
  40. echo "ERROR: Expected 'PKG_GIT_SHORT_COMMIT:=$$$${EXPECTED_PKG_GIT_SHORT_COMMIT}', found 'PKG_GIT_SHORT_COMMIT:=$(strip $(PKG_GIT_SHORT_COMMIT))'"; \
  41. exit 1; \
  42. fi \
  43. )
  44. endef
  45. define Build/Compile
  46. ( \
  47. cd $(PKG_BUILD_DIR); \
  48. $(GO_PKG_VARS) \
  49. GITCOMMIT=$(PKG_GIT_SHORT_COMMIT) \
  50. VERSION=$(PKG_VERSION) \
  51. ./scripts/build/binary; \
  52. )
  53. endef
  54. define Package/docker/install
  55. $(INSTALL_DIR) $(1)/usr/bin/
  56. $(INSTALL_BIN) $(PKG_BUILD_DIR)/build/docker $(1)/usr/bin/
  57. endef
  58. $(eval $(call BuildPackage,docker))