From owner-svn-ports-head@freebsd.org Mon Jan 28 09:16:25 2019 Return-Path: Delivered-To: svn-ports-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B0E8D14ACADC; Mon, 28 Jan 2019 09:16:25 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 527F681915; Mon, 28 Jan 2019 09:16:25 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 419081D7AA; Mon, 28 Jan 2019 09:16:25 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0S9GPm1037175; Mon, 28 Jan 2019 09:16:25 GMT (envelope-from 0mp@FreeBSD.org) Received: (from 0mp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0S9GOZo037172; Mon, 28 Jan 2019 09:16:24 GMT (envelope-from 0mp@FreeBSD.org) Message-Id: <201901280916.x0S9GOZo037172@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: 0mp set sender to 0mp@FreeBSD.org using -f From: Mateusz Piotrowski <0mp@FreeBSD.org> Date: Mon, 28 Jan 2019 09:16:24 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r491463 - head/sysutils/node_exporter X-SVN-Group: ports-head X-SVN-Commit-Author: 0mp X-SVN-Commit-Paths: head/sysutils/node_exporter X-SVN-Commit-Revision: 491463 X-SVN-Commit-Repository: ports MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 527F681915 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.98)[-0.975,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-ports-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the ports tree for head List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Jan 2019 09:16:26 -0000 Author: 0mp Date: Mon Jan 28 09:16:24 2019 New Revision: 491463 URL: https://svnweb.freebsd.org/changeset/ports/491463 Log: sysutils/node_exporter: Add tests, docs and examples - Define LICENSE_FILE. - Sort variables. - Add a do-test target and prepare a testing environment. One test is skipped at the moment due to a problem with detecting procfs(5) on FreeBSD. - Install documentation and examples. - Change pkg-descr to better match upstream's README. PR: 234791 Reviewed by: mat Approved by: mat (mentor), maintainer timeout Sponsored by: BALLY WULFF Games & Entertainment GmbH Differential Revision: https://reviews.freebsd.org/D18792 Added: head/sysutils/node_exporter/pkg-plist (contents, props changed) Modified: head/sysutils/node_exporter/Makefile head/sysutils/node_exporter/pkg-descr Modified: head/sysutils/node_exporter/Makefile ============================================================================== --- head/sysutils/node_exporter/Makefile Mon Jan 28 09:00:35 2019 (r491462) +++ head/sysutils/node_exporter/Makefile Mon Jan 28 09:16:24 2019 (r491463) @@ -4,24 +4,34 @@ PORTNAME= node_exporter PORTVERSION= 0.17.0 DISTVERSIONPREFIX=v +PORTREVISION= 1 CATEGORIES= sysutils MAINTAINER= ports@ecadlabs.com COMMENT= Prometheus exporter for machine metrics LICENSE= APACHE20 +LICENSE_FILE= ${WRKSRC}/LICENSE -USES= go -USE_GITHUB= yes +TEST_DEPENDS= promtool:net-mgmt/prometheus2 \ + bash:shells/bash \ + gsed:textproc/gsed +USES= gmake go shebangfix +USE_GITHUB= yes GH_ACCOUNT= prometheus +USE_RC_SUBR= node_exporter +# The ttar script is used to run the tests. +SHEBANG_FILES= ttar + GO_PKGNAME= github.com/${GH_ACCOUNT}/${PORTNAME} GO_TARGET= github.com/${GH_ACCOUNT}/${PORTNAME} -PLIST_FILES= bin/node_exporter +# A "checkrules" target is being added in >0.17.0. +TEST_TARGET= test -USE_RC_SUBR= node_exporter +TEST_ENV= PROMTOOL=${LOCALBASE}/bin/promtool BUILD_USER?= ${USER} LD_FLAG_X_PREFIX= -X ${GO_PKGNAME}/vendor/${GO_PKGNAME:H}/common/version @@ -32,7 +42,38 @@ LD_FLAG_STRING= -s \ ${LD_FLAG_X_PREFIX}.BuildUser=${BUILD_USER} GO_BUILDFLAGS= -v -ldflags "${LD_FLAG_STRING}" +OPTIONS_DEFINE= DOCS EXAMPLES + do-install: ${INSTALL_PROGRAM} ${WRKDIR}/bin/node_exporter ${STAGEDIR}${PREFIX}/bin + +post-install-DOCS-on: + ${MKDIR} ${STAGEDIR}${DOCSDIR} + cd ${WRKSRC}/docs && \ + ${COPYTREE_SHARE} . ${STAGEDIR}${DOCSDIR} + ${INSTALL_DATA} ${WRKSRC}/README.md ${STAGEDIR}${DOCSDIR} + +post-install-EXAMPLES-on: + ${MKDIR} ${STAGEDIR}${EXAMPLESDIR}/text_collector_examples + cd ${WRKSRC} && ${COPYTREE_SHARE} ./text_collector_examples ${STAGEDIR}${EXAMPLESDIR} + +# TestFileDescriptorLeak is being skipped at the moment because procfs(5) is +# not properly detected. +pre-test: + # Prevent Go from attempting to use Git to redownload its dependencies. + # They are already present in ${WRKSRC}/vendor. + ${RM} ${WRKSRC}/go.mod + + ${REINPLACE_CMD} -e 's|sed|${LOCALBASE}/bin/gsed|g' ${WRKSRC}/ttar + + ${RM} -r ${WRKDIR}/src + ${LN} -sf ${WRKSRC}/vendor ${WRKDIR}/src + ${MKDIR} ${WRKSRC}/vendor/${GO_PKGNAME} + ${LN} -sf ${WRKSRC}/collector ${WRKSRC}/vendor/${GO_PKGNAME}/collector + + # GOPATH has to have exactly one element in order to have the test + # suite detect the node_exporter binary. "-v" is added here for us to + # see skipped tests. + ${REINPLACE_CMD} -E 's|(\$$\(GO\) test)|env GOPATH="${WRKDIR}" \1 -v|g' ${WRKSRC}/Makefile .include Modified: head/sysutils/node_exporter/pkg-descr ============================================================================== --- head/sysutils/node_exporter/pkg-descr Mon Jan 28 09:00:35 2019 (r491462) +++ head/sysutils/node_exporter/pkg-descr Mon Jan 28 09:16:24 2019 (r491463) @@ -1,4 +1,4 @@ -node_exporter is a prometheus exporter for machine metrics, written in Go -with pluggable metric collectors. +Node exporter is a Prometheus exporter for hardware and OS metrics, written in +Go with pluggable metric collectors. WWW: https://github.com/prometheus/node_exporter Added: head/sysutils/node_exporter/pkg-plist ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sysutils/node_exporter/pkg-plist Mon Jan 28 09:16:24 2019 (r491463) @@ -0,0 +1,17 @@ +bin/node_exporter +%%PORTDOCS%%%%DOCSDIR%%/README.md +%%PORTDOCS%%%%DOCSDIR%%/TIME.md +%%PORTDOCS%%%%DOCSDIR%%/V0_16_UPGRADE_GUIDE.md +%%PORTDOCS%%%%DOCSDIR%%/example-16-compatibility-rules-new-to-old.yml +%%PORTDOCS%%%%DOCSDIR%%/example-16-compatibility-rules.yml +%%PORTDOCS%%%%DOCSDIR%%/example-17-compatibility-rules-new-to-old.yml +%%PORTDOCS%%%%DOCSDIR%%/example-17-compatibility-rules.yml +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/text_collector_examples/README.md +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/text_collector_examples/apt.sh +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/text_collector_examples/deleted_libraries.py +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/text_collector_examples/directory-size.sh +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/text_collector_examples/ipmitool +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/text_collector_examples/md_info.sh +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/text_collector_examples/ntpd_metrics.py +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/text_collector_examples/smartmon.sh +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/text_collector_examples/storcli.py