freebsd-ports/net-mgmt/nav/Makefile
2009-01-08 16:59:24 +00:00

124 lines
4.8 KiB
Makefile

# Ports collection makefile for: nav
# Date created: 2004-10-19
# Whom: Anders Nordby <anders@FreeBSD.org>
#
# $FreeBSD$
#
PORTNAME= nav
PORTVERSION= 3.4.4
CATEGORIES= net-mgmt
MASTER_SITES= http://launchpadlibrarian.net/18978371/
MAINTAINER= des@FreeBSD.org
COMMENT= Network Administration Visualized
BUILD_DEPENDS= ${LOCALBASE}/bin/ant:${PORTSDIR}/devel/apache-ant \
${LOCALBASE}/bin/cheetah:${PORTSDIR}/devel/py-cheetah \
gfind:${PORTSDIR}/misc/findutils \
ginstall:${PORTSDIR}/sysutils/coreutils \
${JAVALIBDIR}/snmp.jar:${PORTSDIR}/java/drexelsnmp
# ports.mk should really take care of this for us...
.if exists(${LOCALBASE}/jakarta-tomcat4.1/bin/catalina.sh)
TOMCAT_DEPEND= ${LOCALBASE}/jakarta-tomcat4.1:${PORTSDIR}/www/tomcat41
CATALINA_HOME= ${LOCALBASE}/jakarta-tomcat4.1
CLASSPATH= ${CATALINA_HOME}/common/lib/servlet.jar
.elif exists(${LOCALBASE}/jakarta-tomcat4.0.6/bin/catalina.sh)
TOMCAT_DEPEND= ${LOCALBASE}/jakarta-tomcat4.0.6:${PORTSDIR}/www/jakarta-tomcat4
CATALINA_HOME= ${LOCALBASE}/jakarta-tomcat4.0.6
CLASSPATH= ${CATALINA_HOME}/common/lib/servlet.jar
.elif exists(${LOCALBASE}/jakarta-tomcat5.0/bin/catalina.sh)
TOMCAT_DEPEND= ${LOCALBASE}/jakarta-tomcat5.0:${PORTSDIR}/www/jakarta-tomcat5
CATALINA_HOME= ${LOCALBASE}/jakarta-tomcat5.0
CLASSPATH= ${CATALINA_HOME}/common/lib/servlet-api.jar
.elif exists(${LOCALBASE}/tomcat5.5/bin/catalina.sh)
TOMCAT_DEPEND= ${LOCALBASE}/tomcat5.5:${PORTSDIR}/www/tomcat55
CATALINA_HOME= ${LOCALBASE}/tomcat5.5
CLASSPATH= ${CATALINA_HOME}/common/lib/servlet-api.jar
.else
TOMCAT_DEPEND= ${LOCALBASE}/apache-tomcat6.0:${PORTSDIR}/www/tomcat6
CATALINA_HOME= ${LOCALBASE}/apache-tomcat6.0
CLASSPATH= ${CATALINA_HOME}/lib/servlet-api.jar
.endif
BUILD_DEPENDS+= ${TOMCAT_DEPEND}
RUN_DEPENDS= ${LOCALBASE}/bin/bash:${PORTSDIR}/shells/bash \
${SITE_PERL}/${PERL_ARCH}/DBD/Pg.pm:${PORTSDIR}/databases/p5-DBD-Pg \
${SITE_PERL}/${PERL_ARCH}/Pg.pm:${PORTSDIR}/databases/p5-Pg \
${PYTHON_SITELIBDIR}/rrdtool/_rrdtool.so:${PORTSDIR}/databases/py-rrdtool_lgpl \
${PYTHON_SITELIBDIR}/psycopgmodule.so:${PORTSDIR}/databases/py-psycopg \
${LOCALBASE}/cricket/cricket/collect-subtrees:${PORTSDIR}/net-mgmt/cricket \
${JAVALIBDIR}/postgresql.jar:${PORTSDIR}/databases/postgresql-jdbc \
${PYTHON_SITELIBDIR}/forgetSQL.py:${PORTSDIR}/databases/py-forgetsql \
${PYTHON_SITELIBDIR}/forgetHTML.py:${PORTSDIR}/www/py-forgethtml \
${PYTHON_SITELIBDIR}/pysnmp/v2c.py:${PORTSDIR}/net-mgmt/py-snmp2 \
${PYTHON_SITELIBDIR}/IPy.py:${PORTSDIR}/net-mgmt/py-ipy \
${LOCALBASE}/bin/gammu:${PORTSDIR}/comms/gammu \
${TOMCAT_DEPEND}
BROKEN= does not compile
MAKE_ENV+= CLASSPATH=${CLASSPATH}
HAS_CONFIGURE= yes
USE_PERL5= yes
USE_PYTHON= 2.5+
USE_JAVA= yes
JAVA_VERSION= 1.5+
USE_APACHE= 2.2+
USE_GETTEXT= yes
USE_GMAKE= yes
USE_PHP= ctype gettext pcre pgsql posix \
session tokenizer xml zlib
DEFAULT_PHP_VER=5
IGNORE_WITH_PHP=4
WANT_PHP_MOD= yes
CONFIGURE_ENV= INSTALL="${LOCALBASE}/bin/ginstall"
CONFIGURE_ARGS= --prefix=${PREFIX}/nav ${CONFIGURE_TARGET}
PKGDEINSTALL= ${PKGDIR}/pkg-install
.include <bsd.port.pre.mk>
post-patch:
@(${FIND} ${WRKSRC} -name '*.py' -print0 | \
${ENV} PYTHON_CMD=${PYTHON_CMD} \
${XARGS} -0 ${SCRIPTDIR}/fixpyenc)
@${REINPLACE_CMD} -E -e "s@(property name=\"catalina.home\").*@\1 value=\"${CATALINA_HOME}\"/>@" ${WRKSRC}/src/webapps/*/build.xml
@${REINPLACE_CMD} -e "s@find@gfind@g" ${WRKSRC}/subsystem/alertprofiles/Makefile.in ${WRKSRC}/tools/htpython.sh ${WRKSRC}/subsystem/statTools/cleanrrds.pl
@${REINPLACE_CMD} -E -e "s@^(CRICKETDIR=).*@\1${LOCALBASE}/cricket@" ${WRKSRC}/subsystem/statTools/cricket.cron
@${REINPLACE_CMD} -E -e "s@^(JAVA_HOME).*@\1 = ${JAVA_HOME}@" \
${WRKSRC}/doc/conf/nav.conf
# do this in pre-build rather than post-extract or post-patch to avoid
# excessive EXTRACT_DEPENDS.
pre-build:
${MKDIR} ${WRKSRC}/src/SimpleSnmp/build
${LN} -fs ${JAVALIBDIR}/snmp.jar ${WRKSRC}/src/SimpleSnmp/build
${MKDIR} ${WRKSRC}/src/webapps/navAdmin/build
${LN} -fs ${CATALINA_HOME}/server/lib/catalina-ant.jar ${WRKSRC}/src/webapps/navAdmin/build
${MKDIR} ${WRKSRC}/src/webapps/vPServer/build
${LN} -fs ${CATALINA_HOME}/server/lib/catalina-ant.jar ${WRKSRC}/src/webapps/vPServer/build
pre-install:
@PKG_PREFIX=${PREFIX} ${SH} ${PKGINSTALL} ${PKGNAME} PRE-INSTALL
# @${FIND} ${WRKSRC} \( -name '*.bak' -or -name '*.orig' \) -delete
post-install:
@${INSTALL_DATA} ${FILESDIR}/apache.conf ${PREFIX}/${APACHEETCDIR}/Includes/nav.conf.sample
@${CHOWN} -R navcron:nav ${PREFIX}/nav/var
@${ECHO_MSG} "===> Consider using make auto-config. It will auto-configure NAV, setting up"
@${ECHO_MSG} "===> shell environment and PostgreSQL database."
@${ECHO}
auto-config:
@env LOCALBASE=${LOCALBASE} PORTSDIR=${PORTSDIR} ${SH} ${SCRIPTDIR}/myautoconf
# TODO
#
# Install more docs?
# Info about Apache/Tomcat setup?
# Fix cricket setup
.include <bsd.port.post.mk>