comms/py-pyserial: Add an EXAMPLES option

The pyserial distribution includes a handy tcp/serial port bridge
script called tcp_serial_redirect.py. Add an EXAMPLES option to
install this (along with other pyserial example scripts).

PR:		260328
Approved by:	sbz (maintainer timeout, 18 days)
This commit is contained in:
Craig Leres 2021-12-28 09:37:39 -08:00
parent c42a1647d9
commit e237c91212

View File

@ -2,7 +2,7 @@
PORTNAME= pyserial
PORTVERSION= 3.5
PORTREVISION= 1
PORTREVISION= 2
CATEGORIES= comms python
MASTER_SITES= CHEESESHOP
PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX}
@ -13,13 +13,29 @@ COMMENT= Serial port encapsulation library for Python
LICENSE= BSD3CLAUSE
LICENSE_FILE= ${WRKSRC}/LICENSE.txt
USES= python:3.6+
USES= python:3.6+ shebangfix
SHEBANG_FILES= examples/*.py
USE_PYTHON= distutils autoplist concurrent
PORTEXAMPLES= at_protocol.py port_publisher.py rfc2217_server.py \
setup-miniterm-py2exe.py setup-rfc2217_server-py2exe.py \
setup-wxTerminal-py2exe.py tcp_serial_redirect.py \
wxSerialConfigDialog.py wxTerminal.py
EXAMPLESDIR= ${PREFIX}/share/examples/py-${PORTNAME}
OPTIONS_DEFINE= EXAMPLES
NO_ARCH= yes
post-install:
${MKDIR} ${STAGEDIR}${EXAMPLESDIR}
${INSTALL_SCRIPT} ${PORTEXAMPLES:S,^,${WRKSRC}/examples/,} \
${STAGEDIR}${EXAMPLESDIR}
do-test:
${SETENV} PYTHONPATH=${STAGEDIR}${PYTHONPREFIX_SITELIBDIR} ${PYTHON_CMD} ${WRKSRC}/test/test.py
${SETENV} PYTHONPATH=${STAGEDIR}${PYTHONPREFIX_SITELIBDIR} \
${PYTHON_CMD} ${WRKSRC}/test/test.py
.include <bsd.port.mk>