2017-11-19 19:13:16 +00:00
|
|
|
# $Id$
|
|
|
|
# Maintainer: Felix Yan <felixonmars@archlinux.org>
|
|
|
|
# Contributor: pandada8 <pandada8@gmail.com>
|
|
|
|
|
|
|
|
# ALARM: Kevin Mihelich <kevin@archlinuxarm.org>
|
|
|
|
# - fix install source path for ARM architectures
|
|
|
|
|
|
|
|
pkgname=v2ray
|
2018-06-30 01:59:20 +00:00
|
|
|
pkgver=3.27
|
2017-11-19 19:13:16 +00:00
|
|
|
pkgrel=1
|
|
|
|
pkgdesc="A platform for building proxies to bypass network restrictions"
|
|
|
|
arch=('x86_64')
|
|
|
|
url="https://github.com/v2ray/v2ray-core"
|
|
|
|
license=('MIT')
|
|
|
|
makedepends=('go' 'git')
|
|
|
|
source=("$pkgname-$pkgver.tar.gz::https://github.com/v2ray/v2ray-core/archive/v$pkgver.tar.gz"
|
|
|
|
'v2ray.service')
|
2018-06-30 01:59:20 +00:00
|
|
|
sha512sums=('1460361f7365e0db390aa47147e61c1714e84217fe4383c40e929acc66315b52df7dfbfbfb27cb3e9a36c04906ef50f718541009d8f3ee237e2b9252a7ace4af'
|
2017-11-19 19:13:16 +00:00
|
|
|
'bebb87f43b3920be8efde9aece9c4305323cd7d3a65a3b2441f0dbd0098c02a18ca89a5b08833eee70482cffae2c8e7b7237bb5a4d1076e3c30d273898e2bedb')
|
|
|
|
|
|
|
|
prepare() {
|
|
|
|
export GOPATH="$srcdir/build"
|
|
|
|
go get v2ray.com/core github.com/miekg/dns golang.org/x/sys/unix v2ray.com/ext/assert \
|
|
|
|
github.com/gorilla/websocket golang.org/x/crypto/chacha20poly1305 golang.org/x/crypto/sha3 \
|
|
|
|
v2ray.com/ext golang.org/x/net/proxy github.com/google/go-github/github golang.org/x/oauth2 \
|
2018-02-12 13:49:35 +00:00
|
|
|
github.com/gogo/protobuf/proto google.golang.org/grpc
|
2017-11-19 19:13:16 +00:00
|
|
|
go install v2ray.com/ext/tools/build/vbuild
|
|
|
|
}
|
|
|
|
|
|
|
|
build() {
|
|
|
|
cd v2ray-core-$pkgver
|
|
|
|
"$GOPATH"/bin/vbuild
|
|
|
|
}
|
|
|
|
|
|
|
|
check() {
|
|
|
|
cd v2ray-core-$pkgver
|
|
|
|
go test -p 1 -tags json -v v2ray.com/core/...
|
|
|
|
}
|
|
|
|
|
|
|
|
package() {
|
|
|
|
cd v2ray-core-$pkgver
|
|
|
|
install -Dm644 LICENSE "$pkgdir"/usr/share/licenses/v2ray/LICENSE
|
2017-12-29 01:43:05 +00:00
|
|
|
install -Dm644 release/config/systemd/v2ray.service ${pkgdir}/usr/lib/systemd/system/v2ray.service
|
2017-11-19 19:13:16 +00:00
|
|
|
sed -i '/ExecStart/c\ExecStart=/usr/bin/env v2ray.location.asset=/etc/v2ray /usr/bin/v2ray -config /etc/v2ray/config.json' "$pkgdir"/usr/lib/systemd/system/v2ray.service
|
2017-12-29 01:43:05 +00:00
|
|
|
install -Dm644 release/config/geoip.dat release/config/geosite.dat release/config/*.json -t "$pkgdir"/etc/v2ray/
|
2017-11-19 19:13:16 +00:00
|
|
|
if [[ $CARCH == "aarch64" ]]; then
|
|
|
|
install -Dm755 "$GOPATH"/bin/v2ray-custom-linux-arm64/{v2ray,v2ctl} -t "$pkgdir"/usr/bin/
|
|
|
|
else
|
|
|
|
install -Dm755 "$GOPATH"/bin/v2ray-custom-linux-arm/{v2ray,v2ctl} -t "$pkgdir"/usr/bin/
|
|
|
|
fi
|
|
|
|
|
|
|
|
install -Dm644 "$srcdir"/v2ray.service "$pkgdir"/usr/lib/systemd/system/v2ray@.service
|
|
|
|
}
|