# vim: ft=make ts=4 sw=4 noet

NAME    = cacert
VERSION = 2026-05-14
GARTYPE = v2

DESCRIPTION = Mozilla CA certificate bundle
define BLURB
  The Mozilla CA certificate bundle in PEM format, suitable for use with
  curl, openssl, and other TLS clients. Updated periodically from curl.se.
endef

# Raw .pem file — not a tarball
DISTFILES += cacert-$(VERSION).pem

MASTER_SITES = https://curl.se/ca/

LICENSE =

PACKAGES                  += OZSWcacert
SPKG_DESC_OZSWcacert      = Mozilla CA certificate bundle
CATALOGNAME_OZSWcacert    = cacert
ARCHALL_OZSWcacert        = 1
PKGFILES_OZSWcacert       = .*

# The .pem is not a tarball — skip extract
EXTRACT_SCRIPTS =
WORKSRC = $(DOWNLOADDIR)

# No configure or build step
CONFIGURE_SCRIPTS =
BUILD_SCRIPTS     =
TEST_SCRIPTS      =
INSTALL_SCRIPTS   =

# Custom install: place the bundle where curl and openssl expect it
post-install:
	@mkdir -p $(DESTDIR)$(sysconfdir)/ssl/certs
	cp $(DOWNLOADDIR)/cacert-$(VERSION).pem \
	   $(DESTDIR)$(sysconfdir)/ssl/certs/cacert.pem
	@$(MAKECOOKIE)

include gar/category.mk
