summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin Morris2023-02-12 03:41:48 -0800
committerKevin Morris2023-02-12 03:41:48 -0800
commit146f811db52d08fe5aa3ec1c47731b75ebe22ea2 (patch)
tree2f5bf16e359792cc7b91dc99a9eb35e460530da5
downloadaur-146f811db52d08fe5aa3ec1c47731b75ebe22ea2.tar.gz
inital commit
Signed-off-by: Kevin Morris <kevr@0cost.org>
-rw-r--r--.SRCINFO19
-rw-r--r--PKGBUILD34
-rw-r--r--webvirt-api-git.install20
3 files changed, 73 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..8a1ad2642cd4
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,19 @@
+pkgbase = webvirt-api-git
+ pkgdesc = PAM-athenticated HTTP proxy to webvirtd
+ pkgver = 1.0.0.r6.gbf93d0b
+ pkgrel = 1
+ url = https://github.com/kevr/webvirt_api
+ install = webvirt-api-git.install
+ arch = any
+ license = Apache
+ depends = webvirtd
+ depends = uwsgi
+ depends = uwsgi-plugin-python
+ depends = python-poetry
+ depends = python-virtualenv
+ provides = webvirt-api
+ conflicts = webvirt-api
+ source = webvirt-api-git::git+https://github.com/kevr/webvirt_api
+ sha256sums = SKIP
+
+pkgname = webvirt-api-git
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..1f4f7a103f0c
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,34 @@
+pkgname='webvirt-api-git'
+pkgver=1.0.0.r6.gbf93d0b
+pkgrel=1
+pkgdesc='PAM-athenticated HTTP proxy to webvirtd'
+license=('Apache')
+url='https://github.com/kevr/webvirt_api'
+
+arch=('any')
+depends=(
+ 'webvirtd'
+ 'uwsgi'
+ 'uwsgi-plugin-python'
+ 'python-poetry'
+ 'python-virtualenv'
+)
+provides=('webvirt-api')
+conflicts=('webvirt-api')
+
+source=("${pkgname}::git+https://github.com/kevr/webvirt_api")
+sha256sums=('SKIP')
+
+install='webvirt-api-git.install'
+
+pkgver() {
+ cd "$pkgname"
+ git describe --long --tags --abbrev=7 | sed 's/\([^-]*-g\)/r\1/;s/-/./g'
+}
+
+package()
+{
+ find "$pkgname" -type f -exec install -vDm644 {} "$pkgdir"/usr/lib/{} \;
+ mv "$pkgdir"/usr/lib/"${pkgname}" "$pkgdir"/usr/lib/webvirt_api
+ install -Dm644 "$pkgname"/res/webvirt_api.ini "$pkgdir"/etc/uwsgi/webvirt_api.ini
+}
diff --git a/webvirt-api-git.install b/webvirt-api-git.install
new file mode 100644
index 000000000000..59cf95bc21ef
--- /dev/null
+++ b/webvirt-api-git.install
@@ -0,0 +1,20 @@
+#!/bin/bash
+
+post_install() {
+ cd /usr/lib/webvirt_api
+ virtualenv -p python /usr/lib/webvirt_api/venv
+ source /usr/lib/webvirt_api/venv/bin/activate
+ poetry install
+ python manage.py migrate
+ python manage.py collectstatic --noinput
+ chown -R webvirt:webvirt /usr/lib/webvirt_api
+}
+
+post_upgrade() {
+ post_install $1
+}
+
+op=$1
+shift
+
+$op $*