[BACK]Return to Makefile CVS log [TXT][DIR] Up to [cvs.NetBSD.org] / pkgsrc / sysutils / cfengine3

File: [cvs.NetBSD.org] / pkgsrc / sysutils / cfengine3 / Makefile (download)

Revision 1.36, Wed Nov 23 16:21:04 2022 UTC (2 months, 2 weeks ago) by adam
Branch: MAIN
CVS Tags: pkgsrc-2022Q4-base, pkgsrc-2022Q4, HEAD
Changes since 1.35: +2 -2 lines

massive revision bump after textproc/icu update

# $NetBSD: Makefile,v 1.36 2022/11/23 16:21:04 adam Exp $

DISTNAME=	cfengine-3.15.2
PKGREVISION=	9
CATEGORIES=	sysutils
MASTER_SITES=	https://cfengine-package-repos.s3.amazonaws.com/tarballs/

MAINTAINER=	pettai@NetBSD.org
HOMEPAGE=	https://cfengine.com/product/community/
COMMENT=	Tool for automating system administration
LICENSE=	gnu-gpl-v3

USE_LANGUAGES=		c c++ c99
USE_LIBTOOL=		yes
USE_TOOLS+=		gmake pax

.include "options.mk"

DISTFILES=		${DEFAULT_DISTFILES}
DISTFILES+=		cfengine-masterfiles-${PKGVERSION_NOREV}.tar.gz

GNU_CONFIGURE=		yes
CONFIGURE_ARGS+=	--enable-fhs
CONFIGURE_ARGS+=	--docdir=${DOCDIR}
CONFIGURE_ARGS+=	--datadir=${CFENGINE_DIR:Q}
CONFIGURE_ARGS+=	--with-masterdir=${PKG_SYSCONFDIR:Q}
CONFIGURE_ARGS+=	--with-sysconfdir=${PKG_SYSCONFDIR:Q}
CONFIGURE_ARGS+=	--with-workdir=${CFENGINE_DIR:Q}
CONFIGURE_ARGS+=	--with-libcurl=${BUILDLINK_PREFIX.curl:Q}
CONFIGURE_ARGS+=	--with-libxml2=${BUILDLINK_PREFIX.libxml2:Q}
CONFIGURE_ARGS+=	--with-libyaml=${BUILDLINK_PREFIX.libyaml:Q}
CONFIGURE_ARGS+=	--with-openssl=${BUILDLINK_PREFIX.openssl:Q}
CONFIGURE_ARGS+=	--with-pcre=${BUILDLINK_PREFIX.pcre:Q}

CONFIGURE_DIRS+=	. ${WRKDIR}/cfengine-masterfiles-${PKGVERSION_NOREV}

BUILD_DEFS+=		VARBASE CFENGINE_DIR
FILES_SUBST+=		CFENGINE_DIR=${CFENGINE_DIR}

.include "../../mk/bsd.prefs.mk"

CFENGINE_DIR?=		${VARBASE}/cfengine
DOCDIR=			${PREFIX}/share/doc/${PKGBASE}
EGDIR=			${PREFIX}/share/examples/${PKGBASE}
PKG_SYSCONFSUBDIR=	cfengine

# Regenerate masterfiles list with 'make update-masterfiles'
.include "Makefile.cf"

.for file in ${CFILES}
CONF_FILES+=		${EGDIR}/CoreBase/${file} ${PKG_SYSCONFDIR}/${file}
.endfor

RCD_SCRIPTS=		cfserverd cfexecd cfmonitord
SMF_INSTANCES=		${RCD_SCRIPTS}

INSTALLATION_DIRS+=	${PKGMANDIR}/man8
INSTALL_MAKE_FLAGS+=	examplesdir=${EGDIR} projlibdir=${PREFIX}/lib
INSTALL_MAKE_FLAGS+=	masterfilesdir=${EGDIR}/CoreBase
INSTALL_MAKE_FLAGS+=	package_modulesdir=${EGDIR}/CoreBase/modules/packages
INSTALL_MAKE_FLAGS+=	dist_package_modules_SCRIPTS="apt_get pkgsrc yum"

MAKE_DIRS=		${CFENGINE_DIR}
MAKE_DIRS+=		${PKG_SYSCONFDIR}/cfe_internal/core/deprecated
MAKE_DIRS+=		${PKG_SYSCONFDIR}/cfe_internal/update
MAKE_DIRS+=		${PKG_SYSCONFDIR}/cfe_internal/enterprise/ha
MAKE_DIRS+=		${PKG_SYSCONFDIR}/controls
MAKE_DIRS+=		${PKG_SYSCONFDIR}/inventory
MAKE_DIRS+=		${PKG_SYSCONFDIR}/lib
MAKE_DIRS+=		${PKG_SYSCONFDIR}/modules/packages
MAKE_DIRS+=		${PKG_SYSCONFDIR}/services/autorun
MAKE_DIRS+=		${PKG_SYSCONFDIR}/templates

SUBST_CLASSES+=		path
SUBST_MESSAGE.path=	Fixing default paths
SUBST_STAGE.path=	pre-configure
SUBST_FILES.path=	${WRKDIR}/cfengine-masterfiles-${PKGVERSION_NOREV}/modules/packages/pkgsrc
SUBST_VARS.path=	MACHINE_ARCH PKG_SYSCONFBASE PREFIX

# This can be removed once this module is released in 3.8.
post-extract:
	${INSTALL_SCRIPT} files/pkgsrc \
		${WRKDIR}/cfengine-masterfiles-${PKGVERSION_NOREV}/modules/packages/pkgsrc

update-masterfiles: configure
	(${ECHO} '# $$''NetBSD''$$'; \
	 ${ECHO} '# Generated by "make update-masterfiles", post-configure'; \
	 ${ECHO}; \
	 cd ${WRKDIR}/cfengine-masterfiles-${PKGVERSION_NOREV} && (\
		${FIND} cfe_internal controls inventory lib services -name '*.cf'; \
		${FIND} templates -name '*.mustache'; \
		${FIND} modules -type f | grep -v Makefile \
	 ) | ${SORT} | ${SED} -e 's|^|CFILES+=	|') \
	 > ${.CURDIR}/../../sysutils/cfengine3/Makefile.cf

post-install:
	for cf in cf-agent cf-execd cf-key cf-monitord cf-promises cf-runagent cf-serverd ; \
	do LD_LIBRARY_PATH=${DESTDIR}${PREFIX}/lib ${DESTDIR}${PREFIX}/bin/$$cf -M \
		> ${DESTDIR}/${PREFIX}/${PKGMANDIR}/man8/$$cf.8 ; \
	done

.include "../../devel/pcre/buildlink3.mk"
.include "../../security/openssl/buildlink3.mk"
.include "../../textproc/libxml2/buildlink3.mk"
.include "../../textproc/libyaml/buildlink3.mk"
.include "../../www/curl/buildlink3.mk"
.include "../../mk/pam.buildlink3.mk"
.include "../../mk/pthread.buildlink3.mk"
.include "../../mk/bsd.pkg.mk"