xref: /OK3568_Linux_fs/buildroot/package/ca-certificates/ca-certificates.mk (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1################################################################################
2#
3# ca-certificates
4#
5################################################################################
6
7CA_CERTIFICATES_VERSION = 20211016
8CA_CERTIFICATES_SOURCE = ca-certificates_$(CA_CERTIFICATES_VERSION).tar.xz
9CA_CERTIFICATES_SITE = https://snapshot.debian.org/archive/debian/20211022T144903Z/pool/main/c/ca-certificates
10CA_CERTIFICATES_DEPENDENCIES = host-openssl host-python3 host-python-cryptography
11CA_CERTIFICATES_LICENSE = GPL-2.0+ (script), MPL-2.0 (data)
12CA_CERTIFICATES_LICENSE_FILES = debian/copyright
13
14define CA_CERTIFICATES_BUILD_CMDS
15	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D) clean all
16endef
17
18define CA_CERTIFICATES_INSTALL_TARGET_CMDS
19	$(INSTALL) -d -m 0755 $(TARGET_DIR)/usr/share/ca-certificates
20	$(INSTALL) -d -m 0755 $(TARGET_DIR)/etc/ssl/certs
21	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D) install DESTDIR=$(TARGET_DIR)
22	rm -f $(TARGET_DIR)/usr/sbin/update-ca-certificates
23
24	# Remove any existing certificates under /etc/ssl/certs
25	rm -f $(TARGET_DIR)/etc/ssl/certs/*
26
27	# Create symlinks to certificates under /etc/ssl/certs
28	# and generate the bundle
29	cd $(TARGET_DIR) ;\
30	for i in `find usr/share/ca-certificates -name "*.crt" | LC_COLLATE=C sort` ; do \
31		ln -sf ../../../$$i etc/ssl/certs/`basename $${i} .crt`.pem ;\
32		cat $$i ;\
33	done >$(@D)/ca-certificates.crt
34
35	# Create symlinks to the certificates by their hash values
36	$(HOST_DIR)/bin/c_rehash $(TARGET_DIR)/etc/ssl/certs
37
38	# Install the certificates bundle
39	$(INSTALL) -D -m 644 $(@D)/ca-certificates.crt \
40		$(TARGET_DIR)/etc/ssl/certs/ca-certificates.crt
41endef
42
43$(eval $(generic-package))
44