Makefile 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. #
  2. # Copyright (C) 2006-2017 OpenWrt.org
  3. #
  4. # This is free software, licensed under the GNU General Public License v2.
  5. # See /LICENSE for more information.
  6. #
  7. include $(TOPDIR)/rules.mk
  8. PKG_NAME:=ca-certificates
  9. PKG_VERSION:=20211016
  10. PKG_RELEASE:=1
  11. PKG_MAINTAINER:=
  12. PKG_SOURCE:=$(PKG_NAME)_$(PKG_VERSION).tar.xz
  13. PKG_SOURCE_URL:=@DEBIAN/pool/main/c/ca-certificates
  14. PKG_HASH:=2ae9b6dc5f40c25d6d7fe55e07b54f12a8967d1955d3b7b2f42ee46266eeef88
  15. PKG_INSTALL:=1
  16. include $(INCLUDE_DIR)/package.mk
  17. define Package/ca-certificates
  18. SECTION:=base
  19. CATEGORY:=Base system
  20. TITLE:=System CA certificates
  21. PKGARCH:=all
  22. PROVIDES:=ca-certs
  23. endef
  24. define Package/ca-bundle
  25. SECTION:=base
  26. CATEGORY:=Base system
  27. TITLE:=System CA certificates as a bundle
  28. PKGARCH:=all
  29. PROVIDES:=ca-certs
  30. endef
  31. define Build/Prepare
  32. $(DECOMPRESS_CMD) $(HOST_TAR) -C $(PKG_BUILD_DIR) $(TAR_OPTIONS)
  33. $(Build/Patch)
  34. endef
  35. MAKE_PATH := work
  36. define Build/Install
  37. mkdir -p \
  38. $(PKG_INSTALL_DIR)/usr/sbin \
  39. $(PKG_INSTALL_DIR)/usr/share/ca-certificates
  40. $(call Build/Install/Default,)
  41. endef
  42. define Package/ca-certificates/install
  43. $(INSTALL_DIR) $(1)/etc/ssl/certs
  44. $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/share/ca-certificates/*/*.crt $(1)/etc/ssl/certs/
  45. for CERTFILE in `ls -1 $(1)/etc/ssl/certs`; do \
  46. HASH=`openssl x509 -hash -noout -in $(1)/etc/ssl/certs/$$$$CERTFILE` ; \
  47. SUFFIX=0 ; \
  48. while [ -h "$(1)/etc/ssl/certs/$$$$HASH.$$$$SUFFIX" ]; do \
  49. let "SUFFIX += 1" ; \
  50. done ; \
  51. $(LN) "$$$$CERTFILE" "$(1)/etc/ssl/certs/$$$$HASH.$$$$SUFFIX" ; \
  52. done
  53. endef
  54. define Package/ca-bundle/install
  55. $(INSTALL_DIR) $(1)/etc/ssl/certs
  56. cat $(PKG_INSTALL_DIR)/usr/share/ca-certificates/*/*.crt >$(1)/etc/ssl/certs/ca-certificates.crt
  57. $(LN) /etc/ssl/certs/ca-certificates.crt $(1)/etc/ssl/cert.pem
  58. endef
  59. $(eval $(call BuildPackage,ca-bundle))
  60. $(eval $(call BuildPackage,ca-certificates))