pkgsrc/security/mozilla-rootcerts/Makefile
gdt 3be7310e91 mozilla-rootcerts: Cope with missing certs dir
While the certs dir should exist, pkg_delete of
mozilla-rootcerts-openssl currently removes it, despite it not having
been created by the corresponding pkg_add.  Instead of failing if the
directory does not exist, simply emit a warning and create it.
2020-03-30 16:38:03 +00:00

64 lines
2.1 KiB
Makefile

# $NetBSD: Makefile,v 1.35 2020/03/30 16:38:03 gdt Exp $
DISTNAME= mozilla-rootcerts-1.0.${CERTDATA_DATE}
PKGREVISION= 1
CATEGORIES= security
MASTER_SITES= -https://hg.mozilla.org/mozilla-central/raw-file/491b05117886ece80b94c88f7107e6e12c1394be/security/nss/lib/ckfw/builtins/certdata.txt
DISTFILES= ${CERTDATA}
EXTRACT_SUFX= # empty
MAINTAINER= pkgsrc-users@NetBSD.org
HOMEPAGE= https://hg.mozilla.org/mozilla-central/log/tip/security/nss/lib/ckfw/builtins/certdata.txt
COMMENT= Root CA certificates from the Mozilla Project
LICENSE= mpl-2.0
USE_TOOLS= awk:run echo:run expr:run ln:run ls:run openssl:run rm:run mkdir:run
# This must be kept in sync with security/mozilla-rootcerts-openssl
CERTDATA_DATE= 20191207
CERTDATA= certdata-${CERTDATA_DATE}.txt
WRKSRC= ${WRKDIR}
DATADIR= ${PREFIX}/share/${PKGBASE}
# Set paths depending on whether we depend on builtin or pkgsrc
# openssl. \todo Arguably, we should consider installing into both
# builtin and pkgsrc, if both exist, but this requires much more
# thought.
CHECK_BUILTIN.openssl= yes
.include "../../security/openssl/builtin.mk"
CHECK_BUILTIN.openssl= no
.if !empty(USE_BUILTIN.openssl:M[yY][eE][sS])
SSLDIR= /etc/openssl
.else
SSLDIR= ${PKG_SYSCONFDIR}/openssl
.endif
CERT_SCRIPT= mozilla-rootcerts.sh
SUBST_CLASSES= paths
SUBST_MESSAGE.paths= Replacing hard-coded paths.
SUBST_STAGE.paths= post-configure
SUBST_FILES.paths= ${CERT_SCRIPT}
SUBST_VARS.paths= AWK DATADIR ECHO EXPR LN LS MKDIR PREFIX SSLDIR RM
SUBST_SED.paths= -e 's,@OPENSSL@,${TOOLS_PATH.openssl},g'
INSTALLATION_DIRS= sbin ${DATADIR}
do-extract:
${CP} ${FILESDIR}/${CERT_SCRIPT} ${WRKSRC}
${CP} ${DISTDIR}/${CERTDATA} ${WRKSRC}
do-build:
${MKDIR} ${WRKSRC}/certs
cd ${WRKSRC}/certs && \
${SH} ${WRKSRC}/${CERT_SCRIPT} -f ${WRKSRC}/${CERTDATA} extract
${LS} -rt ${WRKSRC}/certs/*.pem | ${XARGS} ${CAT} >${WRKSRC}/cacert.pem
do-install:
${INSTALL_SCRIPT} ${WRKSRC}/${CERT_SCRIPT} \
${DESTDIR}${PREFIX}/sbin/mozilla-rootcerts
${INSTALL_DATA} ${WRKSRC}/${CERTDATA} ${DESTDIR}${DATADIR}/certdata.txt
${INSTALL_DATA} ${WRKSRC}/cacert.pem ${DESTDIR}${DATADIR}/cacert.pem
.include "../../mk/bsd.pkg.mk"