9c50fef3201d38719675dcd27525cdda79e983a8
[openwrt/staging/yousong.git] / package / system / ca-certificates / Makefile
1 #
2 # Copyright (C) 2006-2015 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:=20150426
11
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_MD5SUM:=717455f13fb31fd014a11a468ea3895d
15
16 PKG_INSTALL:=1
17
18 include $(INCLUDE_DIR)/package.mk
19
20 define Package/ca-certificates
21 SECTION:=base
22 CATEGORY:=Base system
23 TITLE:=System CA certificates
24 endef
25
26 define Build/Install
27 mkdir -p \
28 $(PKG_INSTALL_DIR)/usr/sbin \
29 $(PKG_INSTALL_DIR)/usr/share/ca-certificates
30 $(call Build/Install/Default,)
31 endef
32
33 define Package/ca-certificates/install
34 $(INSTALL_DIR) $(1)/etc/ssl/certs
35 $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/share/ca-certificates/*/*.crt $(1)/etc/ssl/certs/
36
37 for CERTFILE in `ls -1 $(1)/etc/ssl/certs`; do \
38 HASH=`openssl x509 -hash -noout -in $(1)/etc/ssl/certs/$$$$CERTFILE` ; \
39 SUFFIX=0 ; \
40 while [ -h "$(1)/etc/ssl/certs/$$$$HASH.$$$$SUFFIX" ]; do \
41 let "SUFFIX += 1" ; \
42 done ; \
43 $(LN) "$$$$CERTFILE" "$(1)/etc/ssl/certs/$$$$HASH.$$$$SUFFIX" ; \
44 done
45 endef
46
47 $(eval $(call BuildPackage,ca-certificates))