sthen 3cbe1c2f30 Reverse the polarity of MODPY_VERSION; default is now 3.x,
if a port needs 2.x then set MODPY_VERSION=${MODPY_DEFAULT_VERSION_2}.

This commit doesn't change any versions currently used; it may be that
some ports have MODPY_DEFAULT_VERSION_2 but don't require it, those
should be cleaned up in the course of updating ports where possible.

Python module ports providing py3-* packages should still use
FLAVOR=python3 so that we don't have a mixture of dependencies some
using ${MODPY_FLAVOR} and others not.
2021-02-23 19:39:08 +00:00

61 lines
1.9 KiB
Makefile

# $OpenBSD: Makefile,v 1.26 2021/02/23 19:39:33 sthen Exp $
FIX_EXTRACT_PERMISSIONS = Yes
COMMENT = Python classes providing access to network packets
MODPY_EGG_VERSION = 0.9.21
DISTNAME = impacket-${MODPY_EGG_VERSION}
PKGNAME = py-${DISTNAME}
EPOCH = 0
CATEGORIES = net security
REVISION = 0
HOMEPAGE = https://www.secureauth.com/labs/open-source-tools/impacket
# Apache modified
PERMIT_PACKAGE = Yes
MODULES = lang/python
MODPY_PI = Yes
MODPY_SETUPTOOLS = Yes
MODPY_ADJ_FILES = impacket/ese.py \
impacket/examples/logger.py \
impacket/examples/ntlmrelayx/clients/httprelayclient.py \
impacket/examples/ntlmrelayx/clients/ldaprelayclient.py \
impacket/examples/ntlmrelayx/clients/mssqlrelayclient.py \
impacket/examples/ntlmrelayx/clients/smbrelayclient.py \
impacket/examples/ntlmrelayx/servers/httprelayserver.py \
impacket/examples/ntlmrelayx/servers/smbrelayserver.py \
impacket/examples/ntlmrelayx/utils/config.py \
impacket/examples/ntlmrelayx/utils/targetsutils.py \
impacket/tds.py
# ntlmrelayx can additionaly use py-ldap3, py-flask and unported py-ldapdomaindump
RUN_DEPENDS = devel/py-asn1${MODPY_FLAVOR} \
devel/py-future${MODPY_FLAVOR} \
net/py-pcapy${MODPY_FLAVOR} \
security/py-cryptodome${MODPY_FLAVOR} \
security/py-openssl${MODPY_FLAVOR}
NO_TEST = Yes
pre-configure:
${SUBST_CMD} ${WRKSRC}/examples/goldenPac.py \
${WRKSRC}/examples/nmapAnswerMachine.py \
${WRKSRC}/examples/raiseChild.py
# Adjust Cryptodomex imports
find ${WRKSRC} -type f -name \*.py -exec sed -i 's,Cryptodome,Crypto,g' {} +
post-install:
${INSTALL_DATA_DIR} ${PREFIX}/share/examples/${PKGSTEM}
mv ${PREFIX}/bin/*.py ${PREFIX}/share/examples/${PKGSTEM}
mv ${PREFIX}/share/doc/impacket ${PREFIX}/share/doc/${PKGSTEM}
# Add missing shebangs
for i in ${PREFIX}/share/examples/${PKGSTEM}/*.py; do \
perl -pi -e 'print "#!${MODPY_BIN}\n" if $$. == 1' $${i}; \
done
.include <bsd.port.mk>