pkgsrc-WIP-changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

terraform: Add initial PoC provider.mk



Module Name:	pkgsrc-wip
Committed By:	Leonardo Taccari <leot%NetBSD.org@localhost>
Pushed By:	leot
Date:		Sun Mar 28 00:20:37 2021 +0100
Changeset:	c8411940e40a5029594e961ee2b79e4dc6581d57

Added Files:
	terraform/provider.mk

Log Message:
terraform: Add initial PoC provider.mk

Intended to be used by all Terraform providers (still WIP-ish, needs to be
properly documented and then discussed and a symbolic link to bin/ should be
probably installed as well because Terraform 0.12 needs it (and Terraform 0.13
and 0.14 needs to be patched in order to honor the directory in pkgsrc ${PREFIX}
too!)).

XXX: The note about `do-install:' is probably a bit error-prone... is there any
XXX: better way to always overwrite the go-{module,package}.mk one when
XXX: terraform/provider.mk is included?

To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=c8411940e40a5029594e961ee2b79e4dc6581d57

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

diffstat:
 terraform/provider.mk | 44 ++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 44 insertions(+)

diffs:
diff --git a/terraform/provider.mk b/terraform/provider.mk
new file mode 100644
index 0000000000..e2298ef418
--- /dev/null
+++ b/terraform/provider.mk
@@ -0,0 +1,44 @@
+# $NetBSD$
+#
+# This file implements common logic for Terraform providers in pkgsrc.
+#
+# Please note that if the provided `do-install:' should be used this file
+# should be included before including lang/go/go-package.mk or
+# lang/go/go-module.mk.
+#
+# === Package-settable variables ===
+#
+# TERRAFORM_PROVIDER_REGISTRY (optional)
+#
+# TERRAFORM_PROVIDER_BIN
+#
+# TERRAFORM_PROVIDER_NAME
+#
+# TERRAFORM_PROVIDER_VERSION
+#
+# TERRAFORM_PROVIDER_DIR (optional)
+#
+# Keywords: terraform
+#
+
+.include "../../wip/terraform/version.mk"
+
+DEPENDS+=	${TERRAFORM_PACKAGE_DEP}
+
+TERRAFORM_PROVIDER_REGISTRY?=	registry.terraform.io
+TERRAFORM_PROVIDER_VERSION?=	${PKGVERSION_NOREV}
+TERRAFORM_PROVIDER_DIR?=	share/terraform/plugins/${TERRFORM_PROVIDER_REGISTRY}/${TERRAFORM_PROVIDER_NAME}/${TERRAFORM_PROVIDER_VERSION}/${GO_PLATFORM}
+
+PLIST_SUBST+=		TERRAFORM_PROVIDER_NAME=${TERRAFORM_PROVIDER_NAME}
+PLIST_SUBST+=		TERRAFORM_PROVIDER_VERSION=${TERRAFORM_PROVIDER_VERSION}
+
+PRINT_PLIST_AWK+=	{ sub("${TERRAFORM_PROVIDER_NAME}", "$${TERRAFORM_PROVIDER_NAME}") }
+PRINT_PLIST_AWK+=	{ sub("${TERRAFORM_PROVIDER_VERSION}", "$${TERRAFORM_PROVIDER_VERSION}") }
+
+INSTALLATION_DIRS?=	${TERRAFORM_PROVIDER_DIR}
+
+.if !target(do-install)
+do-install:
+	${INSTALL_PROGRAM} ${WRKDIR}/.gopath/bin/${TERRAFORM_PROVIDER_BIN} \
+	    ${DESTDIR}${PREFIX}/${TERRAFORM_PROVIDER_DIR}
+.endif


Home | Main Index | Thread Index | Old Index