summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: bd2c8843ff6d2e7d14c09174144497e98e4238a2 (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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
pkgname=privaxy-git
_pkgname=privaxy
pkgver=r27.7156dd7
pkgrel=1
pkgdesc='Privaxy is the next generation tracker and advertisement blocker. It blocks ads and trackers by MITMing HTTP(s) traffic. (git version)'
arch=('x86_64')
url="https://github.com/Barre/privaxy"
license=('AGPL')
makedepends=('trunk' 'nodejs' 'rustup')
provides=("privaxy")
conflicts=("privaxy")
source=(
    "privaxy::git+https://github.com/Barre/privaxy.git#branch=main"
    "$pkgname.tmpfiles"
    "$pkgname.service"
    "$pkgname.sysusers.conf"
)
sha256sums=(
    'SKIP'
    'ba367fc62b311ad4a7022c5452981836672db70d5c3edc0620f842cc8ca80497'
    'acda4febbb8244c9834079ee87016bab723332bc093adbdf192646ee7eb7c002'
    '2a02713029de78f7c23a654a223a0597780e05cdd510a1da7854283b5f678b16'
)
install=$pkgname.install


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

prepare () {
    rustup default stable 
    rustup target add wasm32-unknown-unknown

    cd "$srcdir"/privaxy/privaxy
    cargo fetch --locked --target "$CARCH-unknown-linux-gnu"
}


build () {
    cd "$srcdir/privaxy/web_frontend"
    npm --cache "${srcdir}/npm-cache" install
    # npx tailwindcss build -i src/tailwind.css -o dist/tailwind.css
    trunk build --release

    cd "$srcdir"/privaxy/privaxy
    cargo build --release  --frozen --bin privaxy
}


package () {
    cd "$srcdir"
    install -Dm644 $pkgname.service "$pkgdir"/usr/lib/systemd/system/"$_pkgname".service
    install -Dm644 $pkgname.sysusers.conf "$pkgdir"/usr/lib/sysusers.d/"$_pkgname".conf
    install -Dm644 $pkgname.tmpfiles "$pkgdir"/usr/lib/tmpfiles.d/"$_pkgname".conf
    
    cd "$srcdir"/privaxy
    install -Dt "$pkgdir"/usr/bin target/release/"$_pkgname"

}