summarylogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.SRCINFO30
-rw-r--r--PKGBUILD44
-rw-r--r--completion-fix.patch23
-rw-r--r--nova2-executable.patch13
4 files changed, 110 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..eeffb2aaf74c
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,30 @@
+pkgbase = supernova
+ pkgdesc = Use novaclient with multiple OpenStack nova environments the easy way
+ pkgver = 1.0.7
+ pkgrel = 8
+ url = https://github.com/major/supernova
+ arch = any
+ license = Apache
+ makedepends = python-setuptools
+ makedepends = python2-setuptools
+ source = https://github.com/major/supernova/archive/v1.0.7.tar.gz
+ source = nova2-executable.patch
+ source = completion-fix.patch
+ sha256sums = e0336590e8b4a73404acbfd7379285c631daf628baaba64c9f42d839982d9949
+ sha256sums = 688de41b2ab9f050b210b30ab24b6bf86bb40cb387eb8ef6a6816a79edb7b195
+ sha256sums = dd7a1222aba71da8a0d6a8290a4e4b9f9b37bcdf44dc71e58f16fe6dc9320b36
+
+pkgname = supernova
+ depends = python-novaclient
+ depends = python-keyring
+ conflicts = python-supernova
+ conflicts = python-supernova-git
+ conflicts = supernova-git
+
+pkgname = supernova2
+ depends = python2-novaclient
+ depends = python2-keyring
+ conflicts = python2-supernova
+ conflicts = python2-supernova-git
+ conflicts = supernova2-git
+
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..01f61a7b59f2
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,44 @@
+# Maintainer: Carl George < arch at cgtx dot us >
+
+_name="supernova"
+_cmd="${_name}"
+
+pkgname=("supernova" "supernova2")
+pkgver="1.0.7"
+pkgrel="8"
+pkgdesc="Use novaclient with multiple OpenStack nova environments the easy way"
+arch=("any")
+url="https://github.com/major/${_name}"
+license=("Apache")
+makedepends=("python-setuptools" "python2-setuptools")
+source=("${url}/archive/v${pkgver}.tar.gz"
+ "nova2-executable.patch"
+ "completion-fix.patch")
+sha256sums=('e0336590e8b4a73404acbfd7379285c631daf628baaba64c9f42d839982d9949'
+ '688de41b2ab9f050b210b30ab24b6bf86bb40cb387eb8ef6a6816a79edb7b195'
+ 'dd7a1222aba71da8a0d6a8290a4e4b9f9b37bcdf44dc71e58f16fe6dc9320b36')
+
+prepare() {
+ patch -d "${srcdir}/${_name}-${pkgver}" -p1 < completion-fix.patch
+ cp -a "${srcdir}/${_name}-${pkgver}"{,-python2}
+ patch -d "${srcdir}/${_name}-${pkgver}-python2" -p1 < nova2-executable.patch
+}
+
+package_supernova() {
+ conflicts=("python-supernova" "python-supernova-git" "supernova-git")
+ depends=("python-novaclient" "python-keyring")
+ cd "${srcdir}/${_name}-${pkgver}"
+ python setup.py install --root="${pkgdir}" --optimize=1
+ install -Dm644 "contrib/${_cmd}-completion.bash" "${pkgdir}/usr/share/bash-completion/completions/${_cmd}"
+}
+
+package_supernova2() {
+ conflicts=("python2-supernova" "python2-supernova-git" "supernova2-git")
+ depends=("python2-novaclient" "python2-keyring")
+ cd "${srcdir}/${_name}-${pkgver}-python2"
+ python2 setup.py install --root="${pkgdir}" --optimize=1
+ mv "${pkgdir}/usr/bin/${_cmd}" "${pkgdir}/usr/bin/${_cmd}2"
+ mv "${pkgdir}/usr/bin/${_cmd}-keyring" "${pkgdir}/usr/bin/${_cmd}2-keyring"
+ install -Dm644 "contrib/${_cmd}-completion.bash" "${pkgdir}/usr/share/bash-completion/completions/${_cmd}2"
+ sed -i '/complete -F/ s/$/2/' "${pkgdir}/usr/share/bash-completion/completions/${_cmd}2"
+}
diff --git a/completion-fix.patch b/completion-fix.patch
new file mode 100644
index 000000000000..6dad220caf5c
--- /dev/null
+++ b/completion-fix.patch
@@ -0,0 +1,23 @@
+From 387d664802ee24ad90d8f72f840863e2e6b34dc0 Mon Sep 17 00:00:00 2001
+From: cgtx <carl@carlgeorge.us>
+Date: Thu, 18 Dec 2014 13:29:21 -0600
+Subject: [PATCH] parse all configs for environment completion (fix #70)
+
+---
+ contrib/supernova-completion.bash | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/contrib/supernova-completion.bash b/contrib/supernova-completion.bash
+index 8757c9a..e50be36 100644
+--- a/contrib/supernova-completion.bash
++++ b/contrib/supernova-completion.bash
+@@ -3,7 +3,8 @@
+ _supernova()
+ {
+ local cur=${COMP_WORDS[COMP_CWORD]}
+- local possibilities=$(awk '/\[/{ gsub(/\[|\]/,"");print}' ~/.supernova)
++ local configs=$(cat "${XDG_CONFIG_HOME}"/supernova ~/.supernova ./.supernova 2> /dev/null)
++ local possibilities=$(echo "${configs}" | sed -n '/^\[.*\]/ s_\[\(.*\)\]_\1_p' | sort -u)
+ COMPREPLY=( $(compgen -W "${possibilities}" -- $cur) )
+ }
+ complete -F _supernova supernova
diff --git a/nova2-executable.patch b/nova2-executable.patch
new file mode 100644
index 000000000000..d6626a3a1d1c
--- /dev/null
+++ b/nova2-executable.patch
@@ -0,0 +1,13 @@
+diff --git a/supernova/executable.py b/supernova/executable.py
+index d585d81..35712e1 100644
+--- a/supernova/executable.py
++++ b/supernova/executable.py
+@@ -64,7 +64,7 @@ def run_supernova():
+ config.run_config()
+
+ parser = argparse.ArgumentParser()
+- parser.add_argument('-x', '--executable', default='nova',
++ parser.add_argument('-x', '--executable', default='nova2',
+ help='command to run instead of nova')
+ parser.add_argument('--version', action=_ShowVersion,
+ help='display supernova version')