summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorCallum2019-09-17 13:45:56 +0100
committerCallum2019-09-17 13:45:56 +0100
commit6d22c3dc7965d79de637752a365caab65574faf6 (patch)
tree605aeedf522533fa2433d981f69f6b1bf32f269a
downloadaur-6d22c3dc7965d79de637752a365caab65574faf6.tar.gz
feat: initial pkg setup
-rw-r--r--.SRCINFO24
-rw-r--r--PKGBUILD34
-rw-r--r--aws-session-manager-plugin.install57
3 files changed, 115 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..7be3bcd0394f
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,24 @@
+pkgbase = aws-session-manager-plugin
+ pkgdesc = AWS Session Manager Plugin for aws-cli.
+ pkgver = 1.1.31.0
+ pkgrel = 1
+ url = https://docs.aws.amazon.com/systems-manager/latest/userguide/session-manager-working-with-install-plugin.html
+ install = aws-session-manager-plugin.install
+ arch = i686
+ arch = x86_64
+ license = custom
+ depends = aws-cli
+ options = !strip
+ options = !emptydirs
+ backup = etc/init/session-manager-plugin.conf
+ backup = usr/lib/systemd/system/session-manager-plugin.service
+ backup = usr/sessionmanagerplugin/LICENSE
+ backup = usr/sessionmanagerplugin/seelog.xml
+ backup = usr/sessionmanagerplugin/VERSION
+ source_i686 = https://s3.amazonaws.com/session-manager-downloads/plugin/1.1.31.0/ubuntu_32bit/session-manager-plugin.deb
+ sha512sums_i686 = 9ff1895cd29592ee8c75d4f53af04b76e075387b2fca33bfd787b9a71880ed6a1091d34fe29c4af9f450f96856eb9fddbf366313ecda5185cc8a52a822b9bc93
+ source_x86_64 = https://s3.amazonaws.com/session-manager-downloads/plugin/1.1.31.0/ubuntu_64bit/session-manager-plugin.deb
+ sha512sums_x86_64 = b24dc8ebaa21689d4d2af2084a774a8b2037111438352cca065a0ac8140e4fe3b98eaf9dfde7f304d51aea19af93de0a9acdf400c684838720876827fb92eaf7
+
+pkgname = aws-session-manager-plugin
+
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..0d69c60f4c81
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,34 @@
+# Generated by debtap
+# Maintainer: Callum Denby <me@callumdenby.com>
+# Contributor: Callum Denby <me@callumdenby.com>
+pkgname=aws-session-manager-plugin
+pkgver=1.1.31.0
+pkgrel=1
+pkgdesc="AWS Session Manager Plugin for aws-cli."
+arch=('i686' 'x86_64')
+url="https://docs.aws.amazon.com/systems-manager/latest/userguide/session-manager-working-with-install-plugin.html"
+license=('custom')
+depends=('aws-cli')
+backup=('etc/init/session-manager-plugin.conf' 'usr/lib/systemd/system/session-manager-plugin.service' 'usr/sessionmanagerplugin/LICENSE' 'usr/sessionmanagerplugin/seelog.xml' 'usr/sessionmanagerplugin/VERSION')
+options=('!strip' '!emptydirs')
+install=${pkgname}.install
+source_i686=(https://s3.amazonaws.com/session-manager-downloads/plugin/${pkgver}/ubuntu_32bit/session-manager-plugin.deb)
+source_x86_64=(https://s3.amazonaws.com/session-manager-downloads/plugin/${pkgver}/ubuntu_64bit/session-manager-plugin.deb)
+sha512sums_i686=('9ff1895cd29592ee8c75d4f53af04b76e075387b2fca33bfd787b9a71880ed6a1091d34fe29c4af9f450f96856eb9fddbf366313ecda5185cc8a52a822b9bc93')
+sha512sums_x86_64=('b24dc8ebaa21689d4d2af2084a774a8b2037111438352cca065a0ac8140e4fe3b98eaf9dfde7f304d51aea19af93de0a9acdf400c684838720876827fb92eaf7')
+
+package(){
+
+ # Extract package data
+ tar xzf data.tar.gz -C "${pkgdir}"
+
+ # Fix directories structure differencies
+ cd "${pkgdir}"
+
+ mkdir -p usr/lib 2> /dev/null; mv lib/* usr/lib; rm -rf lib
+
+ mv usr/local/* usr; rm -rf usr/local
+
+ cd ..
+
+}
diff --git a/aws-session-manager-plugin.install b/aws-session-manager-plugin.install
new file mode 100644
index 000000000000..6d93a6275b8f
--- /dev/null
+++ b/aws-session-manager-plugin.install
@@ -0,0 +1,57 @@
+pre_install() {
+ echo "Preparing for install"
+ if [ $(cat /proc/1/comm) = init ]
+ then
+ stop session-manager-plugin || true
+ elif [ $(cat /proc/1/comm) = systemd ]
+ then
+ systemctl stop session-manager-plugin
+ systemctl daemon-reload
+ fi
+}
+
+post_install() {
+ echo "Starting session-manager-plugin"
+ if [ $(cat /proc/1/comm) = init ]
+ then
+ start session-manager-plugin || true
+ elif [ $(cat /proc/1/comm) = systemd ]
+ then
+ systemctl enable session-manager-plugin
+ systemctl start session-manager-plugin
+ systemctl daemon-reload
+ fi
+ if [ -f /usr/bin/session-manager-plugin ]
+ then
+ rm /usr/bin/session-manager-plugin
+ fi
+ ln -s /usr/sessionmanagerplugin/bin/session-manager-plugin /usr/bin/session-manager-plugin
+}
+
+pre_upgrade() {
+ pre_install
+}
+
+post_upgrade() {
+ post_install
+}
+
+pre_remove() {
+ echo "Stopping session-manager-plugin"
+ if [ $(cat /proc/1/comm) = init ]
+ then
+ stop session-manager-plugin || true
+ elif [ $(cat /proc/1/comm) = systemd ]
+ then
+ systemctl stop session-manager-plugin
+ systemctl disable session-manager-plugin
+ systemctl daemon-reload
+ fi
+}
+
+post_remove() {
+ if [ -f /usr/bin/session-manager-plugin ]
+ then
+ rm /usr/bin/session-manager-plugin
+ fi
+}