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 | |||||
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} | USES= python shebangfix | ||||
RUN_DEPENDS+= ${PYTHON_PKGNAMEPREFIX}supervisor>=0:sysutils/py-supervisor@${PY_FLAVOR} | USE_PYTHON= autoplist 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… | |||||
USES= python:2.7 shebangfix | |||||
USE_PYTHON= flavors | |||||
SHEBANG_REGEX= '.*\.py$$' | SHEBANG_REGEX= '.*\.py$$' | ||||
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_GITHUB= yes | |||||
GH_ACCOUNT= jpmens | |||||
NO_ARCH= yes | NO_ARCH= yes | ||||
OPTIONS_DEFINE= DOCS EXAMPLES | OPTIONS_DEFINE= DOCS EXAMPLES | ||||
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 | |||||
USERS= mqttwarn | USERS= mqttwarn | ||||
GROUPS= mqttwarn | GROUPS= mqttwarn | ||||
SUB_FILES= pkg-message | SUB_FILES= pkg-message mqttwarn | ||||
post-patch: | post-patch: | ||||
@${REINPLACE_CMD} -e 's|MQTTWARN_LIBDIR|${PYTHON_SITELIBDIR}/${PORTNAME}/lib/|g' ${WRKSRC}/mqttwarn.ini.sample | ${RM} ${WRKSRC}/mqttwarn.egg-info/requires.txt.orig \ | ||||
${WRKSRC}/tests/bad_funcs.py.orig \ | |||||
${WRKSRC}/mqttwarn/configuration.py.orig \ | |||||
${WRKSRC}/mqttwarn/examples/basic/mqttwarn.ini.orig \ | |||||
${WRKSRC}/mqttwarn/core.py.orig | |||||
do-build: | do-test: | ||||
(cd ${WRKSRC} && ${PYTHON_CMD} -m compileall .) | cd ${WRKSRC} ; ${PYTHON_CMD} ${PYDISTUTILS_SETUP} test | ||||
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: | post-install: | ||||
${MKDIR} ${STAGEDIR}/var/log/${PORTNAME} | ${INSTALL_SCRIPT} ${WRKDIR}/mqttwarn ${STAGEDIR}${PREFIX}/etc/rc.d | ||||
${INSTALL_SCRIPT} ${WRKSRC}/mqttwarn.py ${STAGEDIR}${PREFIX}/sbin/mqttwarn | @${ECHO_CMD} "etc/rc.d/mqttwarn" >> ${TMPPLIST} | ||||
(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} | |||||
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 ? | |||||
do-install-DOCS-on: | ${MKDIR} ${STAGEDIR}${ETCDIR} | ||||
@${MKDIR} ${STAGEDIR}${DOCSDIR} | ${INSTALL_SCRIPT} ${WRKSRC}/mqttwarn/examples/basic/mqttwarn.ini ${STAGEDIR}${ETCDIR}/mqttwarn.ini.sample | ||||
${INSTALL_DATA} ${WRKSRC}/README.md ${STAGEDIR}${DOCSDIR} | @${ECHO_CMD} "@dir ${ETCDIR}" >> ${TMPPLIST} | ||||
@${ECHO_CMD} "@sample(mqttwarn,mqttwarn,0640) ${ETCDIR}/mqttwarn.ini.sample" >> ${TMPPLIST} | |||||
do-install-EXAMPLES-on: | ${MKDIR} ${STAGEDIR}/var/run/mqttwarn | ||||
@${MKDIR} ${STAGEDIR}${EXAMPLESDIR} | @${ECHO_CMD} "@dir /var/run/mqttwarn" >> ${TMPPLIST} | ||||
(cd ${WRKSRC}/examples && ${COPYTREE_SHARE} . ${STAGEDIR}${EXAMPLESDIR}) | |||||
${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