diff --git sysutils/amazon-ssm-plugin/Makefile sysutils/amazon-ssm-plugin/Makefile new file mode 100644 index 0000000..82f770e --- /dev/null +++ sysutils/amazon-ssm-plugin/Makefile @@ -0,0 +1,54 @@ +PORTNAME= amazon-ssm-plugin +PORTVERSION= 1.2.279.0 +CATEGORIES= sysutils + +MAINTAINER= nork@ninth-nine.com +COMMENT= Amazon AWS Manages shell experience using SSM APIs + +LICENSE= APACHE20 +LICENSE_FILE= ${WRKSRC}/LICENSE + +RUN_DEPENDS= aws:devel/awscli + +USES= go +USE_GITHUB= yes +GH_ACCOUNT= aws +GH_PROJECT= session-manager-plugin +GH_SUBDIR= src/SSMCLI + +GO_BUILDFLAGS= -ldflags "-s -w" +GO_TARGET= src/sessionmanagerplugin-main/main.go:${PREFIX}/bin/session-manager-plugin \ + src/ssmcli-main/main.go:${PREFIX}/bin/ssmcli + +PORTDOCS= NOTICE README.md RELEASENOTES.md THIRD-PARTY VERSION +PLIST_FILES= bin/ssmcli \ + bin/session-manager-plugin \ + ${ETCDIR}/SSMCLI/seelog.xml.template \ + ${ETCDIR}/sessionmanagerplugin/seelog.xml.template + +LOGDIR= ${DESTDIR}/var/log/${PORTNAME} + +OPTIONS_DEFINE= DOCS + +post-extract: + ${MKDIR} ${GO_WRKSRC}/src ${GO_WRKSRC}/vendor + ${MKDIR} ${WRKSRC}/vendor/src/github.com/aws/SSMCLI + ${LN} -s ${WRKSRC}/src/*-main ${GO_WRKSRC}/src/ + ${LN} -s ${WRKSRC}/vendor/src/* ${GO_WRKSRC}/vendor/ + ${LN} -s ${WRKSRC}/src ${GO_WRKSRC}/vendor/github.com/aws/SSMCLI/ + +post-patch: + ${REINPLACE_CMD} -e 's|%%ETCDIR%%|${ETCDIR}|g; s|%%LOGDIR%%|${LOGDIR}|g' ${WRKSRC}/seelog_unix.xml + ${REINPLACE_CMD} -e 's|%%ETCDIR%%|${ETCDIR}|g; s|%%LOGDIR%%|${LOGDIR}|g' ${WRKSRC}/src/log/log_unix.go + ${REINPLACE_CMD} -e 's|%%PORTVERSION%%|${PORTVERSION}|g' ${WRKSRC}/src/version/version.go + +post-install: + ${MKDIR} ${STAGEDIR}${ETCDIR}/SSMCLI ${STAGEDIR}${ETCDIR}/sessionmanagerplugin + ${INSTALL_DATA} ${WRKSRC}/seelog_unix.xml ${STAGEDIR}${ETCDIR}/SSMCLI/seelog.xml.template + ${INSTALL_DATA} ${WRKSRC}/seelog_unix.xml ${STAGEDIR}${ETCDIR}/sessionmanagerplugin/seelog.xml.template + +post-install-DOCS-on: + @${MKDIR} ${STAGEDIR}${DOCSDIR} + cd ${WRKSRC} && ${INSTALL_DATA} ${PORTDOCS} ${STAGEDIR}${DOCSDIR} + +.include diff --git sysutils/amazon-ssm-plugin/distinfo sysutils/amazon-ssm-plugin/distinfo new file mode 100644 index 0000000..a169e4b --- /dev/null +++ sysutils/amazon-ssm-plugin/distinfo @@ -0,0 +1,3 @@ +TIMESTAMP = 1635565772 +SHA256 (aws-session-manager-plugin-1.2.279.0_GH0.tar.gz) = 50ea46e00063d21cfa87ecfc95f03055acb86587ac006bad165541290b8da875 +SIZE (aws-session-manager-plugin-1.2.279.0_GH0.tar.gz) = 21655860 diff --git sysutils/amazon-ssm-plugin/files/patch-seelog__unix.xml sysutils/amazon-ssm-plugin/files/patch-seelog__unix.xml new file mode 100644 index 0000000..4571935 --- /dev/null +++ sysutils/amazon-ssm-plugin/files/patch-seelog__unix.xml @@ -0,0 +1,14 @@ +--- seelog_unix.xml.orig 2021-08-17 20:31:44 UTC ++++ seelog_unix.xml +@@ -6,9 +6,9 @@ + + + +- ++ + +- ++ + + + diff --git sysutils/amazon-ssm-plugin/files/patch-src_log_log__unix.go sysutils/amazon-ssm-plugin/files/patch-src_log_log__unix.go new file mode 100644 index 0000000..1cdd1b4 --- /dev/null +++ sysutils/amazon-ssm-plugin/files/patch-src_log_log__unix.go @@ -0,0 +1,22 @@ +--- src/log/log_unix.go.orig 2021-08-17 20:31:44 UTC ++++ src/log/log_unix.go +@@ -23,8 +23,8 @@ import ( + ) + + const ( +- LogsDirectory = "logs" +- DefaultInstallLocationPrefix = "/usr/local" ++ DefaultLogsDirectory = "%%LOGDIR%%" ++ DefaultInstallLocationPrefix = "%%ETCDIR%%" + ) + + func getApplicationName(clientName string) string { +@@ -45,7 +45,7 @@ func getLogConfigBytes(clientName string) (logConfigBy + + applicationName := getApplicationName(clientName) + DefaultSeelogConfigFilePath = filepath.Join(DefaultInstallLocationPrefix, applicationName, SeelogConfigFileName) +- DefaultLogDir = filepath.Join(DefaultInstallLocationPrefix, applicationName, LogsDirectory) ++ DefaultLogDir = filepath.Join(DefaultLogsDirectory, applicationName) + ApplicationLogFile = fmt.Sprintf("%s%s", clientName, LogFileExtension) + ErrorLogFile = fmt.Sprintf("%s%s", ErrorLogFileSuffix, LogFileExtension) + if logConfigBytes, err = ioutil.ReadFile(DefaultSeelogConfigFilePath); err != nil { diff --git sysutils/amazon-ssm-plugin/files/patch-src_version_version.go sysutils/amazon-ssm-plugin/files/patch-src_version_version.go new file mode 100644 index 0000000..8b45d2e --- /dev/null +++ sysutils/amazon-ssm-plugin/files/patch-src_version_version.go @@ -0,0 +1,8 @@ +--- src/version/version.go.orig 2021-08-17 20:31:44 UTC ++++ src/version/version.go +@@ -9,4 +9,4 @@ + package version + + // Version is the version of the CLI +-const Version = "1.2.0.0" ++const Version = "%%PORTVERSION%%" diff --git sysutils/amazon-ssm-plugin/pkg-descr sysutils/amazon-ssm-plugin/pkg-descr new file mode 100644 index 0000000..d3f02bf --- /dev/null +++ sysutils/amazon-ssm-plugin/pkg-descr @@ -0,0 +1,8 @@ +This package provides Amazon SSM SessionManager and CLI for managing +shell experience using SSM APIs. + +HOW TO USE: + aws ssm start-session --target "your instance-id" + +WWW: https://github.com/aws/session-manager-plugin/ +WWW: https://docs.aws.amazon.com/systems-manager/latest/userguide/session-manager-working-with-install-plugin.html