diff options
author | Shohei Maruyama | 2023-08-06 00:11:50 +0900 |
---|---|---|
committer | Shohei Maruyama | 2023-08-06 00:13:47 +0900 |
commit | 096b9a3dd45577702ef7415b5a0dff976b1c76ed (patch) | |
tree | 3b373dc52a9620abfd2f07a8fe4804782f26eb07 | |
parent | 78bd3e9c6ba39dacbc359cccef8c67c165d032d7 (diff) | |
download | aur-096b9a3dd45577702ef7415b5a0dff976b1c76ed.tar.gz |
PKGBUILD: Migrate to python3
python2 has been deprecated, so let's migrate to python3.
Signed-off-by: Shohei Maruyama <cheat.sc.linux@outlook.com>
-rw-r--r-- | .SRCINFO | 38 | ||||
-rw-r--r-- | PKGBUILD | 44 | ||||
-rw-r--r-- | webvirtcloud-git.install | 10 | ||||
-rw-r--r-- | webvirtcloud-staticroot.patch | 13 |
4 files changed, 59 insertions, 46 deletions
@@ -1,25 +1,32 @@ pkgbase = webvirtcloud-git pkgdesc = WebVirtCloud is virtualization web interface for admins and users - pkgver = 20180824.422.3f98aa2 + pkgver = 20230711.1220.82de7f4 pkgrel = 1 url = https://github.com/retspen/webvirtcloud install = webvirtcloud-git.install arch = x86_64 license = Apache makedepends = git - depends = libvirt - depends = libvirt-python2 - depends = qemu - depends = dnsmasq - depends = bridge-utils - depends = ebtables - depends = dmidecode - depends = python2 - depends = supervisor - depends = websockify - depends = python2-django - depends = gunicorn-python2 - depends = python2-lxml + depends = python + depends = python-django + depends = python-django_bootstrap5 + depends = python-django-icons + depends = python-django-login-required-middleware + depends = gunicorn + depends = python-libsass + depends = libvirt-python + depends = python-lxml + depends = python-qrcode + depends = python-websockify + depends = python-zipp + depends = python-ldap3 + depends = python-engineio + depends = python-socketio + depends = python-eventlet + depends = python-django-rest-framework + depends = python-drf-nested-routers + depends = python-drf-yasg + depends = python-markdown provides = webvirtcloud provides = webvirtcloud-git conflicts = webvirtcloud @@ -30,12 +37,9 @@ pkgbase = webvirtcloud-git 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 - @@ -1,14 +1,37 @@ # Maintainer: StoneCold <forumi0721[at]gmail[dot]com> +# Maintainer: Shohei Maruyama <cheat.sc.linux@outlook.com> _gitname="webvirtcloud" pkgname=("${_gitname}-git") -pkgver=20180824.422.3f98aa2 +pkgver=20230711.1220.82de7f4 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-python2" "qemu" "dnsmasq" "bridge-utils" "ebtables" "dmidecode" "python2" "supervisor" "websockify" "python2-django" "gunicorn-python2" "python2-lxml") +# rwlock is no longer required for python3.x +depends=( + "python" + "python-django" + "python-django_bootstrap5" + "python-django-icons" + "python-django-login-required-middleware" + "gunicorn" + "python-libsass" + "libvirt-python" + "python-lxml" + "python-qrcode" + "python-websockify" + "python-zipp" + "python-ldap3" + "python-engineio" + "python-socketio" + "python-eventlet" + "python-django-rest-framework" + "python-drf-nested-routers" + "python-drf-yasg" + "python-markdown" +) makedepends=("git") provides=("webvirtcloud" "webvirtcloud-git") conflicts=("webvirtcloud" "webvirtcloud-git" "webvirtmgr" "webvirtmgr-git") @@ -16,11 +39,9 @@ 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() { @@ -28,17 +49,18 @@ pkgver() { echo "$(git log -1 --format="%cd" --date=short | sed "s/-//g").$(git rev-list --count HEAD).$(git rev-parse --short HEAD)" } +prepare() { + cd "${_gitname}" + + cp "${_gitname}/settings.py.template" "${_gitname}/settings.py" + echo "STATIC_ROOT = '/usr/lib/webvirtcloud/'" >> "${_gitname}/settings.py" + sed -i -e "s/SECRET_KEY = \"\"/SECRET_KEY = \"12345678901234567890123456789012345678901234567890\"/g" webvirtcloud/settings.py +} + 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" - - cp webvirtcloud/settings.py.template webvirtcloud/settings.py - sed -i -e "s/SECRET_KEY = ''/SECRET_KEY = '12345678901234567890123456789012345678901234567890'/g" webvirtcloud/settings.py - - patch -p1 < "${srcdir}/webvirtcloud-staticroot.patch" install -dm0755 "${pkgdir}/etc/supervisor.d" install -Dm0644 "${srcdir}/webvirtcloud.ini" "${pkgdir}/etc/supervisor.d/webvirtcloud.ini" diff --git a/webvirtcloud-git.install b/webvirtcloud-git.install index d960bb8b263f..84165340285b 100644 --- a/webvirtcloud-git.install +++ b/webvirtcloud-git.install @@ -3,12 +3,12 @@ post_install() { getent passwd "${login}" > /dev/null || useradd -r -U -d "/var/lib/${login}" "${login}" -m > /dev/null - PYTHONPATH=/usr/lib/webvirtcloud/lib /usr/bin/python2 /usr/lib/webvirtcloud/manage.py migrate --run-syncdb --noinput + PYTHONPATH=/usr/lib/webvirtcloud/lib /usr/lib/webvirtcloud/manage.py migrate --run-syncdb --noinput 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 + PYTHONPATH=/usr/lib/webvirtcloud/lib /usr/lib/webvirtcloud/manage.py collectstatic --noinput cat <<- EOF - If you want to change admin, you need to run: - # PYTHONPATH=/usr/lib/webvirtcloud/lib /usr/bin/python2 /usr/lib/webvirtcloud/manage.py createsuperuser + If you want to change admin, you need to run: + PYTHONPATH=/usr/lib/webvirtcloud/lib /usr/lib/webvirtcloud/manage.py createsuperuser WebVirtCloud daemon is managed by Supervisord. # sudo systemctl restart supervisord @@ -22,6 +22,6 @@ EOF } post_upgrade() { - PYTHONPATH=/usr/lib/webvirtcloud/lib /usr/bin/python2 /usr/lib/webvirtcloud/manage.py migrate --run-syncdb --noinput + PYTHONPATH=/usr/lib/webvirtcloud/lib /usr/lib/webvirtcloud/manage.py migrate --run-syncdb --noinput chown webvirtcloud:webvirtcloud /usr/lib/webvirtcloud/db.sqlite3 /usr/lib/webvirtcloud } diff --git a/webvirtcloud-staticroot.patch b/webvirtcloud-staticroot.patch deleted file mode 100644 index 4806f4f32437..000000000000 --- a/webvirtcloud-staticroot.patch +++ /dev/null @@ -1,13 +0,0 @@ -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 = ( |