diff options
author | crees <crees@FreeBSD.org> | 2011-09-02 00:08:01 +0800 |
---|---|---|
committer | crees <crees@FreeBSD.org> | 2011-09-02 00:08:01 +0800 |
commit | 3c4ce78262728e290876d2f7a5e671f3cc1eeb4d (patch) | |
tree | d7cb096d8e572796809fe0043db88fb90759cb43 /Mk | |
parent | 581be8cccf6ef78044b2a02d02d0b528feae09e8 (diff) | |
download | freebsd-ports-graphics-3c4ce78262728e290876d2f7a5e671f3cc1eeb4d.tar.gz freebsd-ports-graphics-3c4ce78262728e290876d2f7a5e671f3cc1eeb4d.tar.zst freebsd-ports-graphics-3c4ce78262728e290876d2f7a5e671f3cc1eeb4d.zip |
Add bsd.zenoss.mk for support of zenpacks.
PR: ports/160290
Submitted by: Jason Helfman <jhelfman@experts-exchange.com>
Diffstat (limited to 'Mk')
-rw-r--r-- | Mk/bsd.zenoss.mk | 72 |
1 files changed, 72 insertions, 0 deletions
diff --git a/Mk/bsd.zenoss.mk b/Mk/bsd.zenoss.mk new file mode 100644 index 00000000000..f742ee6d22b --- /dev/null +++ b/Mk/bsd.zenoss.mk @@ -0,0 +1,72 @@ +#-*- mode: makefile; tab-width: 4; -*- +# ex:ts=4 +# +# $FreeBSD$ +# +# bsd.zenoss.mk - Support for Zenoss ports and Zenpacks. +# +# For FreeBSD committers: +# Please send all suggested changes to the maintainer instead of committing +# them to CVS yourself. + +bsd_zenoss_mk_MAINTAINER= zenoss@experts-exchange.com + +BUILD_DEPENDS+= zenoss>=3.1.0:${PORTSDIR}/net-mgmt/zenoss +RUN_DEPENDS+= zenoss>=3.1.0:${PORTSDIR}/net-mgmt/zenoss + +FETCH_ARGS?= -o - > ${DISTDIR}/${DISTFILES} +USE_ZIP?= yes + +PKGNAMEPREFIX:= zenpack-${ZPACKGROUP}- + +.if !defined(ZPACKGROUP) +IGNORE= will not work with undefined ZPACKGROUP (ex: core,community,etc) +.endif +ZENHOME= ${LOCALBASE}/zenoss +ZPACKHOME= ${LOCALBASE}/zenoss/ZenPack +ZPACKPREFIX?= ZenPacks.zenoss. +ZPACK?= ${ZPACKPREFIX}${PORTNAME}-${PORTVERSION}-${PYTHON_VERSION:S/thon//}.egg +PLIST_SUB+= ZPACK=${ZPACK} +SUB_LIST+= ZENHOME=${ZENHOME} \ + ZPACK=${ZPACK} \ + ZPACKHOME=${ZPACKHOME} \ + ZPACKPREFIX=${ZPACKPREFIX} \ + PORTNAME=${PORTNAME} +SUB_FILES+= pkg-message pkg-deinstall + +SHAREOWN= zenoss +SHAREGRP= zenoss + +# zenoss provides its own python 2.6 - we build against that for +# application compatibility +PYTHON_VERSION= python2.6 +PYTHON_CMD= ${ZENHOME}/bin/python +PYSETUP= ./setup.py + +MAKE_ENV+= ZENHOME=${ZENHOME} \ + INSTANCE_HOME=${ZENHOME} \ + PYTHONPATH=${ZENHOME}/lib/python \ + PATH=${ZENHOME}/bin:${PATH} + +.if !defined(UID) +UID!= /usr/bin/id -u +.endif + +.if !target(do-build) +do-build: +. if ${UID} != 0 && !defined(INSTALL_AS_USER) + @${ECHO_MSG} "===> Switching to root credentials for '${.TARGET}' target" + @cd ${.CURDIR} && \ + ${SU_CMD} "${MAKE} ${__softMAKEFLAGS} ${.TARGET}" + @${ECHO_MSG} "===> Returning to user credentials" +. else + cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} ${PYTHON_CMD} ${PYSETUP} bdist_egg +. endif +.endif + +.if !target(do-install) +do-install: + ${MKDIR} ${ZPACKHOME} + ${INSTALL_DATA} ${WRKSRC}/dist/${ZPACK} ${ZPACKHOME} + @${CAT} ${PKGMESSAGE} +.endif |