View | Details | Raw Unified | Return to bug 268142 | Differences between
and this patch

Collapse All | Expand All

(-)sysutils/amazon-ssm-plugin/Makefile (+56 lines)
Added Link Here
1
PORTNAME=	amazon-ssm-plugin
2
DISTVERSION=	1.2.398.0
3
CATEGORIES=	sysutils
4
5
MAINTAINER=	nork@FreeBSD.org
6
COMMENT=	Amazon AWS Manages shell experience using SSM APIs
7
WWW=		https://github.com/aws/session-manager-plugin/
8
9
LICENSE=	APACHE20
10
LICENSE_FILE=	${WRKSRC}/LICENSE
11
12
RUN_DEPENDS=	aws:devel/py-awscli@${PY_FLAVOR}
13
14
USES=		go
15
GO_BUILDFLAGS=	-ldflags "-s -w"
16
GO_TARGET=	src/sessionmanagerplugin-main/main.go:${PREFIX}/bin/session-manager-plugin \
17
		src/ssmcli-main/main.go:${PREFIX}/bin/ssmcli
18
19
USE_GITHUB=	yes
20
GH_ACCOUNT=	aws
21
GH_PROJECT=	session-manager-plugin
22
GH_TAGNAME=	${DISTVERSION}
23
GH_SUBDIR=	${GH_PROJECT}
24
25
PORTDOCS=	NOTICE README.md RELEASENOTES.md THIRD-PARTY VERSION
26
PLIST_FILES=	${ETCDIR}/sessionmanagerplugin/seelog.xml.template \
27
		${ETCDIR}/SSMCLI/seelog.xml.template \
28
		bin/session-manager-plugin \
29
		bin/ssmcli
30
31
LOGDIR=		${DESTDIR}/var/log/${PORTNAME}
32
33
OPTIONS_DEFINE=	DOCS
34
35
post-extract:
36
	${MKDIR} ${WRKDIR}/src
37
	${LN} -s ${WRKSRC} ${GO_WRKSRC}
38
	${MKDIR} ${WRKSRC}/vendor/src/github.com/aws/session-manager-plugin
39
	${LN} -s ${WRKSRC}/vendor/src/* ${GO_WRKSRC}/vendor/
40
	${LN} -s ${WRKSRC}/src          ${GO_WRKSRC}/vendor/github.com/aws/session-manager-plugin/
41
42
post-patch:
43
	${REINPLACE_CMD} -e 's|%%VERSION%%|${DISTVERSION}|' ${WRKSRC}/src/version/version.go
44
	${REINPLACE_CMD} -e 's|%%ETCDIR%%|${ETCDIR}|g; s|%%LOGDIR%%|${LOGDIR}|g' ${WRKSRC}/seelog_unix.xml
45
	${REINPLACE_CMD} -e 's|%%ETCDIR%%|${ETCDIR}|g; s|%%LOGDIR%%|${LOGDIR}|g' ${WRKSRC}/src/log/log_unix.go
46
47
post-install:
48
	@${MKDIR} ${STAGEDIR}${LOGDIR} ${STAGEDIR}${ETCDIR}/SSMCLI ${STAGEDIR}${ETCDIR}/sessionmanagerplugin
49
	${INSTALL_DATA} ${WRKSRC}/seelog_unix.xml ${STAGEDIR}${ETCDIR}/SSMCLI/seelog.xml.template
50
	${INSTALL_DATA} ${WRKSRC}/seelog_unix.xml ${STAGEDIR}${ETCDIR}/sessionmanagerplugin/seelog.xml.template
51
52
post-install-DOCS-on:
53
	@${MKDIR} ${STAGEDIR}${DOCSDIR}
54
	cd ${WRKSRC} && ${INSTALL_DATA} ${PORTDOCS} ${STAGEDIR}${DOCSDIR}
55
56
.include <bsd.port.mk>
(-)sysutils/amazon-ssm-plugin/distinfo (+3 lines)
Added Link Here
1
TIMESTAMP = 1673833159
2
SHA256 (aws-session-manager-plugin-1.2.398.0_GH0.tar.gz) = 85a511b849f480613b9119f4c800c6ae427b366da463714ade1ccf470de43a99
3
SIZE (aws-session-manager-plugin-1.2.398.0_GH0.tar.gz) = 21657464
(-)sysutils/amazon-ssm-plugin/files/patch-seelog__unix.xml (+14 lines)
Added Link Here
1
--- seelog_unix.xml.orig	2021-08-17 20:31:44 UTC
2
+++ seelog_unix.xml
3
@@ -6,9 +6,9 @@
4
         <exception filepattern="test*" minlevel="error"/>
5
     </exceptions>
6
     <outputs formatid="fmtinfo">
7
-        <rollingfile type="size" filename="/usr/local/sessionmanagerplugin/logs/session-manager-plugin.log" maxsize="30000000" maxrolls="5"/>
8
+        <rollingfile type="size" filename="%%LOGDIR%%/session-manager-plugin.log" maxsize="30000000" maxrolls="5"/>
9
         <filter levels="error,critical" formatid="fmterror">
10
-            <rollingfile type="size" filename="/usr/local/sessionmanagerplugin/logs/errors.log" maxsize="10000000" maxrolls="5"/>
11
+            <rollingfile type="size" filename="%%LOGDIR%%/session-manager-plugin-errors.log" maxsize="10000000" maxrolls="5"/>
12
         </filter>
13
     </outputs>
14
     <formats>
(-)sysutils/amazon-ssm-plugin/files/patch-src_log_log__unix.go (+22 lines)
Added Link Here
1
--- src/log/log_unix.go.orig	2022-06-17 20:08:49 UTC
2
+++ src/log/log_unix.go
3
@@ -23,8 +23,8 @@ import (
4
 )
5
 
6
 const (
7
-	LogsDirectory                = "logs"
8
-	DefaultInstallLocationPrefix = "/usr/local"
9
+	DefaultLogsDirectory         = "%%LOGDIR%%"
10
+	DefaultInstallLocationPrefix = "%%ETCDIR%%"
11
 )
12
 
13
 func getApplicationName(clientName string) string {
14
@@ -45,7 +45,7 @@ func getLogConfigBytes(clientName string) (logConfigBy
15
 
16
 	applicationName := getApplicationName(clientName)
17
 	DefaultSeelogConfigFilePath = filepath.Join(DefaultInstallLocationPrefix, applicationName, SeelogConfigFileName)
18
-	DefaultLogDir = filepath.Join(DefaultInstallLocationPrefix, applicationName, LogsDirectory)
19
+	DefaultLogDir = filepath.Join(DefaultLogsDirectory, applicationName)
20
 	ApplicationLogFile = fmt.Sprintf("%s%s", clientName, LogFileExtension)
21
 	ErrorLogFile = fmt.Sprintf("%s%s", ErrorLogFileSuffix, LogFileExtension)
22
 	if logConfigBytes, err = ioutil.ReadFile(DefaultSeelogConfigFilePath); err != nil {
(-)sysutils/amazon-ssm-plugin/files/patch-src_version_version.go (+8 lines)
Added Link Here
1
--- src/version/version.go.orig	2022-06-17 20:08:49 UTC
2
+++ src/version/version.go
3
@@ -9,4 +9,4 @@
4
 package version
5
 
6
 // Version is the version of the CLI
7
-const Version = "1.2.0.0"
8
+const Version = "%%VERSION%%"
(-)sysutils/amazon-ssm-plugin/pkg-descr (+7 lines)
Added Link Here
1
This package provides Amazon SSM SessionManager and CLI for managing
2
shell experience using SSM APIs.
3
4
HOW TO USE:
5
  aws ssm start-session --target "your instance-id"
6
7
SEE ALSO: https://docs.aws.amazon.com/systems-manager/latest/userguide/session-manager-working-with-install-plugin.html

Return to bug 268142