| 4 +- sysutils/py-ansible-core220/Makefile | 4 +- 8 files changed, 102 insertions(+), 88 deletions(-) diff --git a/sysutils/Makefile b/sysutils/Makefile index fda7ebe8d3a7..4ca46f71bb60 100644 --- a/sysutils/Makefile +++ b/sysutils/Makefile @@ -1037,6 +1037,7 @@ SUBDIR += pxattr SUBDIR += py-ansible-compat SUBDIR += py-ansible-core + SUBDIR += py-ansible-core218 SUBDIR += py-ansible-core219 SUBDIR += py-ansible-core220 SUBDIR += py-ansible-lint diff --git a/sysutils/py-ansible-core/Makefile b/sysutils/py-ansible-core/Makefile index 3250719362c3..7990dae8dd3f 100644 --- a/sysutils/py-ansible-core/Makefile +++ b/sysutils/py-ansible-core/Makefile @@ -1,88 +1,6 @@ -PORTNAME= ansible-core -DISTVERSION= 2.18.7 -PORTREVISION= 1 -CATEGORIES= sysutils python -MASTER_SITES= PYPI -PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX} -DISTFILES= ${PORTNAME:R:S/-/_/}-${DISTVERSION}${EXTRACT_SUFX} +VERSIONS= 218 219 220 +ANSIBLE_CORE_VERSION?= 218 -MAINTAINER= cy@FreeBSD.org -COMMENT= Radically simple IT automation -WWW= https://www.ansible.com/ +MASTERDIR= ${.CURDIR}/../py-ansible-core${ANSIBLE_CORE_VERSION} -WRKSRC= ${WRKDIR}/${PORTNAME:R:S/-/_/}-${DISTVERSION} - -LICENSE= GPLv3+ -LICENSE_FILE= ${WRKSRC}/COPYING - -BUILD_DEPENDS= ${PY_SETUPTOOLS} \ - ${PYTHON_PKGNAMEPREFIX}wheel>=0:devel/py-wheel@${PY_FLAVOR} -RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}Jinja2>=3.0.0:devel/py-Jinja2@${PY_FLAVOR} \ - ${PYTHON_PKGNAMEPREFIX}packaging>=0:devel/py-packaging@${PY_FLAVOR} \ - ${PYTHON_PKGNAMEPREFIX}resolvelib>=0.5.3<1.1.0:devel/py-resolvelib@${PY_FLAVOR} \ - ${PYTHON_PKGNAMEPREFIX}toml>0:textproc/py-toml@${PY_FLAVOR} \ - ${PYTHON_PKGNAMEPREFIX}passlib>0:security/py-passlib@${PY_FLAVOR} \ - ${PYTHON_PKGNAMEPREFIX}pyyaml>=5.1:devel/py-pyyaml@${PY_FLAVOR} -TEST_DEPENDS= ${PYTHON_PKGNAMEPREFIX}bcrypt>=0:security/py-bcrypt@${PY_FLAVOR} \ - ${PYTHON_PKGNAMEPREFIX}boto3>0:www/py-boto3@${PY_FLAVOR} \ - ${PYTHON_PKGNAMEPREFIX}mock>0:devel/py-mock@${PY_FLAVOR} \ - ${PYTHON_PKGNAMEPREFIX}nose>0:devel/py-nose@${PY_FLAVOR} \ - ${PYTHON_PKGNAMEPREFIX}passlib>0:security/py-passlib@${PY_FLAVOR} \ - ${PYTHON_PKGNAMEPREFIX}pycryptodome>=0:security/py-pycryptodome@${PY_FLAVOR} \ - ${PYTHON_PKGNAMEPREFIX}pytest-mock>0:devel/py-pytest-mock@${PY_FLAVOR} \ - ${PYTHON_PKGNAMEPREFIX}pytest-xdist>0:devel/py-pytest-xdist@${PY_FLAVOR} \ - ${PYTHON_PKGNAMEPREFIX}pytest>0:devel/py-pytest@${PY_FLAVOR} \ - ${PYTHON_PKGNAMEPREFIX}requests>0:www/py-requests@${PY_FLAVOR} \ - git:devel/git - -USES= ansible:env cpe python shebangfix -CPE_VENDOR= redhat -CPE_PRODUCT= ansible -USE_PYTHON= autoplist concurrent cryptography pep517 - -SHEBANG_REGEX= [.]/test/.*[.]py - -# Pass MAKE_ENV to TEST_ENV so that binary aliases via an updated PATH. -TEST_ENV= ${MAKE_ENV} - -# The "python" binary alias is needed for the tests. -BINARY_ALIAS= python=${PYTHON_CMD} -NO_ARCH= yes - -post-patch: -# Preserve the original paths in -# test/units/cli/galaxy/test_execute_list_collection.py. -# Replacing /usr/share/ansible breaks tests. - ${FIND} ${WRKSRC} -not -regex '${WRKSRC}/test/units/cli/galaxy/test_execute_list_collection.py' -type f -print0 | \ - ${XARGS} -0 ${REINPLACE_CMD} \ - -e 's|/etc/ansible|${ETCDIR}|g' \ - -e 's|/usr/share/ansible|${DATADIR}|g' - ${FIND} ${WRKSRC} -type f -name "*.bak" -delete - -post-stage: - ${FIND} ${STAGEDIR}${PREFIX}/bin -type l -name ansible-\* -lname ansible \ - -execdir ${RLN} ansible-${PYTHON_VER} {} \; -# USE_PYTHON=autoplist doesn't add this file to pkg-plist. - ${RM} ${STAGEDIR}${PYTHONPREFIX_SITELIBDIR}/ansible_test/_data/injector/ansible-inventory - -pre-test: -# This one file does not get its paths replaced correctly in post-patch. - ${REINPLACE_CMD} 's|"/etc"|"${ETCDIR:H}"|g' \ - ${WRKSRC}/test/units/playbook/test_helpers.py -# This test constructs a Python script inline and uses an invalid path to it. - ${REINPLACE_CMD} 's|/usr/bin/python|${PYTHON_CMD}|' \ - ${WRKSRC}/test/units/modules/test_async_wrapper.py -# Skip the SELinux tests, it's not present on FreeBSD. - ${RM} ${WRKSRC}/test/units/module_utils/basic/test_selinux.py -# Disable some failing tests. They fail to detect that emoji are of width 2 istead of 1. - ${RM} ${WRKSRC}/test/units/utils/test_display.py - -do-test: - @cd ${TEST_WRKSRC} && ${SETENV} ${TEST_ENV} ./bin/ansible-test units -v --python ${PYTHON_VER} - -.include - -# Make sure that we override the unique DATADIR and ETCDIR set -# by the implicit USES=uniquefiles. -DATADIR= ${ANSIBLE_DATADIR} -ETCDIR= ${ANSIBLE_ETCDIR} +.include "${MASTERDIR}/Makefile" diff --git a/sysutils/py-ansible-core218/Makefile b/sysutils/py-ansible-core218/Makefile new file mode 100644 index 000000000000..f0fbedf68cc3 --- /dev/null +++ b/sysutils/py-ansible-core218/Makefile @@ -0,0 +1,91 @@ +PORTNAME= ansible-core +DISTVERSION= 2.18.7 +PORTREVISION= 1 +CATEGORIES= sysutils python +MASTER_SITES= PYPI +PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX} +DISTFILES= ${PORTNAME:R:S/-/_/}-${DISTVERSION}${EXTRACT_SUFX} +.if !defined(MASTERDIR) +PKGNAMESUFFIX= 218 +.endif + +MAINTAINER= cy@FreeBSD.org +COMMENT= Radically simple IT automation +WWW= https://www.ansible.com/ + +WRKSRC= ${WRKDIR}/${PORTNAME:R:S/-/_/}-${DISTVERSION} + +LICENSE= GPLv3+ +LICENSE_FILE= ${WRKSRC}/COPYING + +BUILD_DEPENDS= ${PY_SETUPTOOLS} \ + ${PYTHON_PKGNAMEPREFIX}wheel>=0:devel/py-wheel@${PY_FLAVOR} +RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}Jinja2>=3.0.0:devel/py-Jinja2@${PY_FLAVOR} \ + ${PYTHON_PKGNAMEPREFIX}packaging>=0:devel/py-packaging@${PY_FLAVOR} \ + ${PYTHON_PKGNAMEPREFIX}resolvelib>=0.5.3<1.1.0:devel/py-resolvelib@${PY_FLAVOR} \ + ${PYTHON_PKGNAMEPREFIX}toml>0:textproc/py-toml@${PY_FLAVOR} \ + ${PYTHON_PKGNAMEPREFIX}passlib>0:security/py-passlib@${PY_FLAVOR} \ + ${PYTHON_PKGNAMEPREFIX}pyyaml>=5.1:devel/py-pyyaml@${PY_FLAVOR} +TEST_DEPENDS= ${PYTHON_PKGNAMEPREFIX}bcrypt>=0:security/py-bcrypt@${PY_FLAVOR} \ + ${PYTHON_PKGNAMEPREFIX}boto3>0:www/py-boto3@${PY_FLAVOR} \ + ${PYTHON_PKGNAMEPREFIX}mock>0:devel/py-mock@${PY_FLAVOR} \ + ${PYTHON_PKGNAMEPREFIX}nose>0:devel/py-nose@${PY_FLAVOR} \ + ${PYTHON_PKGNAMEPREFIX}passlib>0:security/py-passlib@${PY_FLAVOR} \ + ${PYTHON_PKGNAMEPREFIX}pycryptodome>=0:security/py-pycryptodome@${PY_FLAVOR} \ + ${PYTHON_PKGNAMEPREFIX}pytest-mock>0:devel/py-pytest-mock@${PY_FLAVOR} \ + ${PYTHON_PKGNAMEPREFIX}pytest-xdist>0:devel/py-pytest-xdist@${PY_FLAVOR} \ + ${PYTHON_PKGNAMEPREFIX}pytest>0:devel/py-pytest@${PY_FLAVOR} \ + ${PYTHON_PKGNAMEPREFIX}requests>0:www/py-requests@${PY_FLAVOR} \ + git:devel/git + +USES= ansible:env cpe python shebangfix +CPE_VENDOR= redhat +CPE_PRODUCT= ansible +USE_PYTHON= autoplist concurrent cryptography pep517 + +SHEBANG_REGEX= [.]/test/.*[.]py + +# Pass MAKE_ENV to TEST_ENV so that binary aliases via an updated PATH. +TEST_ENV= ${MAKE_ENV} + +# The "python" binary alias is needed for the tests. +BINARY_ALIAS= python=${PYTHON_CMD} +NO_ARCH= yes + +post-patch: +# Preserve the original paths in +# test/units/cli/galaxy/test_execute_list_collection.py. +# Replacing /usr/share/ansible breaks tests. + ${FIND} ${WRKSRC} -not -regex '${WRKSRC}/test/units/cli/galaxy/test_execute_list_collection.py' -type f -print0 | \ + ${XARGS} -0 ${REINPLACE_CMD} \ + -e 's|/etc/ansible|${ETCDIR}|g' \ + -e 's|/usr/share/ansible|${DATADIR}|g' + ${FIND} ${WRKSRC} -type f -name "*.bak" -delete + +post-stage: + ${FIND} ${STAGEDIR}${PREFIX}/bin -type l -name ansible-\* -lname ansible \ + -execdir ${RLN} ansible-${PYTHON_VER} {} \; +# USE_PYTHON=autoplist doesn't add this file to pkg-plist. + ${RM} ${STAGEDIR}${PYTHONPREFIX_SITELIBDIR}/ansible_test/_data/injector/ansible-inventory + +pre-test: +# This one file does not get its paths replaced correctly in post-patch. + ${REINPLACE_CMD} 's|"/etc"|"${ETCDIR:H}"|g' \ + ${WRKSRC}/test/units/playbook/test_helpers.py +# This test constructs a Python script inline and uses an invalid path to it. + ${REINPLACE_CMD} 's|/usr/bin/python|${PYTHON_CMD}|' \ + ${WRKSRC}/test/units/modules/test_async_wrapper.py +# Skip the SELinux tests, it's not present on FreeBSD. + ${RM} ${WRKSRC}/test/units/module_utils/basic/test_selinux.py +# Disable some failing tests. They fail to detect that emoji are of width 2 istead of 1. + ${RM} ${WRKSRC}/test/units/utils/test_display.py + +do-test: + @cd ${TEST_WRKSRC} && ${SETENV} ${TEST_ENV} ./bin/ansible-test units -v --python ${PYTHON_VER} + +.include + +# Make sure that we override the unique DATADIR and ETCDIR set +# by the implicit USES=uniquefiles. +DATADIR= ${ANSIBLE_DATADIR} +ETCDIR= ${ANSIBLE_ETCDIR} diff --git a/sysutils/py-ansible-core/distinfo b/sysutils/py-ansible-core218/distinfo similarity index 100% rename from sysutils/py-ansible-core/distinfo rename to sysutils/py-ansible-core218/distinfo diff --git a/sysutils/py-ansible-core/files/patch-pyproject.toml b/sysutils/py-ansible-core218/files/patch-pyproject.toml similarity index 100% rename from sysutils/py-ansible-core/files/patch-pyproject.toml rename to sysutils/py-ansible-core218/files/patch-pyproject.toml diff --git a/sysutils/py-ansible-core/pkg-descr b/sysutils/py-ansible-core218/pkg-descr similarity index 100% rename from sysutils/py-ansible-core/pkg-descr rename to sysutils/py-ansible-core218/pkg-descr diff --git a/sysutils/py-ansible-core219/Makefile b/sysutils/py-ansible-core219/Makefile index 4cd3a8da7154..8d26a83e9f63 100644 --- a/sysutils/py-ansible-core219/Makefile +++ b/sysutils/py-ansible-core219/Makefile @@ -4,8 +4,10 @@ PORTREVISION= 1 CATEGORIES= sysutils python MASTER_SITES= PYPI PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX} -PKGNAMESUFFIX= 219 DISTFILES= ${PORTNAME:R:S/-/_/}-${DISTVERSION}${EXTRACT_SUFX} +.if !defined(MASTERDIR) +PKGNAMESUFFIX= 219 +.endif MAINTAINER= cy@FreeBSD.org COMMENT= Radically simple IT automation diff --git a/sysutils/py-ansible-core220/Makefile b/sysutils/py-ansible-core220/Makefile index fe60a7437215..2f1b83402c72 100644 --- a/sysutils/py-ansible-core220/Makefile +++ b/sysutils/py-ansible-core220/Makefile @@ -8,8 +8,10 @@ DISTVERSION= 2.20.2 CATEGORIES= sysutils python MASTER_SITES= PYPI PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX} -PKGNAMESUFFIX= 220 DISTFILES= ${PORTNAME:R:S/-/_/}-${DISTVERSION}${EXTRACT_SUFX} +.if !defined(MASTERDIR) +PKGNAMESUFFIX= 220 +.endif MAINTAINER= cy@FreeBSD.org COMMENT= Radically simple IT automation