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.

71 lines
1.9 KiB

  1. include $(TOPDIR)/rules.mk
  2. PKG_NAME:=docker
  3. PKG_VERSION:=20.10.5
  4. PKG_RELEASE:=1
  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:=4ba845f8c7e2e0a2ca1ec6589847159ca8d0d37b609f0e6f78def7a893b9b342
  12. PKG_GIT_SHORT_COMMIT:=55c4c88 # 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. define Build/Prepare
  34. $(Build/Prepare/Default)
  35. # Verify PKG_GIT_SHORT_COMMIT
  36. ( \
  37. 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)' ); \
  38. if [ "$$$${EXPECTED_PKG_GIT_SHORT_COMMIT}" != "$(strip $(PKG_GIT_SHORT_COMMIT))" ]; then \
  39. echo "ERROR: Expected 'PKG_GIT_SHORT_COMMIT:=$$$${EXPECTED_PKG_GIT_SHORT_COMMIT}', found 'PKG_GIT_SHORT_COMMIT:=$(strip $(PKG_GIT_SHORT_COMMIT))'"; \
  40. exit 1; \
  41. fi \
  42. )
  43. endef
  44. define Build/Compile
  45. ( \
  46. cd $(PKG_BUILD_DIR); \
  47. $(GO_PKG_VARS) \
  48. GITCOMMIT=$(PKG_GIT_SHORT_COMMIT) \
  49. VERSION=$(PKG_VERSION) \
  50. ./scripts/build/binary; \
  51. )
  52. endef
  53. define Package/docker/install
  54. $(INSTALL_DIR) $(1)/usr/bin/
  55. $(INSTALL_BIN) $(PKG_BUILD_DIR)/build/docker $(1)/usr/bin/
  56. endef
  57. $(eval $(call BuildPackage,docker))