summaryrefslogtreecommitdiffhomepage
path: root/vars/ca_certificates.vars
blob: c692f5c31460d1c219285707e85ed4bc06f4f670 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#
# set +o errexit -o noglob -o nounset is assumed.
#

pkg_ca_certificates_install_make_pre() {
	"${PKG_DESTDIR}/../cacerts/certdata2pem_host";
	tar -C "${BUILD_WORKDIR}/ca_certificates_host-host-${PKG_TARGET}/destdir" -cpf - . | tar -C "${PKG_DESTDIR}" -xpf -;
};

pkg_ca_certificates_install_make_post() {
	set +o noglob
	if ! rtl_fileop cd "${PKG_DESTDIR}/share/ca-certificates"\
	|| ! find . -name '*.crt' | sort | cut -b3- > ${PKG_DESTDIR}/etc/ca-certificates.conf; then
		set -o noglob; return 1;
	fi;
	set -o noglob;
};

pkg_ca_certificates_host_configure_patch_post() {
	local _vname="" _vspec="" _vpsec_="" _vval="";
	for _vspec in	\
			CERTSCONF:/etc/ca-certificates.conf			\
			ETCCERTSDIR:/etc/ssl/certs/; do
		rtl_llift2 \$_vspec \$_vspec_ : " ";
		set -- ${_vspec_}; _vname="${1}"; _vval="${2}";
		sed -i"" -e's,^#define '"${_vname}"' ".\+"$,#define '"${_vname}"' "'"${PKG_DESTDIR%/}${_vval}"'",' update-ca.c;
	done;
	sed -i"" -e's,^#define CERTSDIR ".\+"$,#define CERTSDIR "../../../usr/share/ca-certificates/",' update-ca.c;
	sed -i"" -e's,^#define LOCALCERTSDIR ".\+"$,#define LOCALCERTSDIR "../../../usr/local/share/ca-certificates/",' update-ca.c;
};

pkg_ca_certificates_host_install_make_pre() {
	"${PKG_DESTDIR}/../cacerts_host/certdata2pem_host";
	tar -C "${BUILD_WORKDIR}/ca_certificates_host-host-${PKG_TARGET}/destdir" -cpf - . | tar -C "${PKG_DESTDIR}" -xpf -;
};

pkg_ca_certificates_host_install_make_post() {
	pkg_ca_certificates_install_make_post "${@}";
	env LD_LIBRARY_PATH="${PKG_PREFIX}/lib" "${PKG_DESTDIR}/sbin/update-ca-certificates";
	set +o noglob; rtl_fileop rm "${PKG_DESTDIR}/bin"/* "${PKG_DESTDIR}/sbin"/*; set -o noglob;
};

pkg_ca_certificates_minipix_install_make_pre() {
	pkg_ca_certificates_install_make_pre "${@}";
};

pkg_ca_certificates_minipix_install_make_post() {
	pkg_ca_certificates_install_make_post "${@}";
};

# vim:filetype=sh textwidth=0