freebsd-ports/net/dshell/Makefile
2020-03-21 12:01:00 +00:00

79 lines
2.6 KiB
Makefile

# Created by: Nobutaka Mantani <nobutaka@FreeBSD.org>
# $FreeBSD$
PORTNAME= dshell
PORTVERSION= 3.0.${SNAPDATE}
CATEGORIES= net
MAINTAINER= nobutaka@FreeBSD.org
COMMENT= Extensible network forensic analysis framework
LICENSE= MIT
LICENSE_FILE= ${WRKSRC}/LICENSE.txt
DEPRECATED= Uses deprecated version of python
EXPIRATION_DATE= 2020-09-15
BUILD_DEPENDS= bash:shells/bash \
${PYTHON_PKGNAMEPREFIX}GeoIP2>0:net/py-GeoIP2@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}pycryptodome>0:security/py-pycryptodome@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}dpkt>0:net/py-dpkt@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}ipy>0:net-mgmt/py-ipy@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}pypcap>0:net/py-pypcap@${PY_FLAVOR}
RUN_DEPENDS:= ${BUILD_DEPENDS}
USES= python:2.7 shebangfix
USE_GITHUB= yes
NO_ARCH= yes
SHEBANG_FILES= bin/*.py
GH_ACCOUNT= USArmyResearchLab
GH_PROJECT= Dshell
GH_TAGNAME= 2c63476
SNAPDATE= 20200302
OPTIONS_DEFINE= DOCS
MAKE_ENV+= PYTHON_CMD=${PYTHON_CMD}
post-patch:
.for f in bin/generate-dshellrc.py doc/generate-doc.sh
${REINPLACE_CMD} -e 's|/bin/bash|${LOCALBASE}/bin/bash|' ${WRKSRC}/${f}
${REINPLACE_CMD} -e 's|pydoc|${LOCALBASE}/bin/pydoc${PYTHON_VER}|' ${WRKSRC}/${f}
.endfor
post-build:
${RM} -r ${WRKSRC}/lib/${PYTHON_VERSION}
${REINPLACE_CMD} -e 's|${WRKSRC}|${ETCDIR}|' ${WRKSRC}/dshell ${WRKSRC}/dshell-decode
${REINPLACE_CMD} -e 's|BINPATH=${WRKSRC}/bin|BINPATH=${PREFIX}/libexec/dshell|' \
-e 's|DSHELL=${WRKSRC}|DSHELL=${PYTHON_SITELIBDIR}|' \
-e 's|DATAPATH=${WRKSRC}/share|DATAPATH=${DATADIR}|' \
-e 's|DECODERPATH=${WRKSRC}/decoders|DECODERPATH=${PYTHON_SITELIBDIR}/dshell/decoders|' \
-e 's|LIBPATH=${WRKSRC}/lib|LIBPATH=${PYTHON_SITELIBDIR}/dshell|' \
${WRKSRC}/.dshellrc
(cd ${WRKSRC}/doc; ${REINPLACE_CMD} -e 's|${WRKSRC}|${PYTHON_SITELIBDIR}/dshell|g' *.html)
do-install:
.for f in dshell dshell-decode
${INSTALL_SCRIPT} ${WRKSRC}/${f} ${STAGEDIR}/${PREFIX}/bin
.endfor
${MKDIR} ${STAGEDIR}/${PREFIX}/libexec/dshell
.for f in decode.py pcapanon.py
${INSTALL_SCRIPT} ${WRKSRC}/bin/${f} ${STAGEDIR}/${PREFIX}/libexec/dshell
.endfor
(cd ${STAGEDIR}/${PREFIX}/libexec/dshell; \
${LN} -sf decode.py decode)
${MKDIR} ${STAGEDIR}/${PREFIX}/etc/dshell
${INSTALL_DATA} ${WRKSRC}/.dshellrc ${STAGEDIR}/${PREFIX}/etc/dshell
(cd ${WRKSRC}/lib; ${COPYTREE_SHARE} . ${STAGEDIR}/${PYTHON_SITELIBDIR}/dshell)
(cd ${WRKSRC}/decoders; ${COPYTREE_SHARE} . ${STAGEDIR}/${PYTHON_SITELIBDIR}/dshell/decoders)
${MKDIR} ${STAGEDIR}/${DATADIR}/GeoIP
do-install-DOCS-on:
${MKDIR} ${STAGEDIR}/${DOCSDIR}
${INSTALL_DATA} ${WRKSRC}/README.md ${STAGEDIR}/${DOCSDIR}
(cd ${WRKSRC}/doc; ${COPYTREE_SHARE} . ${STAGEDIR}/${DOCSDIR} "-name *\.html")
.include <bsd.port.mk>