pkgsrc/sysutils/cfengine3/Makefile
2017-08-16 20:26:36 +00:00

108 lines
3.8 KiB
Makefile

# $NetBSD: Makefile,v 1.19 2017/08/16 20:26:36 wiz Exp $
DISTNAME= cfengine-3.7.3
PKGREVISION= 1
CATEGORIES= sysutils
MASTER_SITES= http://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-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/3.5
MAKE_DIRS+= ${PKG_SYSCONFDIR}/controls/3.6
MAKE_DIRS+= ${PKG_SYSCONFDIR}/controls/3.7
MAKE_DIRS+= ${PKG_SYSCONFDIR}/inventory
MAKE_DIRS+= ${PKG_SYSCONFDIR}/lib/3.5
MAKE_DIRS+= ${PKG_SYSCONFDIR}/lib/3.6
MAKE_DIRS+= ${PKG_SYSCONFDIR}/lib/3.7
MAKE_DIRS+= ${PKG_SYSCONFDIR}/modules/packages
MAKE_DIRS+= ${PKG_SYSCONFDIR}/services/autorun
MAKE_DIRS+= ${PKG_SYSCONFDIR}/sketches/meta
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 sketches/meta update -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}/sbin/$$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 "../../mk/pthread.buildlink3.mk"
.include "../../mk/bsd.pkg.mk"