summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorDean Galvin2015-09-16 18:01:41 -0400
committerDean Galvin2015-09-16 18:01:41 -0400
commitffb8ac6ca9fa6be1486820a170ee19981581174b (patch)
tree5ba82d984a0a20c39bd4174119d2bd395d5e8aec
downloadaur-ffb8ac6ca9fa6be1486820a170ee19981581174b.tar.gz
Initial import
-rw-r--r--.SRCINFO20
-rw-r--r--PKGBUILD27
-rw-r--r--config.cfg15
-rwxr-xr-xdynamodb32
-rw-r--r--dynamodb.install19
-rw-r--r--dynamodb.service10
6 files changed, 123 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 00000000000..d9edd34b9ae
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,20 @@
+pkgbase = dynamodb
+ pkgdesc = Amazon DynamoDB Local instance. Amazon DynamoDB is a fast and flexible NoSQL database service for all applications that need consistent, single-digit millisecond latency at any scale.
+ pkgver = 1.0
+ pkgrel = 1
+ url = http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Tools.DynamoDBLocal.html
+ install = dynamodb.install
+ arch = any
+ license = custom:DynamoDB Local License Agreement
+ depends = java-runtime
+ source = config.cfg
+ source = dynamodb
+ source = dynamodb.service
+ source = http://dynamodb-local.s3-website-us-west-2.amazonaws.com/dynamodb_local_2015-07-16_1.0.tar.gz
+ sha256sums = 6a2d271d62de9e4e48bd4bd866a72283dec6bacc097c2f6262ab19fc0feb34d9
+ sha256sums = 9a8c0b87b9a3529cb07c6362d586c12e304d2958da71961d51dfc557a258b848
+ sha256sums = 4024db91c14087290fbce707cadead1ea013dc845216e9758a485b7d2f67c3ca
+ sha256sums = 5868fd4b9f624001cda88059af7a54f412a4794dea0d3497e7c57470bfb272fa
+
+pkgname = dynamodb
+
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 00000000000..62e08ca9c8d
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,27 @@
+#Maintainer: Dean Galvin <deangalvin3@gmail.com>
+pkgname=dynamodb
+pkgver=1.0
+pkgrel=1
+pkgdesc="Amazon DynamoDB Local instance. Amazon DynamoDB is a fast and flexible NoSQL database service for all applications that need consistent, single-digit millisecond latency at any scale."
+arch=('any')
+url="http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Tools.DynamoDBLocal.html"
+license=('custom:DynamoDB Local License Agreement')
+depends=('java-runtime')
+install=dynamodb.install
+source=('config.cfg' 'dynamodb' 'dynamodb.service' "http://dynamodb-local.s3-website-us-west-2.amazonaws.com/dynamodb_local_2015-07-16_${pkgver}.tar.gz")
+sha256sums=('6a2d271d62de9e4e48bd4bd866a72283dec6bacc097c2f6262ab19fc0feb34d9' '9a8c0b87b9a3529cb07c6362d586c12e304d2958da71961d51dfc557a258b848' '4024db91c14087290fbce707cadead1ea013dc845216e9758a485b7d2f67c3ca' '5868fd4b9f624001cda88059af7a54f412a4794dea0d3497e7c57470bfb272fa')
+
+
+package() {
+ cd "$pkgdir"
+ mkdir -p "usr/share/dynamodb" "usr/share/licenses/dynamodb" "usr/lib/systemd/system" "usr/bin" "/etc/dynamodb"
+
+
+ cp -dr --no-preserve=ownership "$srcdir/DynamoDBLocal_lib/" "./usr/share/dynamodb"
+
+ install -Dm755 "$srcdir/dynamodb" "./usr/bin"
+ install -Dm644 "$srcdir/config.cfg" "./etc/dynamodb"
+ install -Dm644 "$srcdir/DynamoDBLocal.jar" "./usr/share/dynamodb"
+ install -Dm644 "$srcdir/dynamodb.service" "./usr/lib/systemd/system"
+ install -Dm644 "$srcdir/LICENSE.txt" "./usr/share/licenses/dynamodb"
+}
diff --git a/config.cfg b/config.cfg
new file mode 100644
index 00000000000..24fed36258b
--- /dev/null
+++ b/config.cfg
@@ -0,0 +1,15 @@
+#The port that dynamo will run on
+port=8000
+
+#The path of the directory for the database file
+dbPath=/var/lib/dynamodb
+
+#This will make the DB region agnostic
+shared=true
+
+#Use this if you want to run the db in memory
+#note: it wont be saved if the db is stopped
+#inMemory=true
+
+#Use this for any additional args
+#additionalArgs=('-optimiozeDbBeforeStartup')
diff --git a/dynamodb b/dynamodb
new file mode 100755
index 00000000000..5842790697d
--- /dev/null
+++ b/dynamodb
@@ -0,0 +1,32 @@
+#!/bin/bash
+
+if [ -a ./config.cfg ]; then
+ source /etc/dynamodb/config.cfg
+else
+ shared=true
+ dbPath=/var/lib/dynamodb
+ port=8000
+fi
+
+
+librarypath=/usr/share/dynamodb/DynamoDBLocal_lib
+jar=/usr/share/dynamodb/DynamoDBLocal.jar
+args=("-Djava.library.path=$librarypath" "-jar $jar" "-port $port")
+
+if [ $shared ]; then
+ args+=('-sharedDb')
+fi
+
+if [ $inMemory ]; then
+ args+=('-inMemory')
+else
+ args+=("-dbPath $dbPath")
+fi
+
+args+=$additionalArgs
+
+command=java
+
+echo ${args[*]}
+
+$command ${args[*]}
diff --git a/dynamodb.install b/dynamodb.install
new file mode 100644
index 00000000000..8b6942b1b15
--- /dev/null
+++ b/dynamodb.install
@@ -0,0 +1,19 @@
+post_install() {
+ post_upgrade
+}
+
+post_upgrade() {
+ getent group "dynamodb" &>/dev/null || groupadd -r dynamodb 1>/dev/null
+ getent passwd "dynamodb" &>/dev/null && usermod -s "/usr/bin/nologin" dynamodb &>/dev/null || useradd -r -g dynamodb -d "/var/lib/dynamodb" -s "/usr/bin/nologin" dynamodb 1>/dev/null
+ chown -R dynamodb:dynamodb "/var/lib/dynamodb"
+ # Removes old data from previous version
+}
+
+post_remove() {
+ if getent passwd "dynamodb" >/dev/null; then
+ userdel dynamodb >/dev/null
+ fi
+ if getent group "dynamodb" >/dev/null; then
+ groupdel dynamodb >/dev/null
+ fi
+}
diff --git a/dynamodb.service b/dynamodb.service
new file mode 100644
index 00000000000..8af2086de41
--- /dev/null
+++ b/dynamodb.service
@@ -0,0 +1,10 @@
+[Unit]
+Description=Amazon DynamoDB Local Daemon
+After=network.target
+
+[Service]
+User=dynamodb
+ExecStart=/usr/bin/dynamodb
+
+[Install]
+WantedBy=multi-user.target