Skip to content

Commit 41320a0

Browse files
committed
Merge pull request #6 from aws/addSpecForAL
add amazon-ssm-agent rpm spec file for Amazon Linux repos
2 parents 70ce297 + 32e498b commit 41320a0

File tree

1 file changed

+70
-0
lines changed

1 file changed

+70
-0
lines changed
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
Name : amazon-ssm-agent
2+
Version : 1.1.145
3+
Release : 1%{?dist}
4+
Summary : Manage EC2 Instances using SSM APIs
5+
6+
Group : Amazon/Tools
7+
License : Amazon Software License
8+
BuildArch : x86_64
9+
BuildRoot : %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
10+
URL : http://docs.aws.amazon.com/ssm/latest/APIReference/Welcome.html
11+
Source0 : %{name}-%{version}.tar.gz
12+
13+
Packager : Amazon.com, Inc. <http://aws.amazon.com>
14+
Vendor : Amazon.com
15+
16+
BuildRequires: golang >= 1.3
17+
18+
%description
19+
This package provides the Amazon SSM Agent for managing EC2 Instances using SSM APIs
20+
21+
%prep
22+
23+
%setup -q
24+
25+
%build
26+
PKG_ROOT=`pwd`/src/github.com/aws/amazon-ssm-agent
27+
GOPATH=${PKG_ROOT}/vendor:`pwd`
28+
export GOPATH
29+
30+
GOOS=linux GOARCH=amd64 go build -o ${PKG_ROOT}/bin/amazon-ssm-agent -v -x ${PKG_ROOT}/agent/agent.go
31+
32+
%install
33+
rm -rf %{buildroot}
34+
mkdir -p %{buildroot}/usr/bin/
35+
mkdir -p %{buildroot}/etc/init/
36+
mkdir -p %{buildroot}/etc/amazon/ssm/
37+
mkdir -p %{buildroot}/var/lib/amazon/ssm/
38+
39+
PKG_ROOT=`pwd`/src/github.com/aws/amazon-ssm-agent
40+
41+
cp ${PKG_ROOT}/bin/amazon-ssm-agent %{buildroot}/usr/bin/
42+
cp ${PKG_ROOT}/seelog.xml %{buildroot}/etc/amazon/ssm/
43+
cp ${PKG_ROOT}/amazon-ssm-agent.json %{buildroot}/etc/amazon/ssm/
44+
cp ${PKG_ROOT}/packaging/amazon-linux-ami/amazon-ssm-agent.conf %{buildroot}/etc/init/
45+
46+
%files
47+
%defattr(-,root,root,-)
48+
/etc/init/amazon-ssm-agent.conf
49+
/etc/amazon/ssm/amazon-ssm-agent.json
50+
/etc/amazon/ssm/seelog.xml
51+
/usr/bin/amazon-ssm-agent
52+
/var/lib/amazon/ssm/
53+
54+
%post
55+
if [ $1 -eq 1 ] ; then
56+
# Initial installation
57+
/sbin/start amazon-ssm-agent
58+
fi
59+
60+
%preun
61+
if [ $1 -eq 0 ] ; then
62+
/sbin/stop amazon-ssm-agent
63+
sleep 1
64+
fi
65+
66+
%postun
67+
if [ $1 -ge 1 ]; then
68+
# restart service after upgrade
69+
/sbin/restart amazon-ssm-agent
70+
fi

0 commit comments

Comments
 (0)