diff --git a/net/cloud-init/Makefile b/net/cloud-init/Makefile new file mode 100644 index 0000000..578b99e --- /dev/null +++ b/net/cloud-init/Makefile @@ -0,0 +1,65 @@ +PORTNAME= cloud-init +DISTVERSION= 24.1.4 +PORTREVISION= 3 +CATEGORIES= net python +PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX} + +MAINTAINER= andrey@bsdnir.info +COMMENT= Init scripts for use on cloud images +WWW= https://cloud-init.io/ + +LICENSE= APACHE20 GPLv3 +LICENSE_COMB= dual +LICENSE_FILE_APACHE20= ${WRKSRC}/LICENSE-Apache2.0 +LICENSE_FILE_GPLv3= ${WRKSRC}/LICENSE-GPLv3 + +RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}configobj>0:devel/py-configobj@${PY_FLAVOR} \ + ${PYTHON_PKGNAMEPREFIX}Jinja2>0:devel/py-Jinja2@${PY_FLAVOR} \ + ${PYTHON_PKGNAMEPREFIX}jsonpatch>0:devel/py-jsonpatch@${PY_FLAVOR} \ + ${PYTHON_PKGNAMEPREFIX}jsonpointer>0:devel/py-jsonpointer@${PY_FLAVOR} \ + ${PYTHON_PKGNAMEPREFIX}jsonschema>0:devel/py-jsonschema@${PY_FLAVOR} \ + ${PYTHON_PKGNAMEPREFIX}netifaces>0:net/py-netifaces@${PY_FLAVOR} \ + ${PYTHON_PKGNAMEPREFIX}oauthlib>0:security/py-oauthlib@${PY_FLAVOR} \ + ${PYTHON_PKGNAMEPREFIX}pyserial>0:comms/py-pyserial@${PY_FLAVOR} \ + ${PYTHON_PKGNAMEPREFIX}requests>0:www/py-requests@${PY_FLAVOR} \ + ${PYTHON_PKGNAMEPREFIX}pyyaml>=0:devel/py-pyyaml@${PY_FLAVOR} \ + sudo>0:security/sudo@sssd2 + +USES= python shebangfix +USE_GITHUB= yes +GH_ACCOUNT= canonical +USE_PYTHON= autoplist distutils +PYDISTUTILS_INSTALLARGS+= "--init-system=sysvinit_freebsd" + +SHEBANG_FILES= tools/hook-hotplug tools/read-dependencies tools/read-version \ + tools/validate-yaml.py + +# Conflicts +CONFLICTS_INSTALL= cloud-init-devel + +# Standard bsd.port.mk variables +ETCDIR= ${PREFIX}/etc/cloud + +.include + +.if ${OPSYS} == FreeBSD && ${OSVERSION} >= 1400000 +EXTRA_PATCHES= ${PATCHDIR}/extra-cloudinit_distros_freebsd.py +.endif + +NO_ARCH= yes + +post-patch: + ${REINPLACE_CMD} -e 's|%%PREFIX%%|${STAGEDIR}${PREFIX}|g' ${WRKSRC}/setup.py + ${REINPLACE_CMD} -e 's|%%PREFIX%%|${PREFIX}|g' ${WRKSRC}/cloudinit/settings.py + ${REINPLACE_CMD} -e 's|@@PACKAGED_VERSION@@|${DISTVERSION}${DISTVERSIONSUFFIX}|g' ${WRKSRC}/cloudinit/version.py + ${RM} ${WRKSRC}/config/cloud.cfg.d/99_freebsd.cfg.orig + +post-install: + ${MV} ${STAGEDIR}${ETCDIR}/cloud.cfg ${STAGEDIR}${ETCDIR}/cloud.cfg.sample + ${MV} ${STAGEDIR}${ETCDIR}/cloud.cfg.d/05_logging.cfg ${STAGEDIR}${ETCDIR}/cloud.cfg.d/05_logging.cfg.sample + ${MV} ${STAGEDIR}${ETCDIR}/cloud.cfg.d/99_freebsd.cfg ${STAGEDIR}${ETCDIR}/cloud.cfg.d/99_freebsd.cfg.sample + ${REINPLACE_CMD} -e 's|^.*\.cfg$$|@sample &.sample|' \ + -e 's|${ETCDIR}/clean.d|@dir ${ETCDIR}/clean.d|' \ + ${_PYTHONPKGLIST} + +.include diff --git a/net/cloud-init/distinfo b/net/cloud-init/distinfo new file mode 100644 index 0000000..c7e39f0 --- /dev/null +++ b/net/cloud-init/distinfo @@ -0,0 +1,5 @@ +TIMESTAMP = 1712351569 +SHA256 (canonical-cloud-init-24.1.4_GH0.tar.gz) = 3c70effcea02be47b6cd751a1d164583df674ff8d6e4eaa6599eb1499e3b3f28 +SIZE (canonical-cloud-init-24.1.4_GH0.tar.gz) = 1734414 +SHA256 (a6e09d9bfd3ef0770bc4d9452d978ba93dbe1245.patch) = e90e4df05691b64abf2f3a0fc02ff7c450260e53ca236583f7fc3fd315a2b114 +SIZE (a6e09d9bfd3ef0770bc4d9452d978ba93dbe1245.patch) = 18418 diff --git a/net/cloud-init/files/extra-cloudinit_distros_freebsd.py b/net/cloud-init/files/extra-cloudinit_distros_freebsd.py new file mode 100644 index 0000000..eb4d375 --- /dev/null +++ b/net/cloud-init/files/extra-cloudinit_distros_freebsd.py @@ -0,0 +1,11 @@ +--- cloudinit/distros/freebsd.py.orig 2024-10-25 15:58:28 UTC ++++ cloudinit/distros/freebsd.py +@@ -35,7 +35,7 @@ class Distro(cloudinit.distros.bsd.BSD): + pkg_cmd_update_prefix = ["pkg", "update"] + pkg_cmd_upgrade_prefix = ["pkg", "upgrade"] + prefer_fqdn = True # See rc.conf(5) in FreeBSD +- home_dir = "/usr/home" ++ home_dir = "/home" + # FreeBSD has the following dhclient lease path: + # /var/db/dhclient.leases. + dhclient_lease_directory = "/var/db" diff --git a/net/cloud-init/files/patch-cloudinit_settings.py b/net/cloud-init/files/patch-cloudinit_settings.py new file mode 100644 index 0000000..d7ca2bd --- /dev/null +++ b/net/cloud-init/files/patch-cloudinit_settings.py @@ -0,0 +1,20 @@ +--- cloudinit/settings.py.orig 2021-03-17 15:43:42 UTC ++++ cloudinit/settings.py +@@ -12,7 +12,7 @@ + CFG_ENV_NAME = "CLOUD_CFG" + + # This is expected to be a yaml formatted file +-CLOUD_CONFIG = "/etc/cloud/cloud.cfg" ++CLOUD_CONFIG = "%%PREFIX%%/etc/cloud/cloud.cfg" + + RUN_CLOUD_CONFIG = "/run/cloud-init/cloud.cfg" + +@@ -50,7 +50,7 @@ CFG_BUILTIN = { + "system_info": { + "paths": { + "cloud_dir": "/var/lib/cloud", +- "templates_dir": "/etc/cloud/templates/", ++ "templates_dir": "%%PREFIX%%/etc/cloud/templates/", + }, + "distro": "ubuntu", + "network": {"renderers": None}, diff --git a/net/cloud-init/files/patch-config_cloud.cfg.d_99__freebsd.cfg b/net/cloud-init/files/patch-config_cloud.cfg.d_99__freebsd.cfg new file mode 100644 index 0000000..54430cf --- /dev/null +++ b/net/cloud-init/files/patch-config_cloud.cfg.d_99__freebsd.cfg @@ -0,0 +1,5 @@ +--- config/cloud.cfg.d/99_freebsd.cfg.orig 2021-12-13 06:41:51 UTC ++++ config/cloud.cfg.d/99_freebsd.cfg +@@ -0,0 +1,2 @@ ++no_ssh_fingerprints: true ++disable_network_activation: true diff --git a/net/cloud-init/files/patch-setup.py b/net/cloud-init/files/patch-setup.py new file mode 100644 index 0000000..c94715d --- /dev/null +++ b/net/cloud-init/files/patch-setup.py @@ -0,0 +1,11 @@ +--- setup.py.orig 2021-03-17 15:40:30 UTC ++++ setup.py +@@ -153,7 +153,7 @@ INITSYS_TYPES = sorted([f.partition(".")[0] for f in I + # Install everything in the right location and take care of Linux (default) and + # FreeBSD systems. + USR = "usr" +-ETC = "etc" ++ETC = "%%PREFIX%%/etc" + USR_LIB_EXEC = "usr/lib" + LIB = "lib" + if os.uname()[0] in ["FreeBSD", "DragonFly"]: diff --git a/net/cloud-init/pkg-descr b/net/cloud-init/pkg-descr new file mode 100644 index 0000000..3f4d22b --- /dev/null +++ b/net/cloud-init/pkg-descr @@ -0,0 +1,4 @@ +Cloud-init is the industry standard multi-distribution method for cross-platform +cloud instance initialization. It is supported across all major public cloud +providers, provisioning systems for private cloud infrastructure, and bare-metal +installations. diff --git a/net/cloud-init/pkg-message b/net/cloud-init/pkg-message new file mode 100644 index 0000000..f82dd34 --- /dev/null +++ b/net/cloud-init/pkg-message @@ -0,0 +1,11 @@ +[ +{ type: install + message: <