SUMMARY="Bundle of CA root certificates for OpenJDK"
DESCRIPTION="Certificate data for OpenJDK."
HOMEPAGE="https://www.mozilla.org/en-US/about/governance/policies/security-group/certs/"
COPYRIGHT="2008-2021 Mozilla"
LICENSE="MPL v1.1
	GNU GPL v2
	GNU LGPL v2.1"
REVISION="1"
SOURCE_URI="https://curl.haxx.se/ca/cacert-${portVersion//_/-}.pem#noarchive"
CHECKSUM_SHA256="a3b534269c6974631db35f952e8d7c7dbf3d81ab329a232df575c2661de1214a"
SOURCE_FILENAME="ca-bundle-$portVersion.crt"

ARCHITECTURES="any"
DISABLE_SOURCE_PACKAGE="yes"

PROVIDES="
	ca_root_certificates_java = $portVersion compat >= 0
	"

BUILD_REQUIRES="
	ca_root_certificates == $portVersion
	"
BUILD_PREREQUIRES="
	cmd:trust
	"

INSTALL()
{
	installDir="$dataRootDir/ssl/java"
	mkdir -p "$installDir"

	trust extract --format=java-cacerts --filter=ca-anchors \
		--purpose=server-auth $installDir/cacerts
	chmod 644 $installDir/cacerts
}
