summaryrefslogtreecommitdiffstats
path: root/net-mgmt/netxms/Makefile
blob: 59aed84bc094d3260167ad4a40d74a57c2cf7047 (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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
# Created by: Vladimir Ermakov <samflanker@gmail.com>
# $FreeBSD$

PORTNAME=	netxms
PORTVERSION=	1.2.17
PORTREVISION=	3
CATEGORIES=	net-mgmt
MASTER_SITES=	http://www.netxms.org/download/ \
		http://www.netxms.org/download/archive/

MAINTAINER=	bofh@FreeBSD.org
COMMENT=	Network monitoring system

LICENSE=	GPLv2 LGPL21
LICENSE_COMB=	multi

LIB_DEPENDS=	libcurl.so:ftp/curl \
		libexpat.so:textproc/expat2 \
		libjansson.so:devel/jansson \
		libtre.so:textproc/libtre

PORTSCOUT=	limit:^1\.

OPTIONS_DEFINE=	SERVER CLIENT AGENT
OPTIONS_DEFAULT=	CLIENT AGENT
OPTIONS_SINGLE=	SERVER
OPTIONS_SINGLE_SERVER=	MYSQL PGSQL SQLITE ODBC
OPTIONS_SUB=	yes

SERVER_DESC=	Install NetXMS server & agent
CLIENT_DESC=	Install NetXMS client
AGENT_DESC=	Install NetXMS agent

CLIENT_CONFIGURE_ON=	--with-client
AGENT_CONFIGURE_ON=	--with-agent
SERVER_CONFIGURE_ON=	--with-server
MYSQL_CONFIGURE_ON=	--with-mysql
MYSQL_USE=		MYSQL=yes
PGSQL_CONFIGURE_ON=	--with-pgsql
PGSQL_USES=		pgsql
SQLITE_CONFIGURE_ON=	--with-sqlite
SQLITE_USES=		sqlite
ODBC_CONFIGURE_ON=	--with-odbc
ODBC_LIB_DEPENDS=	libodbc.so:databases/unixODBC

USE_OPENSSL=	yes
USES=		gmake iconv libtool perl5
GNU_CONFIGURE=	yes
USE_LDCONFIG=	yes
INSTALL_TARGET=	install-strip

CPPFLAGS+=	-I${LOCALBASE}/include
LDFLAGS+=	-L${LOCALBASE}/lib

USERS=		netxms
GROUPS=		netxms

.include <bsd.port.options.mk>

.if ${PORT_OPTIONS:MSERVER} || ${PORT_OPTIONS:MCLIENT}
PLIST_SUB+=	NXMAP=""
.else
PLIST_SUB+=	NXMAP="@comment "
.endif

.if ${PORT_OPTIONS:MSERVER} || ${PORT_OPTIONS:MAGENT}
PLIST_SUB+=	NXCP=""
.else
PLIST_SUB+=	NXCP="@comment "
.endif

.if ${PORT_OPTIONS:MSERVER}
USE_RC_SUBR+=	netxmsd
.if !${PORT_OPTIONS:MAGENT}
USE_RC_SUBR+=	nxagentd
.endif
.endif

.if ${PORT_OPTIONS:MAGENT}
USE_RC_SUBR+=	nxagentd
.endif

post-patch:
	@${REINPLACE_CMD} 's/-liconv/${ICONV_LIB}/' ${WRKSRC}/configure

post-install:
.if ${PORT_OPTIONS:MSERVER}
.if !exists(${STAGEDIR}${PREFIX}/etc/netxmsd.conf.sample)
	${CP} ${WRKSRC}/contrib/netxmsd.conf-dist ${STAGEDIR}${PREFIX}/etc/netxmsd.conf.sample
.endif
.endif
.if ${PORT_OPTIONS:MSERVER} || ${PORT_OPTIONS:MAGENT}
.if !exists(${STAGEDIR}${PREFIX}/etc/nxagentd.conf.sample)
	${CP} ${WRKSRC}/contrib/nxagentd.conf-dist ${STAGEDIR}${PREFIX}/etc/nxagentd.conf.sample
.endif
.endif

.include <bsd.port.mk>
OpenPOWER on IntegriCloud