git: db2183a6ff2d - main - sysutils/py-ansible-base: Add a new port
Mateusz Piotrowski
0mp at FreeBSD.org
Wed May 12 18:45:46 UTC 2021
The branch main has been updated by 0mp:
URL: https://cgit.FreeBSD.org/ports/commit/?id=db2183a6ff2d726b01d0792a960d00d780eddffb
commit db2183a6ff2d726b01d0792a960d00d780eddffb
Author: Mateusz Piotrowski <0mp at FreeBSD.org>
AuthorDate: 2021-05-12 18:45:07 +0000
Commit: Mateusz Piotrowski <0mp at FreeBSD.org>
CommitDate: 2021-05-12 18:45:52 +0000
sysutils/py-ansible-base: Add a new port
ansible-base is the Python package containing the essential parts of
Ansible. It is going to be replaced with ansible-core in the future
releases.
---
sysutils/Makefile | 1 +
sysutils/py-ansible-base/Makefile | 104 +++++++++++++++++++++++++++++++++++++
sysutils/py-ansible-base/distinfo | 5 ++
sysutils/py-ansible-base/pkg-descr | 10 ++++
sysutils/py-ansible-core/Makefile | 2 +
5 files changed, 122 insertions(+)
diff --git a/sysutils/Makefile b/sysutils/Makefile
index de2f2cd5f37e..c86a9a11153d 100644
--- a/sysutils/Makefile
+++ b/sysutils/Makefile
@@ -993,6 +993,7 @@
SUBDIR += pwol
SUBDIR += pwsafe
SUBDIR += pxattr
+ SUBDIR += py-ansible-base
SUBDIR += py-ansible-core
SUBDIR += py-ansible-lint
SUBDIR += py-ansible-runner
diff --git a/sysutils/py-ansible-base/Makefile b/sysutils/py-ansible-base/Makefile
new file mode 100644
index 000000000000..f97c1bde53c6
--- /dev/null
+++ b/sysutils/py-ansible-base/Makefile
@@ -0,0 +1,104 @@
+PORTNAME= ansible-base
+DISTVERSION= 2.10.9
+CATEGORIES= sysutils python
+MASTER_SITES= CHEESESHOP
+PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX}
+PATCH_SITES= https://github.com/ansible/ansible/commit/
+PATCHFILES= 6459fbb7bcf792aac9208d7851bf1edeb0495295.patch:-p1
+
+MAINTAINER= 0mp at FreeBSD.org
+COMMENT= Radically simple IT automation
+
+LICENSE= GPLv3+
+LICENSE_FILE= ${WRKSRC}/COPYING
+
+RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}cryptography>0:security/py-cryptography@${PY_FLAVOR} \
+ ${PYTHON_PKGNAMEPREFIX}Jinja2>0:devel/py-Jinja2@${PY_FLAVOR} \
+ ${PYTHON_PKGNAMEPREFIX}resolvelib>0:devel/py-resolvelib@${PY_FLAVOR} \
+ ${PYTHON_PKGNAMEPREFIX}yaml>0:devel/py-yaml@${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}packaging>=0:devel/py-packaging@${PY_FLAVOR} \
+ ${PYTHON_PKGNAMEPREFIX}passlib>0:security/py-passlib@${PY_FLAVOR} \
+ ${PYTHON_PKGNAMEPREFIX}pycrypto>=0:security/py-pycrypto@${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}
+
+USES= cpe gmake python:3.6+ shebangfix
+CPE_VENDOR= ansibleworks
+USE_PYTHON= autoplist concurrent distutils
+
+SHEBANG_REGEX= [.]/test/.*[.]py
+
+TEST_ARGS= VERSION=${DISTVERSION} \
+ PYTHON=${PYTHON_CMD} \
+ DATE=
+TEST_ENV= PYTHON_VERSION=${PYTHON_VER} \
+ TEST_FLAGS=-vv
+TEST_TARGET= tests
+
+CONFLICTS= py*-ansible-core
+
+NO_ARCH= yes
+
+PLIST_FILES= share/man/man1/ansible-config.1.gz \
+ share/man/man1/ansible-console.1.gz \
+ share/man/man1/ansible-doc.1.gz \
+ share/man/man1/ansible-galaxy.1.gz \
+ share/man/man1/ansible-inventory.1.gz \
+ share/man/man1/ansible-playbook.1.gz \
+ share/man/man1/ansible-pull.1.gz \
+ share/man/man1/ansible-vault.1.gz \
+ share/man/man1/ansible.1.gz
+PORTEXAMPLES= ansible.cfg hosts
+
+OPTIONS_DEFINE= DOCS EXAMPLES
+
+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-install:
+ @${MKDIR} ${STAGEDIR}${MAN1PREFIX}/man/man1
+ ${INSTALL_MAN} ${WRKSRC}/docs/man/man1/*.1 \
+ ${STAGEDIR}${MAN1PREFIX}/share/man/man1
+
+post-install-EXAMPLES-on:
+ @${MKDIR} ${STAGEDIR}${EXAMPLESDIR}
+ ${INSTALL_DATA} ${WRKSRC}/examples/ansible.cfg ${STAGEDIR}${EXAMPLESDIR}
+ ${INSTALL_DATA} ${WRKSRC}/examples/hosts ${STAGEDIR}${EXAMPLESDIR}
+
+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
+# Disable some tests:
+# - Skip the SELinux tests, it's not present on FreeBSD.
+ ${RM} ${WRKSRC}/test/units/module_utils/basic/test_selinux.py
+# - Failure detecting that emojis are of width 2 instead of 1.
+ ${RM} ${WRKSRC}/test/units/utils/test_display.py
+
+.include <bsd.port.mk>
+
+# Make sure that we override the unique ETCDIR name set
+# by the implicit USES=uniquefiles.
+ETCDIR= ${PREFIX}/etc/ansible
diff --git a/sysutils/py-ansible-base/distinfo b/sysutils/py-ansible-base/distinfo
new file mode 100644
index 000000000000..2f0f8d3991bb
--- /dev/null
+++ b/sysutils/py-ansible-base/distinfo
@@ -0,0 +1,5 @@
+TIMESTAMP = 1620831323
+SHA256 (ansible-base-2.10.9.tar.gz) = 04635d3e08fc29358c76b8e7f1e9db0ce443fb09ce30b2acc6cacaad165f2151
+SIZE (ansible-base-2.10.9.tar.gz) = 6039597
+SHA256 (6459fbb7bcf792aac9208d7851bf1edeb0495295.patch) = cf810efb262b3e50bf64de2d196449d3cfcbaa7a97d60a7d258a1cfbece85eae
+SIZE (6459fbb7bcf792aac9208d7851bf1edeb0495295.patch) = 1918
diff --git a/sysutils/py-ansible-base/pkg-descr b/sysutils/py-ansible-base/pkg-descr
new file mode 100644
index 000000000000..27538581209b
--- /dev/null
+++ b/sysutils/py-ansible-base/pkg-descr
@@ -0,0 +1,10 @@
+Ansible is a radically simple configuration-management, deployment,
+task-execution, and multinode orchestration framework.
+
+ansible-base contains the core engine, modules and plugins. It does not
+contain community and partner supported Ansible Collections of modules and
+plugins. For future versions of Ansible, ansible-base is going to be
+superseded by the ansible-core Python package, available in the FreeBSD
+ports as sysutils/py-ansible-core.
+
+WWW: https://www.ansible.com/
diff --git a/sysutils/py-ansible-core/Makefile b/sysutils/py-ansible-core/Makefile
index 12b893cbbb97..0014797c4ce3 100644
--- a/sysutils/py-ansible-core/Makefile
+++ b/sysutils/py-ansible-core/Makefile
@@ -38,6 +38,8 @@ TEST_ARGS= VERSION=${DISTVERSION} \
TEST_ENV= PYTHON_VERSION=${PYTHON_VER}
TEST_TARGET= tests
+CONFLICTS= py*-ansible-base
+
NO_ARCH= yes
PLIST_FILES= share/man/man1/ansible-config.1.gz \
More information about the dev-commits-ports-all
mailing list