diff options
author | forumi0721 | 2016-06-02 08:21:16 +0900 |
---|---|---|
committer | forumi0721 | 2016-06-02 08:21:16 +0900 |
commit | cad07a0e2c44b42df9a99a0db7b274b3d7226385 (patch) | |
tree | 81c3a6f70d2a6eab55fa04747577feb90756dab5 | |
download | aur-cad07a0e2c44b42df9a99a0db7b274b3d7226385.tar.gz |
First commit
-rw-r--r-- | .SRCINFO | 41 | ||||
-rw-r--r-- | .gitignore | 5 | ||||
-rw-r--r-- | PKGBUILD | 44 | ||||
-rw-r--r-- | SOURCE | 5 | ||||
-rw-r--r-- | webvirtcloud-git.install | 25 | ||||
-rw-r--r-- | webvirtcloud-staticroot.patch | 13 | ||||
-rw-r--r-- | webvirtcloud.ini | 17 | ||||
-rw-r--r-- | webvirtcloud.nginx.conf.sample | 27 |
8 files changed, 177 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 000000000000..c4a854cefda0 --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,41 @@ +pkgbase = webvirtcloud-git + pkgdesc = WebVirtCloud is virtualization web interface for admins and users + pkgver = 20160508.188.4ce76f5 + pkgrel = 1 + url = https://github.com/retspen/webvirtcloud + install = webvirtcloud-git.install + arch = x86_64 + license = Apache + makedepends = git + depends = libvirt + depends = libvirt-python + depends = qemu + depends = dnsmasq + depends = bridge-utils + depends = ebtables + depends = dmidecode + depends = python2 + depends = supervisor + depends = websockify + depends = python2-django + depends = gunicorn-python2 + depends = libxml2 + provides = webvirtcloud + provides = webvirtcloud-git + conflicts = webvirtcloud + conflicts = webvirtcloud-git + conflicts = webvirtmgr + conflicts = webvirtmgr-git + options = !strip + options = !emptydirs + source = webvirtcloud::git+https://github.com/retspen/webvirtcloud.git + source = webvirtcloud.ini + source = webvirtcloud-staticroot.patch + source = webvirtcloud.nginx.conf.sample + md5sums = SKIP + md5sums = 20b3b5476227c4108110b4b561e582c7 + md5sums = f0b40e21fd861269b41806857bd18d7f + md5sums = 4572258a85dcb0ef1010d717e48d0431 + +pkgname = webvirtcloud-git + diff --git a/.gitignore b/.gitignore new file mode 100644 index 000000000000..a5e5b9fe15be --- /dev/null +++ b/.gitignore @@ -0,0 +1,5 @@ +pkg +src +*.pkg.tar.* +*.src.tar.* +webvirtcloud diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 000000000000..1b809dd830da --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,44 @@ +# Maintainer: StoneCold <forumi0721[at]gmail[dot]com> + +_gitname="webvirtcloud" +pkgname=("${_gitname}-git") +pkgver=20160508.188.4ce76f5 +pkgrel=1 +pkgdesc="WebVirtCloud is virtualization web interface for admins and users" +arch=("x86_64") +url="https://github.com/retspen/webvirtcloud" +license=("Apache") +depends=("libvirt" "libvirt-python" "qemu" "dnsmasq" "bridge-utils" "ebtables" "dmidecode" "python2" "supervisor" "websockify" "python2-django" "gunicorn-python2" "libxml2") +makedepends=("git") +provides=("webvirtcloud" "webvirtcloud-git") +conflicts=("webvirtcloud" "webvirtcloud-git" "webvirtmgr" "webvirtmgr-git") +options=("!strip" "!emptydirs") +install="${pkgname}.install" +source=("${_gitname}::git+https://github.com/retspen/webvirtcloud.git" + "webvirtcloud.ini" + "webvirtcloud-staticroot.patch" + "webvirtcloud.nginx.conf.sample") +md5sums=("SKIP" + "20b3b5476227c4108110b4b561e582c7" + "f0b40e21fd861269b41806857bd18d7f" + "4572258a85dcb0ef1010d717e48d0431") + +pkgver() { + cd "${srcdir}/${_gitname}" + echo "$(git log -1 --format="%cd" --date=short | sed "s/-//g").$(git rev-list --count HEAD).$(git rev-parse --short HEAD)" +} + +package() { + install -dm0755 "${pkgdir}/usr/lib/webvirtcloud" + cp -r "${srcdir}/webvirtcloud" "${pkgdir}/usr/lib" + rm -rf "${pkgdir}/usr/lib/webvirtcloud/.git" + + cd "${pkgdir}/usr/lib/webvirtcloud" + + patch -p1 < "${srcdir}/webvirtcloud-staticroot.patch" + + install -dm0755 "${pkgdir}/etc/supervisor.d" + install -Dm0644 "${srcdir}/webvirtcloud.ini" "${pkgdir}/etc/supervisor.d/webvirtcloud.ini" + install -dm0755 "${pkgdir}/etc/nginx/conf.d" + install -Dm0644 "${srcdir}/webvirtcloud.nginx.conf.sample" "${pkgdir}/etc/nginx/conf.d/webvirtcloud.nginx.conf.sample" +} diff --git a/SOURCE b/SOURCE new file mode 100644 index 000000000000..79c3204ab017 --- /dev/null +++ b/SOURCE @@ -0,0 +1,5 @@ +#!/bin/sh + +SOURCETYPE="AUR4" +SOURCEPATH="https://aur.archlinux.org/webvirtcloud-git.git" + diff --git a/webvirtcloud-git.install b/webvirtcloud-git.install new file mode 100644 index 000000000000..6e3d12ce35c6 --- /dev/null +++ b/webvirtcloud-git.install @@ -0,0 +1,25 @@ +post_install() { + login='webvirtcloud' + + getent group "${login}" > /dev/null || groupadd -r "${login}" > /dev/null + getent passwd "${login}" > /dev/null || useradd -r -g "${login}" -d "/var/lib/${login}" "${login}" -m > /dev/null + + PYTHONPATH=/usr/lib/webvirtcloud/lib /usr/bin/python2 /usr/lib/webvirtcloud/manage.py migrate + PYTHONPATH=/usr/lib/webvirtcloud/lib /usr/bin/python2 /usr/lib/webvirtcloud/manage.py syncdb + chown webvirtcloud:webvirtcloud /usr/lib/webvirtcloud/db.sqlite3 /usr/lib/webvirtcloud + PYTHONPATH=/usr/lib/webvirtcloud/lib /usr/bin/python2 /usr/lib/webvirtcloud/manage.py collectstatic --noinput + cat <<- EOF + To finalize the installation you need to add required user to the kvm group: + # sudo usermod -G kvm -a ${login} + + Sample nginx conf file stored in /etc/nginx/conf.d/webvirtcloud.nginx.conf.sample + + Restart nginx and the supervisord services: + # sudo systemctl restart nginx + # sudo systemctl restart supervisord +EOF +} + +post_upgrade() { + echo +} diff --git a/webvirtcloud-staticroot.patch b/webvirtcloud-staticroot.patch new file mode 100644 index 000000000000..4806f4f32437 --- /dev/null +++ b/webvirtcloud-staticroot.patch @@ -0,0 +1,13 @@ +diff --git a/webvirtcloud/settings.py b/webvirtcloud/settings.py +index a163fa3..51a775e 100644 +--- a/webvirtcloud/settings.py ++++ b/webvirtcloud/settings.py +@@ -64,6 +64,8 @@ USE_L10N = True + + USE_TZ = True + ++STATIC_ROOT = '/usr/lib/webvirtcloud/' ++ + STATIC_URL = '/static/' + + STATICFILES_DIRS = ( diff --git a/webvirtcloud.ini b/webvirtcloud.ini new file mode 100644 index 000000000000..6aa990b58606 --- /dev/null +++ b/webvirtcloud.ini @@ -0,0 +1,17 @@ +[program:webvirtcloud] +command=/usr/bin/gunicorn-python2 webvirtcloud.wsgi:application -c /usr/lib/webvirtcloud/gunicorn.conf.py +directory=/usr/lib/webvirtcloud +user=webvirtcloud +autostart=true +autorestart=true +redirect_stderr=true +environment=PYTHONPATH=/usr/lib/webvirtcloud/lib + +[program:novncd] +command=/usr/bin/python2 /usr/lib/webvirtcloud/console/novncd +directory=/usr/lib/webvirtcloud +user=webvirtcloud +autostart=true +autorestart=true +redirect_stderr=true +environment=PYTHONPATH=/usr/lib/webvirtcloud/lib diff --git a/webvirtcloud.nginx.conf.sample b/webvirtcloud.nginx.conf.sample new file mode 100644 index 000000000000..18d44b824893 --- /dev/null +++ b/webvirtcloud.nginx.conf.sample @@ -0,0 +1,27 @@ +upstream gunicorn_server { + #server unix:/usr/lib/webvirtcloud/venv/wvcloud.socket fail_timeout=0; + server 127.0.0.1:8000 fail_timeout=0; +} +server { + listen 8006; + + server_name servername.domain.com; + access_log /var/log/nginx/webvirtcloud-access_log; + + location /static/ { + root /usr/lib/webvirtcloud; + expires max; + } + + location / { + proxy_pass http://gunicorn_server; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-for $proxy_add_x_forwarded_for; + proxy_set_header Host $host:$server_port; + proxy_set_header X-Forwarded-Proto $remote_addr; + proxy_connect_timeout 600; + proxy_read_timeout 600; + proxy_send_timeout 600; + client_max_body_size 1024M; + } +} |