Name: v2ray Summary: v2ray Golang server/client Version: 4.23.2 Release: 1%{?dist} License: MIT Source0: https://codeload.github.com/v2ray/v2ray-core/tar.gz/v%{version} URL: https://github.com/v2ray/v2ray-core %if 0%{?fedora} > 29 BuildRequires: compiler(go-compiler) BuildRequires: systemd-rpm-macros %else BuildRequires: golang %define _unitdir /usr/lib/systemd/system %define gobuild(o:) %{expand: # https://bugzilla.redhat.com/show_bug.cgi?id=995136#c12 %global _dwz_low_mem_die_limit 0 %ifnarch ppc64 go build -buildmode pie -compiler gc -tags="rpm_crashtraceback ${BUILDTAGS:-}" -ldflags "${LDFLAGS:-} -B 0x$(head -c20 /dev/urandom|od -An -tx1|tr -d ' \\n') -extldflags '%__global_ldflags %{?__golang_extldflags}'" -a -v -x %{?**}; %else go build -compiler gc -tags="rpm_crashtraceback ${BUILDTAGS:-}" -ldflags "${LDFLAGS:-} -B 0x$(head -c20 /dev/urandom|od -An -tx1|tr -d ' \\n') -extldflags '%__global_ldflags %{?__golang_extldflags}'" -a -v -x %{?**}; %endif } %endif BuildRequires: git BuildRequires: wget %description A platform for building proxies to bypass network restrictions. https://www.v2ray.com/ %prep %setup -q -n v2ray-core-%{version} cd .. mkdir -p v2 pushd v2 export GOPATH=%{_builddir}/v2 go get -insecure -v -t v2ray.com/core/... rm -rf src/v2ray.com/core ln ../../../v2ray-core-%{version} -s src/v2ray.com/core %build export GOPATH=%{_builddir}/v2 CGO_ENABLED=0 export CGO_ENABLED pushd $GOPATH/src/v2ray.com/core echo ">>> Update source code name ..." sed -i "s/^[ \t]\+codename.\+$/\tcodename = \"Karuboniru\"/;s/^[ \t]\+build.\+$/\tbuild = \"On Copr\"/;" core.go echo ">>> Compile v2ray ..." pushd $GOPATH/src/v2ray.com/core/main mkdir -p %{buildroot}%{_libexecdir}/v2ray %gobuild -o %{buildroot}%{_libexecdir}/v2ray/v2ray strip --strip-all %{buildroot}%{_libexecdir}/v2ray/v2ray popd popd pushd $GOPATH/src/v2ray.com/core/infra/control/main %gobuild -o %{buildroot}%{_libexecdir}/v2ray/v2ctl strip --strip-all %{buildroot}%{_libexecdir}/v2ray/v2ctl popd mkdir -p %{buildroot}%{_datarootdir}/v2ray wget -qO - https://api.github.com/repos/v2ray/geoip/releases/latest \ | grep browser_download_url | cut -d '"' -f 4 \ | wget -i - -O %{buildroot}%{_datarootdir}/v2ray/geoip.dat wget -qO - https://api.github.com/repos/v2ray/domain-list-community/releases/latest \ | grep browser_download_url | cut -d '"' -f 4 \ | wget -i - -O %{buildroot}%{_datarootdir}/v2ray/geosite.dat mkdir -p %{buildroot}%{_unitdir} cat > %{buildroot}%{_unitdir}/%{name}@.service < %{buildroot}%{_unitdir}/%{name}.service < - 4.21.3-9 - rebuilt * Fri Nov 08 2019 Qiyu Yan - 4.21.3-7 - rebuilt * Thu Nov 07 2019 Qiyu Yan - 4.21.3-6 - update post-install script * Thu Nov 07 2019 Qiyu Yan - 4.21.3-5 - rebuilt * Thu Nov 07 2019 Qiyu Yan - 4.21.3-3 - Ready to use