nxhttpd traces removed
[public/netxms.git] / packages / freebsd / Makefile
CommitLineData
5125b6f7
VK
1# Ports collection makefile for: netxms
2# Date created: Jul 9 2007
3# Whom: Vladimir Ermakov <samflanker@gmail.com>
4#
5# $FreeBSD$
6#
7
8PORTNAME= netxms
9PORTVERSION= 0.2.18
10CATEGORIES= net-mgmt
11MASTER_SITES= http://www.netxms.org/download/
12
13MAINTAINER= samflanker@gmail.com
14COMMENT= NetXMS - network monitoring system
15
16NO_PACKAGE= yes
17GNU_CONFIGURE= yes
bd20cecd 18CONFIGURE_TARGET= --build=${MACHINE_ARCH}-portbld-freebsd${OSREL}
5125b6f7
VK
19
20CC= gcc
21CXX= g++
22
23USE_LDCONFIG= yes
24USE_OPENSSL= yes
25
26CFLAGS+= -I${LOCALBASE}/include
27LDFLAGS+= -L${LOCALBASE}/lib
28LDFLAGS+= -L${OPENSSLLIB} -lcrypto -lssl
29
30OPTIONS= SERVER "Install NetXMS server & agent" off\
31 CLIENT "Install NetXMS client" off \
32 AGENT "Install NetXMS agent" off \
5125b6f7
VK
33 MYSQL "Enable MySQL support" off \
34 PGSQL "Enable PostgreSQL support" off
35
bd20cecd
VK
36NETXMS_OWN= netxms
37NETXMS_GRP= netxms
5125b6f7
VK
38
39.include <bsd.port.pre.mk>
40
41.if !defined(WITH_SERVER)
42.if defined(WITH_MYSQL) || !defined(WITHOUT_PGSQL)
bd20cecd 43IGNORE= is useless database support without a SERVER. Please (re)run 'make config' and choose SERVER with database
5125b6f7
VK
44.endif
45.endif
46
47.if defined(WITH_SERVER)
48.if defined(WITHOUT_MYSQL) && !defined(WITH_PGSQL)
49IGNORE= is useless without a database. Please (re)run 'make config' and choose one of PGSQL and MYSQL
50.endif
51USE_RC_SUBR+= netxmsd nxagentd
52CONFIGURE_ARGS+= --with-server
53PLIST_SUB+= SERVER=""
54.else
55PLIST_SUB+= SERVER="@comment " AGENT="@comment "
56.endif
57
58.if defined(WITH_CLIENT)
59CONFIGURE_ARGS+= --with-client
60PLIST_SUB+= CLIENT=""
61.else
62PLIST_SUB+= CLIENT="@comment "
63.endif
64
65.if defined(WITH_AGENT)
66.if defined(WITH_SERVER)
67IGNORE= is useles AGENT or SERVER. Please (re)run 'make config' and choose one of AGENT and SERVER
68.endif
69USE_RC_SUBR+= nxagentd
70CONFIGURE_ARGS+= --with-agent
71PLIST_SUB+= AGENT=""
72.else
73PLIST_SUB+= AGENT="@comment "
74.endif
75
5125b6f7
VK
76.if defined(WITH_MYSQL)
77CONFIGURE_ARGS+= --with-mysql
78PLIST_SUB+= MYSQL=""
79USE_MYSQL= yes
80.else
81PLIST_SUB+= MYSQL="@comment "
82.endif
83
84.if defined(WITH_PGSQL)
85CONFIGURE_ARGS+= --with-pgsql
86PLIST_SUB+= PGSQL=""
87USE_PGSQL= yes
88.else
89PLIST_SUB+= PGSQL="@comment "
90.endif
91
92pre-install:
93 @${SETENV} PKG_PREFIX=${PREFIX} \
94 ${SH} ${PKGINSTALL} ${PORTNAME} PRE-INSTALL
95.if defined(WITH_SERVER)
96 @if [ ! -f ${PREFIX}/etc/netxmsd.conf-dist ]; then \
97 ${CP} -p ${WRKSRC}/contrib/netxmsd.conf-dist ${PREFIX}/etc/netxmsd.conf-dist ; \
98 fi
99.endif
100.if defined(WITH_SERVER) || !defined(WITHOUT_AGENT)
101 @if [ ! -f ${PREFIX}/etc/nxagentd.conf-dist ]; then \
102 ${CP} -p ${WRKSRC}/contrib/nxagentd.conf-dist ${PREFIX}/etc/nxagentd.conf-dist ; \
103 fi
104.endif
5125b6f7
VK
105
106post-install:
107 @${SETENV} PKG_PREFIX=${PREFIX} \
108 ${SH} ${PKGINSTALL} ${PORTNAME} POST-INSTALL
109.if defined(WITH_SERVER)
110 ${CHOWN} ${NETXMS_OWN}:${NETXMS_GRP} ${PREFIX}/etc/netxmsd.conf-dist
111 ${CHOWN} ${NETXMS_OWN}:${NETXMS_GRP} ${PREFIX}/etc/nxagentd.conf-dist
112.endif
113.if defined(WITH_AGENT)
114 ${CHOWN} ${NETXMS_OWN}:${NETXMS_GRP} ${PREFIX}/etc/nxagentd.conf-dist
115.endif
5125b6f7
VK
116
117post-deinstall:
118 @${SETENV} PKG_PREFIX=${PREFIX} \
119 ${SH} ${PKGDEINSTALL} ${PORTNAME} POST-DEINSTALL
120
121.include <bsd.port.post.mk>