aboutsummaryrefslogtreecommitdiff
path: root/sysutils/amazon-ssm-agent
diff options
context:
space:
mode:
authorColin Percival <cperciva@FreeBSD.org>2017-05-30 07:34:06 +0000
committerColin Percival <cperciva@FreeBSD.org>2017-05-30 07:34:06 +0000
commita078c4603beb43f573b70a45cba8932b7f444350 (patch)
tree068823d5c24048f62cd984208c805e3d341b7681 /sysutils/amazon-ssm-agent
parent8b1d897ff66b7ec744342c2492ce62734df8727c (diff)
downloadports-a078c4603beb43f573b70a45cba8932b7f444350.tar.gz
ports-a078c4603beb43f573b70a45cba8932b7f444350.zip
Build amazon-ssm-agent directly from the port Makefile rather than recursing
into the makefile distributed with the source code. In particular, this should fix the build on i386, where it is currently broken due to amd64 being hard-coded as the build architecture. Numerous other cleanups to the build. [1] Change LICENSE and remove subsidiary variables, as Amazon has relicensed this from the "Amazon" license to Apache 2.0. Submitted by: swills [1]
Notes
Notes: svn path=/head/; revision=442051
Diffstat (limited to 'sysutils/amazon-ssm-agent')
-rw-r--r--sysutils/amazon-ssm-agent/Makefile30
-rw-r--r--sysutils/amazon-ssm-agent/files/patch-makefile28
2 files changed, 15 insertions, 43 deletions
diff --git a/sysutils/amazon-ssm-agent/Makefile b/sysutils/amazon-ssm-agent/Makefile
index 2cb99fee5ec9..7d35229b9d9d 100644
--- a/sysutils/amazon-ssm-agent/Makefile
+++ b/sysutils/amazon-ssm-agent/Makefile
@@ -2,29 +2,21 @@
PORTNAME= amazon-ssm-agent
PORTVERSION= 2.0.790.0
+PORTREVISION= 1
CATEGORIES= sysutils
MAINTAINER= cperciva@FreeBSD.org
COMMENT= Amazon Simple Systems Manager Agent
-LICENSE= Amazon
-LICENSE_NAME= Amazon Software License
+LICENSE= APACHE20
LICENSE_FILE= ${WRKSRC}/LICENSE
-LICENSE_PERMS= dist-mirror dist-sell pkg-mirror pkg-sell auto-accept
-BUILD_DEPENDS= bash:shells/bash \
- go:lang/go
+BUILD_DEPENDS= go:lang/go
RUN_DEPENDS= ${LOCALBASE}/share/certs/ca-root-nss.crt:security/ca_root_nss
USE_GITHUB= yes
GH_ACCOUNT= aws
-
-WRKSRC= ${WRKDIR}/src/github.com/aws/amazon-ssm-agent
-USES= gmake
-MAKEFILE= makefile
-ALL_TARGET= build-freebsd
-INSTALL_TARGET= install-freebsd
-MAKE_ARGS= SKIP_CHECKSTYLE="YES" DESTDIR=${STAGEDIR}${PREFIX}
+GH_SUBDIR= src/github.com/aws/amazon-ssm-agent
PLIST_FILES= etc/amazon/ssm/amazon-ssm-agent.json.template \
etc/amazon/ssm/seelog_unix.xml.template \
@@ -32,8 +24,16 @@ PLIST_FILES= etc/amazon/ssm/amazon-ssm-agent.json.template \
USE_RC_SUBR= amazon-ssm-agent
-post-extract:
- ${MKDIR} ${WRKDIR}/src/github.com/aws
- ${MV} ${WRKDIR}/${PORTNAME}-${PORTVERSION:S/v//} ${WRKSRC}
+do-build:
+ @cd ${WRKSRC}; \
+ ${SETENV} GOPATH=${WRKSRC}:${WRKSRC}/vendor CGO_ENABLED=0 \
+ go build -ldflags "-s -w" -o amazon-ssm-agent \
+ agent/agent.go agent/agent_unix.go agent/agent_parser.go
+
+do-install:
+ ${INSTALL_PROGRAM} ${WRKSRC}/amazon-ssm-agent ${STAGEDIR}${PREFIX}/sbin
+ ${MKDIR} ${STAGEDIR}${PREFIX}/etc/amazon/ssm
+ ${INSTALL_DATA} ${WRKSRC}/amazon-ssm-agent.json.template ${STAGEDIR}${PREFIX}/etc/amazon/ssm
+ ${INSTALL_DATA} ${WRKSRC}/seelog_unix.xml ${STAGEDIR}${PREFIX}/etc/amazon/ssm/seelog_unix.xml.template
.include <bsd.port.mk>
diff --git a/sysutils/amazon-ssm-agent/files/patch-makefile b/sysutils/amazon-ssm-agent/files/patch-makefile
deleted file mode 100644
index cff393a4d99a..000000000000
--- a/sysutils/amazon-ssm-agent/files/patch-makefile
+++ /dev/null
@@ -1,28 +0,0 @@
---- makefile.orig 2017-05-22 17:12:08.000000000 +0000
-+++ makefile 2017-05-28 06:54:07.291237000 +0000
-@@ -35,8 +35,10 @@
- export BRAZIL_BUILD
-
- checkstyle::
-+ifndef SKIP_CHECKSTYLE
- # Run checkstyle script
- $(BGO_SPACE)/Tools/src/checkstyle.sh
-+endif
-
- coverage:: build-linux
- $(BGO_SPACE)/Tools/src/coverage.sh github.com/aws/amazon-ssm-agent/agent/...
-@@ -121,6 +123,14 @@
- GOOS=freebsd GOARCH=amd64 $(GO_BUILD) -ldflags "-s -w" -o $(BGO_SPACE)/bin/freebsd_amd64/ssm-cli -v \
- $(BGO_SPACE)/agent/cli-main/cli-main.go
-
-+.PHONY: install-freebsd
-+install-freebsd:
-+ @echo "Install for freebsd agent"
-+ install -m 555 $(BGO_SPACE)/bin/freebsd_amd64/amazon-ssm-agent $(DESTDIR)$(PREFIX)/sbin/
-+ mkdir -p $(DESTDIR)$(PREFIX)/etc/amazon/ssm
-+ install -m 644 $(BGO_SPACE)/bin/amazon-ssm-agent.json.template $(DESTDIR)$(PREFIX)/etc/amazon/ssm
-+ install -m 644 $(BGO_SPACE)/bin/seelog_unix.xml $(DESTDIR)$(PREFIX)/etc/amazon/ssm/seelog_unix.xml.template
-+
- .PHONY: build-darwin
- build-darwin: checkstyle copy-src pre-build
- @echo "Rebuild for darwin agent"