diff options
author | Kevin Morris | 2023-02-12 07:00:40 -0800 |
---|---|---|
committer | Kevin Morris | 2023-02-12 07:00:40 -0800 |
commit | 5ecb61ffe32aed99dfdaf80467dc06577d88b0e5 (patch) | |
tree | 4b5400632efe0e39dcad85cd6938e37dae13b58c | |
parent | 146f811db52d08fe5aa3ec1c47731b75ebe22ea2 (diff) | |
download | aur-5ecb61ffe32aed99dfdaf80467dc06577d88b0e5.tar.gz |
include post-install doc & cleanup post_install
Signed-off-by: Kevin Morris <kevr@0cost.org>
-rw-r--r-- | .SRCINFO | 2 | ||||
-rw-r--r-- | PKGBUILD | 13 | ||||
-rw-r--r-- | webvirt-api-git.install | 23 |
3 files changed, 29 insertions, 9 deletions
@@ -1,6 +1,6 @@ pkgbase = webvirt-api-git pkgdesc = PAM-athenticated HTTP proxy to webvirtd - pkgver = 1.0.0.r6.gbf93d0b + pkgver = 1.0.0.r6.gf6b4d01 pkgrel = 1 url = https://github.com/kevr/webvirt_api install = webvirt-api-git.install @@ -1,5 +1,5 @@ pkgname='webvirt-api-git' -pkgver=1.0.0.r6.gbf93d0b +pkgver=1.0.0.r6.gf6b4d01 pkgrel=1 pkgdesc='PAM-athenticated HTTP proxy to webvirtd' license=('Apache') @@ -28,7 +28,12 @@ pkgver() { 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 + cd "$pkgname" + + # Install application to /var/lib/webvirt_api + find . -type f -exec install -vDm644 {} "$pkgdir"/var/lib/webvirt_api/{} \; + + # Install UWSGI configuration to /etc/uwsgi + # Enable via: systemctl start uwsgi@webvirt_api + install -Dm644 res/webvirt_api.ini "$pkgdir"/etc/uwsgi/webvirt_api.ini } diff --git a/webvirt-api-git.install b/webvirt-api-git.install index 59cf95bc21ef..ce488dce528f 100644 --- a/webvirt-api-git.install +++ b/webvirt-api-git.install @@ -1,13 +1,28 @@ #!/bin/bash +dir=/var/lib/webvirt_api + post_install() { - cd /usr/lib/webvirt_api - virtualenv -p python /usr/lib/webvirt_api/venv - source /usr/lib/webvirt_api/venv/bin/activate + cd "$dir" + virtualenv -p python "$dir"/venv + source "$dir"/venv/bin/activate poetry install python manage.py migrate python manage.py collectstatic --noinput - chown -R webvirt:webvirt /usr/lib/webvirt_api + chown -R webvirt:webvirt "$dir" + + cat << EOF + +A UWSGI configuration is provided at /etc/uwsgi/webvirt_api.ini. + +To start the API server: + + $ systemctl start uwsgi@webvirt_api + +By default, the API is accessible at http://localhost:9080. + +EOF + } post_upgrade() { |