aboutsummaryrefslogtreecommitdiffstats
path: root/sysutils
diff options
context:
space:
mode:
authorseanc <seanc@FreeBSD.org>2018-05-12 04:30:18 +0800
committerseanc <seanc@FreeBSD.org>2018-05-12 04:30:18 +0800
commitff3eba8c713d67d555580e7fa5a1d4781a39d56a (patch)
treeb862bbde15c7b33643ef375496d19ba22e11289c /sysutils
parentf632b301fd9b164c1f9123c209dc69fc4eba4771 (diff)
downloadfreebsd-ports-gnome-ff3eba8c713d67d555580e7fa5a1d4781a39d56a.tar.gz
freebsd-ports-gnome-ff3eba8c713d67d555580e7fa5a1d4781a39d56a.tar.zst
freebsd-ports-gnome-ff3eba8c713d67d555580e7fa5a1d4781a39d56a.zip
Add a new port: sysutils/sockaddr
Sockaddr is a command-line utility that makes it easy to query network address information from the local server. With sockaddr it is possible to create a list of the RFC 1918 addresses on a server, obtain the default gateway, or public IP addresses and use this information in other shell scripts. See the website for additional templating and IP math functions. Reviewed by: mat, swills Approved by: swills (mentor) Differential Revision: https://reviews.freebsd.org/D14570
Diffstat (limited to 'sysutils')
-rw-r--r--sysutils/Makefile1
-rw-r--r--sysutils/sockaddr/Makefile36
-rw-r--r--sysutils/sockaddr/distinfo3
-rw-r--r--sysutils/sockaddr/pkg-descr8
4 files changed, 48 insertions, 0 deletions
diff --git a/sysutils/Makefile b/sysutils/Makefile
index eeea9e1b1fb1..a3da7bb4fb71 100644
--- a/sysutils/Makefile
+++ b/sysutils/Makefile
@@ -1184,6 +1184,7 @@
SUBDIR += snmp_exporter
SUBDIR += snooze
SUBDIR += snowlog
+ SUBDIR += sockaddr
SUBDIR += socket
SUBDIR += socklog
SUBDIR += solaar
diff --git a/sysutils/sockaddr/Makefile b/sysutils/sockaddr/Makefile
new file mode 100644
index 000000000000..af3ec71b8b34
--- /dev/null
+++ b/sysutils/sockaddr/Makefile
@@ -0,0 +1,36 @@
+# $FreeBSD$
+
+PORTNAME= sockaddr
+DISTVERSION= g20180320
+CATEGORIES= sysutils
+
+MAINTAINER= seanc@FreeBSD.org
+COMMENT= Command line utility for querying IP information
+
+LICENSE= MPL20
+LICENSE_FILE= ${WRKSRC}/LICENSE
+
+BUILD_DEPENDS= go:lang/go
+
+USE_GITHUB= yes
+GH_SUBDIR= src/github.com/hashicorp/go-sockaddr
+GH_ACCOUNT= hashicorp
+GH_PROJECT= go-sockaddr
+GH_TAGNAME= 7165ee1
+
+PLIST_FILES= bin/sockaddr
+
+post-extract:
+ @${CP} -rp ${WRKSRC}/cmd/${PORTNAME}/vendor/* ${WRKSRC}/src/
+
+do-build:
+ @cd ${WRKSRC}/src/github.com/${GH_ACCOUNT}/${GH_PROJECT}/cmd/${PORTNAME}/ && \
+ ${SETENV} ${MAKE_ENV} CGO_ENABLED=0 GOPATH=${WRKSRC} \
+ ${LOCALBASE}/bin/go build -ldflags "-X main.version=${DISTVERSIONPREFIX}${PORTVERSION} -w -s" \
+ -o ${PORTNAME}
+
+do-install:
+ ${INSTALL_PROGRAM} ${WRKSRC}/src/github.com/hashicorp/go-sockaddr/cmd/${PORTNAME}/${PORTNAME} \
+ ${STAGEDIR}${PREFIX}/bin/${PORTNAME}
+
+.include <bsd.port.mk>
diff --git a/sysutils/sockaddr/distinfo b/sysutils/sockaddr/distinfo
new file mode 100644
index 000000000000..d571f5caf77f
--- /dev/null
+++ b/sysutils/sockaddr/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1525900279
+SHA256 (hashicorp-go-sockaddr-g20180320-7165ee1_GH0.tar.gz) = 51a6c981da7aa9d9dd7ca9044115804cc40b6b1d926610c12ba2bf549a6daf2d
+SIZE (hashicorp-go-sockaddr-g20180320-7165ee1_GH0.tar.gz) = 661149
diff --git a/sysutils/sockaddr/pkg-descr b/sysutils/sockaddr/pkg-descr
new file mode 100644
index 000000000000..dba4cf139a42
--- /dev/null
+++ b/sysutils/sockaddr/pkg-descr
@@ -0,0 +1,8 @@
+Sockaddr is a command-line utility that makes it easy to query network
+address information from the local server. With sockaddr it is possible
+to create a list of the RFC 1918 addresses on a server, obtain the
+default gateway, or public IP addresses and use this information in other
+shell scripts. See the website for additional templating and IP math
+functions.
+
+WWW: https://github.com/hashicorp/go-sockaddr/tree/master/cmd/sockaddr