use %gobuild macro

This commit is contained in:
Alexander Stefanov 2024-08-03 21:42:26 +00:00
parent 20fcd27dd6
commit e74aeb11f9
2 changed files with 12 additions and 3 deletions

View file

@ -3,6 +3,8 @@ Description=Spoof DPI Service
After=network.target
[Service]
# sometimes need to run:
# spoof-dpi --enable-doh --window-size 0
ExecStart=/usr/bin/spoof-dpi
Restart=on-failure

View file

@ -1,10 +1,11 @@
%global oname SpoofDPI
%global debug_package %nil
%global gomodulesmode %nil
Summary: A simple and fast software designed to bypass Deep Packet Inspection
Name: spoofdpi
Version: 0.10.2
Release: 1
Release: 3
License: BSD
Group: Text tools
Url: https://github.com/xvzc/SpoofDPI
@ -26,10 +27,16 @@ A simple and fast software designed to bypass Deep Packet Inspection
%autosetup -p1 -n %{oname}-%{version}
%build
go build -a -v -ldflags="-w -s -X main.VERSION=%{version}" github.com/xvzc/SpoofDPI/cmd/spoof-dpi
mkdir -p src/github.com/xvzc
ln -s ../../../ src/github.com/xvzc/SpoofDPI
export GOPATH=$(pwd):%{gopath}
pushd cmd/spoof-dpi
%gobuild -o ../../bin/spoof-dpi
popd
%install
install -d %{buildroot}/%{_bindir}/
install -m 0755 spoof-dpi %{buildroot}/%{_bindir}/
install -m 0755 bin/spoof-dpi %{buildroot}/%{_bindir}/
install -d %{buildroot}/%{_userunitdir}
install -m 0644 %{S:1} %{buildroot}/%{_userunitdir}