%global rel_ver 1.0 %global v2ray_ver 4.13.0 %define debug_package %{nil} Name: v2ray-plugin Version: %{rel_ver} Release: 1%{?dist} Summary: Project V is a set of network tools that help you to build your own computer network Group: Network License: MIT URL: https://github.com/shadowsocks/v2ray-plugin Source0: %{name}-%{version}.tar.gz Source1: v2ray-core-%{v2ray_ver}.tar.gz Source2: ext-%{v2ray_ver}.tar.gz #BuildRequires: go-srpm-macros BuildRequires: git >= 1.8.3.1 BuildRequires: go-compilers-golang-compiler # For v2ray.com/ext #BuildRequires: golang(github.com/gogo/protobuf/proto) #For v2ray.com/core #BuildRequires: golang(github.com/golang/protobuf/proto) #BuildRequires: golang(golang.org/x/net/dns/dnsmessage) #BuildRequires: golang(google.golang.org/grpc) %description Project V is a set of network tools that help you to build your own computer network %prep rm -rf %{name}-%{rel_ver} %setup -q -D -T -c -n %{name}-%{rel_ver} -a 0 -a 1 -a 2 mkdir -p _build/src/v2ray.com export GOPATH=$(pwd)/_build pushd _build go get -v v2ray.com/core go get -v v2ray.com/ext go get -v github.com/gogo/protobuf/proto go get -v golang.org/x/crypto/chacha20poly1305 go get -v golang.org/x/crypto/curve25519 go get -v golang.org/x/crypto/hkdf go get -v golang.org/x/crypto/sha3 go get -v golang.org/x/net/dns/dnsmessage go get -v google.golang.org/grpc popd rm -rf _build/src/v2ray.com/ext rm -rf _build/src/v2ray.com/core mv ext-%{v2ray_ver} _build/src/v2ray.com/ext mv v2ray-core-%{v2ray_ver} _build/src/v2ray.com/core mv %{name}-%{rel_ver} %{name} %build export LDFLAGS="-X main.VERSION=%{rel_ver}" %global goipath shadowsocks %undefine version %gobuildroot export GOPATH=$(pwd)/_build %gobuild -o _bin/v2ray-plugin shadowsocks/v2ray-plugin %install mkdir -p %{buildroot}%{_bindir} install -m 755 _bin/v2ray-plugin %{buildroot}%{_bindir} %files %license %{name}/LICENSE %doc %{name}/README.md %{_bindir}/v2ray-plugin %changelog * Fri Jan 18 2019 Tomas Chang - 1.0-1 - Initial build