%global debug_package %{nil} Name: v2ray Summary: v2ray Golang server/cilent Version: 4.25.0 Release: 2%{?dist} License: MIT Source0: https://codeload.github.com/v2ray/v2ray-core/tar.gz/v%{version} Source1: https://github.com/v2ray/domain-list-community/releases/latest/download/dlc.dat Source2: https://github.com/v2ray/geoip/releases/latest/download/geoip.dat URL: https://github.com/v2ray/v2ray-core # 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. https://www.v2ray.com/ %prep %setup -q -n v2ray-core-%{version} %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 0644 -vp %{_target_platform}/v2ray %{buildroot}%{_libexecdir}/v2ray/ install -m 0644 -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 * 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