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