Changeset View
Standalone View
sysutils/py-mqttwarn/Makefile
# $FreeBSD$ | # $FreeBSD$ | ||||
PORTNAME= mqttwarn | PORTNAME= mqttwarn | ||||
DISTVERSION= 0.10.4 | DISTVERSION= 0.16.2 | ||||
PORTREVISION= 1 | |||||
CATEGORIES= sysutils python | CATEGORIES= sysutils python | ||||
MASTER_SITES= CHEESESHOP | |||||
PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX} | PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX} | ||||
MAINTAINER= dvl@FreeBSD.org | MAINTAINER= dvl@FreeBSD.org | ||||
COMMENT= Subscribe to MQTT topics and notify pluggable services | COMMENT= Subscribe to MQTT topics and notify pluggable services | ||||
LICENSE= EPL | LICENSE= EPL | ||||
LICENSE_FILE= ${WRKSRC}/LICENSE | |||||
DEPRECATED= Uses deprecated version of python | RUN_DEPENDS+= ${PYTHON_PKGNAMEPREFIX}six>0:devel/py-six@${PY_FLAVOR} \ | ||||
EXPIRATION_DATE= 2020-08-15 | ${PYTHON_PKGNAMEPREFIX}paho-mqtt>=0:net/py-paho-mqtt@${PY_FLAVOR} \ | ||||
${PYTHON_PKGNAMEPREFIX}Jinja2>0:devel/py-Jinja2@${PY_FLAVOR} \ | |||||
${PYTHON_PKGNAMEPREFIX}attrs>0:devel/py-attrs@${PY_FLAVOR} \ | |||||
${PYTHON_PKGNAMEPREFIX}docopt>0:devel/py-docopt@${PY_FLAVOR} \ | |||||
${PYTHON_PKGNAMEPREFIX}requests>0:www/py-requests@${PY_FLAVOR} \ | |||||
${PYTHON_PKGNAMEPREFIX}future>0:devel/py-future@${PY_FLAVOR} \ | |||||
${PYTHON_PKGNAMEPREFIX}configparser>0:devel/py-configparser@${PY_FLAVOR} | |||||
koobs: This can be dropped if it now supports versions other than 2.7 | |||||
koobsUnsubmitted Not Done Inline ActionsRUN_DEPENDS <version-specs> should always match those in setup.py as closely as possible: + 'six>=1.13.0', + 'paho-mqtt>=1.4.0', + 'jinja2>=2.10.1', + 'attrs>=19.3.0', + 'docopt>=0.6.2', + 'requests>=2.22.0', + 'future>=0.18.2', + 'configparser>=3.5.3', koobs: RUN_DEPENDS <version-specs> should always match those in setup.py as closely as possible:
```… | |||||
RUN_DEPENDS+= ${PYTHON_PKGNAMEPREFIX}paho-mqtt>=0:net/py-paho-mqtt@${PY_FLAVOR} | # based on setup.py : tests_require=extras['test'], | ||||
RUN_DEPENDS+= ${PYTHON_PKGNAMEPREFIX}supervisor>=0:sysutils/py-supervisor@${PY_FLAVOR} | TEST_DEPENDS= ${PYTHON_PKGNAMEPREFIX}pytest>0:devel/py-pytest@${PY_FLAVOR} | ||||
USES= python:2.7 shebangfix | USES= python shebangfix | ||||
Done Inline Actionscov (coverage) and (tox) are upstream development related test dependencies, and not necessary for downstream testing.
do-test: @cd ${WRKSRC} && ${PYTHON_CMD} -m pytest -v -rs -o addopts= -o addopts= overrides test settings/arguments set in pytest.ini or setup.cfg:[pytest] sections (which adds --cov, requiring pytest-cov) Upstream should move these 'non-compulsory' test dependencies to an extras_require[dev] section, that tox.ini then pulls in. This will leave extras_require[test] as purely compulsory test dependencies (pytest, and optional run time deps) [1] https://github.com/jpmens/mqttwarn/blob/master/tox.ini#L8 koobs: cov (coverage) and (tox) are upstream development related test dependencies, and not necessary… | |||||
USE_PYTHON= flavors | USE_PYTHON= autoplist concurrent distutils | ||||
Done Inline ActionsWhy does this need flavors? koobs: Why does this need flavors? | |||||
Done Inline ActionsI cannot recall now. Removed. dvl: I cannot recall now. Removed. | |||||
Done Inline ActionsPorts should 'declare' the versions that a package supports and not unnecessarily restrict/limit them. The package support 2.7. USES=python is appropriate here. koobs: Ports should 'declare' the versions that a package supports and not unnecessarily… | |||||
SHEBANG_REGEX= '.*\.py$$' | SHEBANG_REGEX= '.*\.py$$' | ||||
USE_GITHUB= yes | |||||
GH_ACCOUNT= jpmens | |||||
NO_ARCH= yes | NO_ARCH= yes | ||||
Done Inline ActionsCan we collapse these lines into a single RUN_DEPENDS with \ line endings koobs: Can we collapse these lines into a single RUN_DEPENDS with \ line endings | |||||
OPTIONS_DEFINE= DOCS EXAMPLES | # Most of what is in setup.py under extras is supported. | ||||
# The following were omitted because their dependencies are not found in the | |||||
# FreeBSD port tree: AMQP APPRISE ASTERISK FBCHAT IOHUB NMA NSCA OSXNOTIFY PASTEBINPUB PROWL PUSHBULLET | |||||
# SLACK TOOTPASTE XIVELY XMPP | |||||
OPTIONS_DEFINE= DOCS EXAMPLES \ | |||||
APNS CELERY DNSUPDATE GSS GSS2 MYSQL POSTGRES REISPUB RRDTOOL \ | |||||
SERIAL SSH TWILIO TWITTER WEBSOCKET | |||||
USERS= mqttwarn | USERS= mqttwarn | ||||
GROUPS= mqttwarn | GROUPS= mqttwarn | ||||
SUB_FILES= pkg-message | SUB_FILES= pkg-message mqttwarn | ||||
post-patch: | APNS_DESC= Apple Push Notifications | ||||
@${REINPLACE_CMD} -e 's|MQTTWARN_LIBDIR|${PYTHON_SITELIBDIR}/${PORTNAME}/lib/|g' ${WRKSRC}/mqttwarn.ini.sample | CELERY_DESC= Asynchronous task queue/job queue | ||||
DNSUPDATE_DESC= DNS updates | |||||
GSS_DESC= Google Docs Spreadsheet | |||||
GSS2_DESC= Google Docs Spreadsheet 2 | |||||
MYSQL_DESC= MySQL plugin | |||||
POSTGRES_DESC= PostgreSQL Plugin | |||||
REISPUB_DESC= Publishes to a Redis channel | |||||
RRDTOOL_DESC= Updates a round robin database created by rrdtool | |||||
SERIAL_DESC= Serial port | |||||
SSH_DESC= ssh plugin | |||||
TWILIO_DESC= Use Twilio API to send messages | |||||
TWITTER_DESC= Notifications to Twitter accounts | |||||
WEBSOCKET_DESC= Websocket | |||||
do-build: | APNS_RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}apns2>=2.0.1:devel/py-apns2@${PY_FLAVOR} | ||||
(cd ${WRKSRC} && ${PYTHON_CMD} -m compileall .) | CELERY_RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}celery>0:devel/py-celery@${PY_FLAVOR} | ||||
DNSUPDATE_RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}dnspython>=1.15.0:dns/py-dnspython@${PY_FLAVOR} | |||||
GSS_RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}gdata>=2.0.18:devel/py-gdata@${PY_FLAVOR} | |||||
GSS2_RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}gspread>=2.1.10:net/py-gspread@${PY_FLAVOR} \ | |||||
${PYTHON_PKGNAMEPREFIX}oauth2client>=4.1.2:security/py-oauth2client@${PY_FLAVOR} | |||||
MYSQL_USES= mysql | |||||
koobsUnsubmitted Done Inline Actionsis this all that's required? There's no Python mysql package required to wrap mysqlclient.so ? koobs: is this all that's required? There's no Python mysql package required to wrap mysqlclient.so ? | |||||
POSTGRES_RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}psycopg2>=2.7.4:databases/py-psycopg2@${PY_FLAVOR} | |||||
REISPUB_RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}redis>=2.10.6:databases/py-redis@${PY_FLAVOR} | |||||
RRDTOOL_LIB_DEPENDS= librrd.so:databases/rrdtool | |||||
SERIAL_RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}pyserial>3.40:comms/py-pyserial@${PY_FLAVOR} | |||||
SSH_RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}paramiko>2.4.1:security/py-paramiko@${PY_FLAVOR} | |||||
TWILIO_RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}twilio>6.11.0:devel/py-twilio@${PY_FLAVOR} | |||||
TWITTER_RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}python-twitter>=3.4.1:net/py-python-twitter@${PY_FLAVOR} | |||||
WEBSOCKET_RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}websocket-client>=0.47.0:www/py-websocket-client@${PY_FLAVOR} | |||||
Not Done Inline ActionsAll of these extras_require (optional deps) need to be switched from == to >= too. Note: this does not guarantee that upstream tests with them, or that they will work. Upstream needs to change their pinned (==) deps to >= (for sdist/setup.py/users) so that they are testing future versions of their dependencies before users get them. This also avoids conflicts between package versions downstream as well. If they want to continue to pin versions, this can be done in requirements.txt files (unrelated to distribution), but this is not recommended either. koobs: All of these extras_require (optional deps) need to be switched from == to >= too.
Note: this… | |||||
do-install: | do-test: | ||||
${MKDIR} ${STAGEDIR}/var/log/${PORTNAME} | @cd ${WRKSRC} && ${PYTHON_CMD} -m pytest -v -rs -o addopts= | ||||
${INSTALL_SCRIPT} ${WRKSRC}/mqttwarn.py ${STAGEDIR}${PREFIX}/sbin/mqttwarn | |||||
(cd ${WRKSRC}/etc && ${COPYTREE_SHARE} . ${STAGEDIR}${ETCDIR}) | |||||
(cd ${WRKSRC}/services && ${COPYTREE_SHARE} . ${STAGEDIR}${PYTHON_SITELIBDIR}/${PORTNAME}/lib/services) | |||||
${CP} ${WRKSRC}/mqttwarn.ini.sample ${STAGEDIR}${ETCDIR} | |||||
do-install-DOCS-on: | post-install: | ||||
@${MKDIR} ${STAGEDIR}${DOCSDIR} | ${INSTALL_SCRIPT} ${WRKDIR}/mqttwarn ${STAGEDIR}${PREFIX}/etc/rc.d | ||||
${INSTALL_DATA} ${WRKSRC}/README.md ${STAGEDIR}${DOCSDIR} | @${ECHO_CMD} "etc/rc.d/mqttwarn" >> ${TMPPLIST} | ||||
do-install-EXAMPLES-on: | ${MKDIR} ${STAGEDIR}${ETCDIR} | ||||
@${MKDIR} ${STAGEDIR}${EXAMPLESDIR} | ${INSTALL_SCRIPT} ${WRKSRC}/mqttwarn/examples/basic/mqttwarn.ini ${STAGEDIR}${ETCDIR}/mqttwarn.ini.sample | ||||
(cd ${WRKSRC}/examples && ${COPYTREE_SHARE} . ${STAGEDIR}${EXAMPLESDIR}) | @${ECHO_CMD} "@dir ${ETCDIR}" >> ${TMPPLIST} | ||||
@${ECHO_CMD} "@sample(mqttwarn,mqttwarn,0640) ${ETCDIR}/mqttwarn.ini.sample" >> ${TMPPLIST} | |||||
${MKDIR} ${STAGEDIR}/var/run/mqttwarn | |||||
@${ECHO_CMD} "@dir /var/run/mqttwarn" >> ${TMPPLIST} | |||||
${MKDIR} ${STAGEDIR}/var/log/mqttwarn | |||||
@${ECHO_CMD} "@dir(mqttwarn,mqttwarn,) /var/log/mqttwarn" >> ${TMPPLIST} | |||||
.include <bsd.port.mk> | .include <bsd.port.mk> |
This can be dropped if it now supports versions other than 2.7