%global forgeurl https://github.com/Jigsaw-Code/outline-ss-server %global version 1.7.3 %global commit ff61c9feef7a2073d28945fc714bf8d1f3daf1af %global date 20241119 %global debug_package %{nil} %global gomodulesmode GO111MODULE=on %forgemeta Name: outline-server Version: %{forgeversion} Release: %{autorelease} Summary: Outline VPN server License: Apache-2.0 URL: %{forgeurl} Source0: %{forgesource} Source1: %{name}@.service Source2: %{name}.howto BuildRequires: git-core BuildRequires: golang-bin BuildRequires: go-rpm-macros BuildRequires: systemd-rpm-macros %description Outline VPN server that relies on Shadowsocks. %prep %forgesetup %build export GOPROXY="https://proxy.golang.org,direct" export GOFLAGS="-trimpath" export GO_LDFLAGS="-s -w" %gobuild -o %{name} ./cmd/outline-ss-server %install install -p -d -m 700 %{buildroot}%{_sysconfdir}/outline/server install -p -D -m 644 -t %{buildroot}%{_unitdir} %{SOURCE1} install -p -D -m 755 -t %{buildroot}%{_bindir} %{name} install -p -D -m 644 -t %{buildroot}%{_pkgdocdir} %{SOURCE2} \ README.md cmd/outline-ss-server/config_example.yml %post for UNIT in $(systemctl -P Id show %{name}@\*.service) do %systemd_post ${UNIT} done %preun for UNIT in $(systemctl -P Id show %{name}@\*.service) do %systemd_preun ${UNIT} done %postun for UNIT in $(systemctl -P Id show %{name}@\*.service) do %systemd_postun_with_restart ${UNIT} done %files %license LICENSE %doc %{_pkgdocdir} %{_sysconfdir}/* %{_unitdir}/* %{_bindir}/*