summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: fe6952cbffcedcb6b58fc0b4f56ad818950a9f21 (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
# Maintainer: morguldir <morguldir@protonmail.com>

pkgname=chromium-snowflake-git
pkgver=0.5.2.r0.g9565268
pkgrel=1
pkgdesc="Chromium extension for a WebRTC pluggable transport for Tor"
arch=('any')
url=https://snowflake.torproject.org/
license=('BSD')
makedepends=('git' 'npm')
source=("$pkgname::git+https://git.torproject.org/pluggable-transports/snowflake-webext.git")
sha256sums=('SKIP')

pkgver()
{
    cd $pkgname
    git describe --tags --long | sed 's/webext-//;s/\([^-]*-g\)/r\1/;s/-/./g'
}

prepare()
{
    cd "$srcdir"/$pkgname
    npm install
}

build()
{
    cd "$srcdir"/$pkgname
    npm run webext
}

check()
{
    cd "$srcdir"/$pkgname
    npm test
}

package()
{
    mkdir -p "$pkgdir/usr/share/$pkgname"
    cp -dr --no-preserve=ownership "$srcdir"/$pkgname/webext/* "$pkgdir/usr/share/$pkgname/"
    mkdir -p "$pkgdir/usr/share/licenses/$pkgname/"
    install -m644 "$srcdir/$pkgname/LICENSE" "$pkgdir/usr/share/licenses/$pkgname"
}