2 # Copyright (C) 2006-2017 OpenWrt.org
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
7 include $(TOPDIR)/rules.mk
9 PKG_NAME:=ca-certificates
14 PKG_SOURCE:=$(PKG_NAME)_$(PKG_VERSION).tar.xz
15 PKG_SOURCE_URL:=@DEBIAN/pool/main/c/ca-certificates
16 PKG_HASH:=2ae9b6dc5f40c25d6d7fe55e07b54f12a8967d1955d3b7b2f42ee46266eeef88
19 include $(INCLUDE_DIR)/package.mk
21 define Package/ca-certificates
24 TITLE:=System CA certificates
29 define Package/ca-bundle
32 TITLE:=System CA certificates as a bundle
38 $(DECOMPRESS_CMD) $(HOST_TAR) -C $(PKG_BUILD_DIR) $(TAR_OPTIONS)
46 $(PKG_INSTALL_DIR)/usr/sbin \
47 $(PKG_INSTALL_DIR)/usr/share/ca-certificates
48 $(call Build/Install/Default,)
51 define Package/ca-certificates/install
52 $(INSTALL_DIR) $(1)/etc/ssl/certs
53 $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/share/ca-certificates/*/*.crt $(1)/etc/ssl/certs/
55 for CERTFILE in `ls -1 $(1)/etc/ssl/certs`; do \
56 HASH=`openssl x509 -hash -noout -in $(1)/etc/ssl/certs/$$$$CERTFILE` ; \
58 while [ -h "$(1)/etc/ssl/certs/$$$$HASH.$$$$SUFFIX" ]; do \
61 $(LN) "$$$$CERTFILE" "$(1)/etc/ssl/certs/$$$$HASH.$$$$SUFFIX" ; \
65 define Package/ca-bundle/install
66 $(INSTALL_DIR) $(1)/etc/ssl/certs
67 cat $(PKG_INSTALL_DIR)/usr/share/ca-certificates/*/*.crt >$(1)/etc/ssl/certs/ca-certificates.crt
68 $(LN) /etc/ssl/certs/ca-certificates.crt $(1)/etc/ssl/cert.pem
70 $(eval $(call BuildPackage,ca-bundle))
71 $(eval $(call BuildPackage,ca-certificates))