Makefile 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  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:=20190110
  10. PKG_RELEASE:=1
  11. PKG_MAINTAINER:=
  12. PKG_SOURCE:=$(PKG_NAME)_$(PKG_VERSION).tar.xz
  13. PKG_SOURCE_URL:=http://ftp.debian.org/debian/pool/main/c/ca-certificates
  14. PKG_HASH:=ee4bf0f4c6398005f5b5ca4e0b87b82837ac5c3b0280a1cb3a63c47555c3a675
  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. endef
  23. define Package/ca-bundle
  24. SECTION:=base
  25. CATEGORY:=Base system
  26. TITLE:=System CA certificates as a bundle
  27. PKGARCH:=all
  28. endef
  29. define Build/Install
  30. mkdir -p \
  31. $(PKG_INSTALL_DIR)/usr/sbin \
  32. $(PKG_INSTALL_DIR)/usr/share/ca-certificates
  33. $(call Build/Install/Default,)
  34. endef
  35. define Package/ca-certificates/install
  36. $(INSTALL_DIR) $(1)/etc/ssl/certs
  37. $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/share/ca-certificates/*/*.crt $(1)/etc/ssl/certs/
  38. for CERTFILE in `ls -1 $(1)/etc/ssl/certs`; do \
  39. HASH=`openssl x509 -hash -noout -in $(1)/etc/ssl/certs/$$$$CERTFILE` ; \
  40. SUFFIX=0 ; \
  41. while [ -h "$(1)/etc/ssl/certs/$$$$HASH.$$$$SUFFIX" ]; do \
  42. let "SUFFIX += 1" ; \
  43. done ; \
  44. $(LN) "$$$$CERTFILE" "$(1)/etc/ssl/certs/$$$$HASH.$$$$SUFFIX" ; \
  45. done
  46. endef
  47. define Package/ca-bundle/install
  48. $(INSTALL_DIR) $(1)/etc/ssl/certs
  49. cat $(PKG_INSTALL_DIR)/usr/share/ca-certificates/*/*.crt >$(1)/etc/ssl/certs/ca-certificates.crt
  50. $(LN) /etc/ssl/certs/ca-certificates.crt $(1)/etc/ssl/cert.pem
  51. endef
  52. $(eval $(call BuildPackage,ca-certificates))
  53. $(eval $(call BuildPackage,ca-bundle))