aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Healy <lmiphay@gmail.com>2015-09-03 22:12:37 +0100
committerPaul Healy <lmiphay@gmail.com>2015-09-03 22:12:37 +0100
commitb3c4f271c1d6ae7e9653fa1e20e99dfba9232d2a (patch)
treebbce2b0b904f538541f64ee4bfaf19d86b0d3ea2
parentadd mussh as a dep of g-oam (diff)
downloadlmiphay-b3c4f271c1d6ae7e9653fa1e20e99dfba9232d2a.tar.gz
lmiphay-b3c4f271c1d6ae7e9653fa1e20e99dfba9232d2a.tar.bz2
lmiphay-b3c4f271c1d6ae7e9653fa1e20e99dfba9232d2a.zip
add LXC Web Panel ebuild
-rw-r--r--app-emulation/lxc-webpanel/Manifest3
-rw-r--r--app-emulation/lxc-webpanel/files/lxc-config.patch57
-rwxr-xr-xapp-emulation/lxc-webpanel/files/lxc-webpanel.init.d19
-rw-r--r--app-emulation/lxc-webpanel/lxc-webpanel-9999.ebuild43
4 files changed, 122 insertions, 0 deletions
diff --git a/app-emulation/lxc-webpanel/Manifest b/app-emulation/lxc-webpanel/Manifest
new file mode 100644
index 0000000..f0759f1
--- /dev/null
+++ b/app-emulation/lxc-webpanel/Manifest
@@ -0,0 +1,3 @@
+AUX lxc-config.patch 2002 SHA256 74c7b99ef6a027694f409328601429cf1c63b226ea0fbedc4b34b5d7d99ded37 SHA512 3d013c065ad7c14c5b619ce6d863dd7f74ac2c1c6c85cf6206663d8d87f4d28eb42d463244aa5871c61653b6042bd4086f3d97eccc4c4c259baccccaa9520baf WHIRLPOOL 4d5d714bf4866b3390862b052d864f79a8d24154534ac4306a0e55ab846d0380e626eaa312a673944cfabbbe6ddd6ff2eb79f43fa6c96e1b6cbb41760bd0730e
+AUX lxc-webpanel.init.d 447 SHA256 9ce93f6eb5db2115d6af406fbfd5f6038d8da2e394f11faffa1ad424e6634b5a SHA512 ec5cc1ebe4b8e78c81ab004080b3e3d146e70822008b2b97b75ac569a243ffee0c279f3656372f49afb9edc196a248f298719126c3fed41274355fa0fb6c12ee WHIRLPOOL 44d7900c73edb8ac1a47ec3652bbd6bff8e84931d3ad668fafc206bf68193dfa065aaf5a89f04b6e4637e5e0373bf4afd606ebee41ffe4038abee35b91ee1dec
+EBUILD lxc-webpanel-9999.ebuild 827 SHA256 6bd77da20b419a5fd380905e13272a0cb463adf30cf6eac6813058ef43456cab SHA512 a7d83f93fbea1d99135dc835649eb41cd21d273f80bd11cf27d81f2e71365817447f7990d3a0dbcc4520bb22f9e629ad0bee293b65ac90ee80e59e5e0db406ba WHIRLPOOL 83d3b95c26d9d1499fe829f7b9501b41e59d9d878518f6472ada8217ef57daa8a0879975af6b3752022c159ad068b39ef3236a8ff149ffe10fe79529813ccb12
diff --git a/app-emulation/lxc-webpanel/files/lxc-config.patch b/app-emulation/lxc-webpanel/files/lxc-config.patch
new file mode 100644
index 0000000..3ba9c9f
--- /dev/null
+++ b/app-emulation/lxc-webpanel/files/lxc-config.patch
@@ -0,0 +1,57 @@
+diff --git a/lwp.py b/lwp.py
+index eee5ff7..fa5c5f0 100644
+--- a/lwp.py
++++ b/lwp.py
+@@ -922,4 +922,4 @@ def check_session_limit():
+ session['last_activity'] = now
+
+ if __name__ == '__main__':
+- app.run(host=app.config['ADDRESS'], port=app.config['PORT'])
++ app.run(host=app.config['ADDRESS'], port=app.config['PORT'], debug=False)
+diff --git a/lwp/__init__.py b/lwp/__init__.py
+index 9ba9a76..2e37e99 100644
+--- a/lwp/__init__.py
++++ b/lwp/__init__.py
+@@ -289,10 +289,8 @@ def get_container_settings(name):
+ returns a dict of all utils settings for a container
+ '''
+
+- if os.geteuid():
+- filename = os.path.expanduser('~/.local/share/lxc/%s/config' % name)
+- else:
+- filename = '/var/lib/lxc/%s/config' % name
++ lxcpath = subprocess.check_output(["lxc-config", "lxc.lxcpath"]).strip()
++ filename = lxcpath + '/%s/config' % name
+
+ if not file_exist(filename):
+ return False
+@@ -421,11 +419,8 @@ def push_config_value(key, value, container=None):
+ return values
+
+ if container:
+- if os.geteuid():
+- filename = os.path.expanduser('~/.local/share/lxc/%s/config' %
+- container)
+- else:
+- filename = '/var/lib/lxc/%s/config' % container
++ lxcpath = subprocess.check_output(["lxc-config", "lxc.lxcpath"]).strip()
++ filename = lxcpath + '/%s/config' % container
+
+ save = save_cgroup_devices(filename=filename)
+
+diff --git a/lxclite/__init__.py b/lxclite/__init__.py
+index 2dc6cc0..1061777 100644
+--- a/lxclite/__init__.py
++++ b/lxclite/__init__.py
+@@ -144,10 +144,7 @@ def ls():
+ Note: Directory mode for Ubuntu 12/13 compatibility
+ '''
+
+- if os.geteuid():
+- base_path = os.path.expanduser("~/.local/share/lxc/")
+- else:
+- base_path = '/var/lib/lxc'
++ base_path = subprocess.check_output(["lxc-config", "lxc.lxcpath"]).strip()
+
+ try:
+ ct_list = [x for x in os.listdir(base_path)
diff --git a/app-emulation/lxc-webpanel/files/lxc-webpanel.init.d b/app-emulation/lxc-webpanel/files/lxc-webpanel.init.d
new file mode 100755
index 0000000..522f9fc
--- /dev/null
+++ b/app-emulation/lxc-webpanel/files/lxc-webpanel.init.d
@@ -0,0 +1,19 @@
+#!/sbin/openrc-run
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: $
+
+description="LXC Web Panel"
+
+logfile="/var/log/lxc-webpanel.log"
+command="/usr/bin/python2"
+command_args="lwp.py"
+start_stop_daemon_args="--chdir /usr/share/lxc-webpanel --stdout $logfile --stderr $logfile"
+
+command_background=yes
+pidfile=/run/lxc-webpanel.pid
+
+depend() {
+ need net
+ after bootmisc
+}
diff --git a/app-emulation/lxc-webpanel/lxc-webpanel-9999.ebuild b/app-emulation/lxc-webpanel/lxc-webpanel-9999.ebuild
new file mode 100644
index 0000000..34c3fac
--- /dev/null
+++ b/app-emulation/lxc-webpanel/lxc-webpanel-9999.ebuild
@@ -0,0 +1,43 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: $
+
+EAPI=5
+
+inherit eutils git-r3
+
+DESCRIPTION="LXC Web Panel"
+HOMEPAGE="http://lxc-webpanel.github.io/"
+
+EGIT_REPO_URI="https://github.com/lxc-webpanel/LXC-Web-Panel.git"
+
+LICENSE="MIT"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE=""
+
+DEPEND=""
+RDEPEND="${DEPEND}
+ app-emulation/lxc
+ dev-python/flask"
+
+src_prepare() {
+ sed -i 's:lwp.conf:/etc/lwp.conf:' "lwp.py"
+ sed -i "s:lwp.db:/var/db/${PN}/lwp.db:" "lwp.conf"
+ epatch "${FILESDIR}/lxc-config.patch"
+}
+
+src_install() {
+ dodoc CHANGELOG README.md
+
+ insinto /etc
+ doins "${S}/lwp.conf"
+
+ newinitd "${FILESDIR}/${PN}.init.d" "${PN}"
+
+ insinto /var/db/${PN}
+ doins "${S}/lwp.db"
+
+ insinto /usr/share/${PN}
+ doins -r lwp lwp.py lxclite static templates version
+}