1
0

Makefile 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  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:=2
  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. 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/Install
  32. mkdir -p \
  33. $(PKG_INSTALL_DIR)/usr/sbin \
  34. $(PKG_INSTALL_DIR)/usr/share/ca-certificates
  35. $(call Build/Install/Default,)
  36. endef
  37. define Package/ca-certificates/install
  38. $(INSTALL_DIR) $(1)/etc/ssl/certs
  39. $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/share/ca-certificates/*/*.crt $(1)/etc/ssl/certs/
  40. for CERTFILE in `ls -1 $(1)/etc/ssl/certs`; do \
  41. HASH=`openssl x509 -hash -noout -in $(1)/etc/ssl/certs/$$$$CERTFILE` ; \
  42. SUFFIX=0 ; \
  43. while [ -h "$(1)/etc/ssl/certs/$$$$HASH.$$$$SUFFIX" ]; do \
  44. let "SUFFIX += 1" ; \
  45. done ; \
  46. $(LN) "$$$$CERTFILE" "$(1)/etc/ssl/certs/$$$$HASH.$$$$SUFFIX" ; \
  47. done
  48. endef
  49. define Package/ca-bundle/install
  50. $(INSTALL_DIR) $(1)/etc/ssl/certs
  51. cat $(PKG_INSTALL_DIR)/usr/share/ca-certificates/*/*.crt >$(1)/etc/ssl/certs/ca-certificates.crt
  52. $(LN) /etc/ssl/certs/ca-certificates.crt $(1)/etc/ssl/cert.pem
  53. endef
  54. $(eval $(call BuildPackage,ca-bundle))
  55. $(eval $(call BuildPackage,ca-certificates))