ca-certificates: update to version 20190110
[openwrt/staging/dedeckeh.git] / package / system / ca-certificates / Makefile
index eb44196ad823ec9a015e7cf443cd992df283b93c..f449645c777afd9ebea843ffefb9ac51f06d941b 100644 (file)
@@ -1,5 +1,5 @@
-# 
-# Copyright (C) 2006 OpenWrt.org
+#
+# Copyright (C) 2006-2017 OpenWrt.org
 #
 # This is free software, licensed under the GNU General Public License v2.
 # See /LICENSE for more information.
@@ -7,12 +7,13 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=ca-certificates
-PKG_VERSION:=20140223
+PKG_VERSION:=20190110
+PKG_RELEASE:=1
+PKG_MAINTAINER:=
 
 PKG_SOURCE:=$(PKG_NAME)_$(PKG_VERSION).tar.xz
-PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)
 PKG_SOURCE_URL:=http://ftp.debian.org/debian/pool/main/c/ca-certificates
-PKG_MD5SUM:=ff4049c32342ea450cda82bb14026ffd
+PKG_HASH:=ee4bf0f4c6398005f5b5ca4e0b87b82837ac5c3b0280a1cb3a63c47555c3a675
 
 PKG_INSTALL:=1
 
@@ -22,6 +23,14 @@ define Package/ca-certificates
   SECTION:=base
   CATEGORY:=Base system
   TITLE:=System CA certificates
+  PKGARCH:=all
+endef
+
+define Package/ca-bundle
+  SECTION:=base
+  CATEGORY:=Base system
+  TITLE:=System CA certificates as a bundle
+  PKGARCH:=all
 endef
 
 define Build/Install
@@ -34,6 +43,21 @@ endef
 define Package/ca-certificates/install
        $(INSTALL_DIR) $(1)/etc/ssl/certs
        $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/share/ca-certificates/*/*.crt $(1)/etc/ssl/certs/
+
+       for CERTFILE in `ls -1 $(1)/etc/ssl/certs`; do \
+               HASH=`openssl x509 -hash -noout -in $(1)/etc/ssl/certs/$$$$CERTFILE` ; \
+               SUFFIX=0 ; \
+               while [ -h "$(1)/etc/ssl/certs/$$$$HASH.$$$$SUFFIX" ]; do \
+                       let "SUFFIX += 1" ; \
+               done ; \
+               $(LN) "$$$$CERTFILE" "$(1)/etc/ssl/certs/$$$$HASH.$$$$SUFFIX" ; \
+       done
 endef
 
+define Package/ca-bundle/install
+       $(INSTALL_DIR) $(1)/etc/ssl/certs
+       cat $(PKG_INSTALL_DIR)/usr/share/ca-certificates/*/*.crt >$(1)/etc/ssl/certs/ca-certificates.crt
+       $(LN) /etc/ssl/certs/ca-certificates.crt $(1)/etc/ssl/cert.pem
+endef
 $(eval $(call BuildPackage,ca-certificates))
+$(eval $(call BuildPackage,ca-bundle))