ca-certificates: update to version 20161102
[openwrt/staging/mkresin.git] / package / system / ca-certificates / Makefile
1 #
2 # Copyright (C) 2006-2016 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
9 PKG_NAME:=ca-certificates
10 PKG_VERSION:=20161102
11 PKG_MAINTAINER:=Christian Schoenebeck <christian.schoenebeck@gmail.com>
12
13 PKG_SOURCE:=$(PKG_NAME)_$(PKG_VERSION).tar.xz
14 PKG_SOURCE_URL:=http://ftp.debian.org/debian/pool/main/c/ca-certificates
15 PKG_MD5SUM:=74642bd9b9e0a449fa55e6632070745f
16 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)
17
18 PKG_INSTALL:=1
19
20 include $(INCLUDE_DIR)/package.mk
21
22 define Package/ca-certificates
23 SECTION:=base
24 CATEGORY:=Base system
25 TITLE:=System CA certificates
26 PKGARCH:=all
27 endef
28
29 define Package/ca-bundle
30 SECTION:=base
31 CATEGORY:=Base system
32 TITLE:=System CA certificates as a bundle
33 PKGARCH:=all
34 endef
35
36 define Build/Install
37 mkdir -p \
38 $(PKG_INSTALL_DIR)/usr/sbin \
39 $(PKG_INSTALL_DIR)/usr/share/ca-certificates
40 $(call Build/Install/Default,)
41 endef
42
43 define Package/ca-certificates/install
44 $(INSTALL_DIR) $(1)/etc/ssl/certs
45 $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/share/ca-certificates/*/*.crt $(1)/etc/ssl/certs/
46
47 for CERTFILE in `ls -1 $(1)/etc/ssl/certs`; do \
48 HASH=`openssl x509 -hash -noout -in $(1)/etc/ssl/certs/$$$$CERTFILE` ; \
49 SUFFIX=0 ; \
50 while [ -h "$(1)/etc/ssl/certs/$$$$HASH.$$$$SUFFIX" ]; do \
51 let "SUFFIX += 1" ; \
52 done ; \
53 $(LN) "$$$$CERTFILE" "$(1)/etc/ssl/certs/$$$$HASH.$$$$SUFFIX" ; \
54 done
55 endef
56
57 define Package/ca-bundle/install
58 $(INSTALL_DIR) $(1)/etc/ssl/certs
59 cat $(PKG_INSTALL_DIR)/usr/share/ca-certificates/*/*.crt >$(1)/etc/ssl/certs/ca-certificates.crt
60 endef
61 $(eval $(call BuildPackage,ca-certificates))
62 $(eval $(call BuildPackage,ca-bundle))