summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 8ff1b1b2b0c9828fc3edf19e55215a0faba2eff9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
_pkgname=wg-manager
pkgname="${_pkgname}-git"
pkgver=r216.e70ba4b
pkgrel=1
pkgdesc="A easy to use WireGuard dashboard and management tool"
arch=("any")
url="https://github.com/perara/wg-manager"
license=("MIT")
depends=(
    "wireguard-tools" "uvicorn" "nodejs" "npm"
    "python" "python-pydantic" "python-fastapi" "python-aiofiles" "python-aiosqlite" "python-sqlalchemy" "python-databases" "python-pyjwt" "python-passlib" "python-bcrypt" "python-python-multipart" "python-jinja" "python-sqlalchemy-utils" "python-sqlalchemy-migrate" "python-requests" "python-uvloop" "python-httptools"
    "python-uvicorn-loguru-integration"
)
makedepends=("angular-cli")
provides=($_pkgname)
conflicts=($_pkgname)
source=("git+$url.git" "wg-manager.service")
md5sums=('SKIP'
         '1aeba283c71d79defdd4075dfdc3772f')

pkgver() {
    cd "${srcdir}/${_pkgname}"
    printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
}

build() {
    cd "${srcdir}/${_pkgname}/wg-manager-frontend"
    npm install --legacy-peer-deps # won't build without --legacy-peer-deps
    ng build --configuration="production"
}

package() {
    cd "${srcdir}/${_pkgname}"
    mkdir -p "${pkgdir}/opt/"
    mv wg-manager-backend "${pkgdir}/opt/wg-manager"
    mv wg-manager-frontend/dist "${pkgdir}/opt/wg-manager/build"
    mkdir -p "${pkgdir}/usr/lib/systemd/system/"
    mv "${srcdir}/wg-manager.service" "${pkgdir}/usr/lib/systemd/system/"
}