%global debug_package %{nil} Name: v2ray Summary: v2ray Golang server/cilent Version: 4.26.0 Release: 1%{?dist} URL: https://github.com/v2ray/v2ray-core License: MIT Source0: %{URL}/archive/v%{version}.tar.gz#/%{name}-v%{version}.tar.gz Source1: https://github.com/v2ray/domain-list-community/releases/latest/download/dlc.dat Source2: https://github.com/v2ray/geoip/releases/latest/download/geoip.dat # BuildRequires: compiler(go-compiler) BuildRequires: git BuildRequires: wget %if 0%{?fedora} > 29 BuildRequires: compiler(go-compiler) BuildRequires: systemd-rpm-macros %else BuildRequires: golang %define _unitdir /usr/lib/systemd/system %endif %define gobuild(o:) %{expand: export LDFLAGS="-s -w" %global _dwz_low_mem_die_limit 0 env CGO_ENABLED=0 CGO_LDFLAGS= go build -tags="rpm_crashtraceback ${BUILDTAGS:-}" -ldflags "${LDFLAGS:-} -B 0x$(head -c20 /dev/urandom|od -An -tx1|tr -d ' \\n')" -a -v -x %{?**}; } %description A platform for building proxies to bypass network restrictions. %prep %setup -q -n %{name}-core-%{version} %if 0%{?fedora} >= 31 sed 's/^Type=simple/#Type=simple/;s/^#Type=exec/Type=exec/' -i release/config/systemd/* %endif sed -i '/^CapabilityBoundingSet/a\Environment=V2RAY_LOCATION_ASSET=%{_datarootdir}/v2ray' release/config/systemd/* sed -i 's|/usr/bin/v2ray/v2ray|%{_libexecdir}/v2ray/v2ray|g' release/config/systemd/* %build export GOPATH=$(pwd)/_build mkdir -p $(pwd)/%{_target_platform} export OUT=$(pwd)/%{_target_platform} sed -i "s/^[ \t]\+codename.\+$/\tcodename = \"Karuboniru\"/;s/^[ \t]\+build.\+$/\tbuild = \"On Copr\"/;" core.go pushd main %gobuild -o $OUT/v2ray popd pushd infra/control/main %gobuild -o $OUT/v2ctl popd %install install -m 0755 -vd %{buildroot}%{_libexecdir}/v2ray/ install -m 0755 -vd %{buildroot}%{_datarootdir}/v2ray/ install -m 0755 -vd %{buildroot}%{_unitdir}/ install -m 0755 -vp %{_target_platform}/v2ray %{buildroot}%{_libexecdir}/v2ray/ install -m 0755 -vp %{_target_platform}/v2ctl %{buildroot}%{_libexecdir}/v2ray/ install -m 0644 -vp release/config/systemd/* %{buildroot}%{_unitdir}/ install -m 0644 -vp %{S:1} %{buildroot}%{_datarootdir}/v2ray/geosite.dat install -m 0644 -vp %{S:2} %{buildroot}%{_datarootdir}/v2ray/geoip.dat %if 0%{?fedora} > 29 %post %systemd_post v2ray*.service %preun %systemd_preun v2ray*.service %postun %systemd_postun_with_restart v2ray*.service %else %post systemctl daemon-reload systemctl try-restart v2ray* %endif %files %defattr(-,root,root,-) %dir %{_libexecdir}/v2ray %dir %{_datarootdir}/v2ray %{_libexecdir}/v2ray/* %{_datarootdir}/v2ray/* %{_unitdir}/%{name}@.service %{_unitdir}/%{name}.service %changelog * Sun Jul 19 2020 Qiyu Yan - 4.26.0-1 - update to 4.26.0 upstream release * Sat Jul 04 2020 Qiyu Yan - 4.25.1-2 - Fix unit files * Mon Jun 29 2020 Qiyu Yan - 4.25.1-1 - Update to 4.25.1 upstream release * Mon Jun 29 2020 Qiyu Yan - 4.25.0-3 - Use upstream Unit files * Tue Jun 23 2020 Qiyu Yan - 4.25.0-2 - update unit files * Sat Jun 20 2020 Qiyu Yan - 4.25.0-1 - update to 4.25.0 upstream * Fri Jun 12 2020 Qiyu Yan - 4.24.2-2 - Rebuilt