summaryrefslogtreecommitdiff
path: root/sysutils/mcollective/Makefile
blob: bbf680dd136f06433f089826a7c9d54ebaf437b1 (plain) (blame)
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
# Created by: Russell Jackson <raj@csub.edu>
# $FreeBSD$

PORTNAME=	mcollective
PORTVERSION=	2.2.4
CATEGORIES=	sysutils
MASTER_SITES=	http://downloads.puppetlabs.com/${PORTNAME}/
EXTRACT_SUFX=	.tgz

MAINTAINER=	swills@FreeBSD.org
COMMENT=	A modern scalable datacenter orchestration framework

RUN_DEPENDS=	rubygem-stomp>=0:${PORTSDIR}/devel/rubygem-stomp

NO_BUILD=	yes
USE_RUBY=	yes
USE_RC_SUBR=	mcollectived

RUBY_SHEBANG_FILES=	bin/mcollectived bin/mco bin/mc-call-agent

# don't make .bak files
REINPLACE_ARGS=	-i ""

SCRIPTS=	mco mc-call-agent

SUB_LIST+=	RUBY=${RUBY}

NO_STAGE=	yes
do-patch:
	@${REINPLACE_CMD} -e "s|/etc/mcollective|${ETCDIR}|" \
	    ${WRKSRC}/bin/mcollectived \
		${WRKSRC}/etc/server.cfg.dist \
		${WRKSRC}/etc/client.cfg.dist \
		${WRKSRC}/lib/mcollective/config.rb \
		${WRKSRC}/lib/mcollective/util.rb \
		${WRKSRC}/lib/mcollective/rpc.rb
	@${REINPLACE_CMD} -e "s|/usr/libexec/mcollective|${PREFIX}/share|" \
	    ${WRKSRC}/etc/server.cfg.dist \
	    ${WRKSRC}/etc/client.cfg.dist

do-install:
	@(cd ${WRKSRC}/lib && ${COPYTREE_SHARE} \* ${RUBY_SITELIBDIR})
	${MKDIR} ${DATADIR}
	@(cd ${WRKSRC}/plugins/mcollective && ${COPYTREE_SHARE} \* ${DATADIR})

.for script in ${SCRIPTS}
	${INSTALL_SCRIPT} ${WRKSRC}/bin/${script} ${PREFIX}/bin/
.endfor
	${INSTALL_SCRIPT} ${WRKSRC}/bin/mcollectived ${PREFIX}/sbin/mcollectived

	${MKDIR} ${ETCDIR}
	${INSTALL_DATA} ${WRKSRC}/etc/client.cfg.dist ${ETCDIR}
	${INSTALL_DATA} ${WRKSRC}/etc/server.cfg.dist ${ETCDIR}

.if !defined(NOPORTDOCS)
	${MKDIR} ${DOCSDIR}
	(cd ${WRKSRC}/doc && ${COPYTREE_SHARE} \* ${DOCSDIR})
.endif

.include <bsd.port.mk>