1
0

Makefile 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  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:=20180409
  10. PKG_RELEASE:=3
  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:=7af6f5bfc619fd29cbf0258c1d95107c38ce840ad6274e343e1e0d971fc72b51
  15. PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)
  16. PKG_INSTALL:=1
  17. include $(INCLUDE_DIR)/package.mk
  18. define Package/ca-certificates
  19. SECTION:=base
  20. CATEGORY:=Base system
  21. TITLE:=System CA certificates
  22. PKGARCH:=all
  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. endef
  30. define Build/Install
  31. mkdir -p \
  32. $(PKG_INSTALL_DIR)/usr/sbin \
  33. $(PKG_INSTALL_DIR)/usr/share/ca-certificates
  34. $(call Build/Install/Default,)
  35. endef
  36. define Package/ca-certificates/install
  37. $(INSTALL_DIR) $(1)/etc/ssl/certs
  38. $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/share/ca-certificates/*/*.crt $(1)/etc/ssl/certs/
  39. for CERTFILE in `ls -1 $(1)/etc/ssl/certs`; do \
  40. HASH=`openssl x509 -hash -noout -in $(1)/etc/ssl/certs/$$$$CERTFILE` ; \
  41. SUFFIX=0 ; \
  42. while [ -h "$(1)/etc/ssl/certs/$$$$HASH.$$$$SUFFIX" ]; do \
  43. let "SUFFIX += 1" ; \
  44. done ; \
  45. $(LN) "$$$$CERTFILE" "$(1)/etc/ssl/certs/$$$$HASH.$$$$SUFFIX" ; \
  46. done
  47. endef
  48. define Package/ca-bundle/install
  49. $(INSTALL_DIR) $(1)/etc/ssl/certs
  50. cat $(PKG_INSTALL_DIR)/usr/share/ca-certificates/*/*.crt >$(1)/etc/ssl/certs/ca-certificates.crt
  51. $(LN) /etc/ssl/certs/ca-certificates.crt $(1)/etc/ssl/cert.pem
  52. endef
  53. $(eval $(call BuildPackage,ca-certificates))
  54. $(eval $(call BuildPackage,ca-bundle))