### this file is sourced not run
PKGVER=2016.04
PKGBUILD=1
PKGARCH=noarch

### requires lfs-cacert-tools to build, this file contains a duplicate
#   of cacert-update.sh, suitably modified for our build system
TARBALL=
MD5SUM=
SRC_URL=http://mxr.mozilla.org/mozilla/source/security/nss/lib/ckfw/builtins/certdata.txt?raw=1
BUNDLE=
SLACKREQ=
SLACKDESC="lfs-cacert: lfs-cacert $PKGVER (CA Certificates)  
lfs-cacert:  
lfs-cacert: These are Certificate Authority (CA) certificates build from 
lfs-cacert: Mozilla collections. Used in conjunction with SSL/TLS and other 
lfs-cacert: crypto-protected programs, it can be used to confirm whether a 
lfs-cacert: site is what it claims it is.  
lfs-cacert: 
lfs-cacert: 
lfs-cacert: 
lfs-cacert: 
lfs-cacert:
"
SLACKSUG=lfs-cacert-tools

### standard pkg_download
pkg_prepare() {
	TMPDIR=tmp/cacert-update
	mkdir -p $TMPDIR
	cd $TMPDIR
	wget --output-document certdata.txt $SRC_URL
}

pkg_package() {
	: nothing
}

pkg_build() { 
	cd /tmp/cacert-update
	make-ca.sh
	remove-expired-certs.sh certs
	
	SSLDIR=/etc/ssl &&
	install -d ${SSLDIR}/certs &&
	cp certs/*.pem ${SSLDIR}/certs &&
	c_rehash &&
	install BLFS-ca-bundle*.crt ${SSLDIR}/ca-bundle.crt &&
	ln -s ../ca-bundle.crt ${SSLDIR}/certs/ca-certificates.crt &&
	pkg_build_slackdesc
}






