summaryrefslogtreecommitdiff
path: root/sysutils/cfengine3/Makefile
blob: a29a4cc54832da9031b090c91ac1c4b687eea0ed (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
# $NetBSD: Makefile,v 1.13 2015/04/07 08:43:35 fhajny Exp $
#

DISTNAME=	cfengine-3.6.5
CATEGORIES=	sysutils
MASTER_SITES=	http://cfengine.package-repos.s3.amazonaws.com/tarballs/

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

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

.include "options.mk"

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

GNU_CONFIGURE=		yes
CONFIGURE_ARGS+=	--enable-fhs
CONFIGURE_ARGS+=	--docdir=${DOCDIR}
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}

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

INSTALLATION_DIRS+=	${PKGMANDIR}/man8
INSTALL_MAKE_FLAGS+=	examplesdir=${EGDIR} projlibdir=${PREFIX}/lib

MAKE_DIRS=		${CFENGINE_DIR}
MAKE_DIRS+=		${PKG_SYSCONFDIR}/controls ${PKG_SYSCONFDIR}/libraries
MAKE_DIRS+=		${PKG_SYSCONFDIR}/services

update-masterfiles:
	(${ECHO} '# $$NetBSD: Makefile,v 1.13 2015/04/07 08:43:35 fhajny Exp $$'; \
	 ${ECHO} '# Generated by "${MAKE:Q} update-masterfiles", post-extract'; \
	 ${ECHO}; \
	 cd ${WRKDIR}/masterfiles && ${FIND} * -type f | ${SORT} | \
	 ${SED} -e 's|^|CFILES+=|') \
	 > ${.CURDIR}/../../sysutils/cfengine3/Makefile.cf

post-install:
	cp -r ${WRKDIR}/masterfiles ${DESTDIR}/${PREFIX}/share/examples/cfengine/CoreBase
	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"