summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 80f02c239cc8433c913cb6dea6d3a5b49d766896 (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
# Maintainer: NebulaNeko <chfsefefgesfen foxmail>
# Contributor: caiye <ye.jingchen[at]gmail[dot]com>
# Contributor: Alvie Zhang <alvie.zhang {AT} gmail {DOT} com>
pkgname=meow-proxy-git
pkgver=r1164.4dc7bec
pkgrel=3
pkgdesc="A fork of MEOW that uses whitelist mode and bypasses IPv6"
arch=('i686' 'x86_64')
url="https://github.com/netheril96/MEOW"
license=('BSD')
depends=(glibc)
makedepends=('go' 'git')
conflicts=(meow-proxy)

source=(
        'git+https://github.com/netheril96/MEOW'
        meow@.service
        meow_user.service
        )

sha1sums=(
          'SKIP'
          'bf9f1c5c58807e39c969d1ec5cb6535579f0dc92'
          '4ab8d5afaf78c992bdd7c45a7fcd7dd4ae3875d5'
          )

install=$pkgname.install

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

prepare() {
    cd "$srcdir"
    mkdir -p gopath
    export GOPATH="$srcdir/gopath"
    for gopkg in 'github.com/shadowsocks/shadowsocks-go/shadowsocks' 'github.com/cyfdecyf/'{leakybuf,color,bufio}; do
        go get -d -fix -v -x -u "$gopkg"
    done
    sed -i "45,46s/true/false/g" "$srcdir/MEOW/log.go"
}

build() {
    export GOPATH="$srcdir/gopath"
    cd "$srcdir/MEOW"
    go run chinaip_gen.go
    go build -v
}

package() {
    install -Dm755 "$srcdir/MEOW/MEOW" "$pkgdir/usr/bin/meow"
    install -Dm644 meow@.service ${pkgdir}/usr/lib/systemd/system/meow@.service
    install -Dm644 meow_user.service ${pkgdir}/usr/lib/systemd/user/meow.service
    install -Dm644 "$srcdir/MEOW/LICENSE" "$pkgdir"/usr/share/licenses/$pkgname/LICENSE
}