%global commit 85a871c1d226956df7c1308a1e5527556fe35fe1 Name: tunsafe Version: 1.5rc2 Release: 1%{?dist} Summary: WireGuard VPN client License: AGPL-1.0 AND BSD-3-Clause AND OpenSSL URL: https://github.com/TunSafe/TunSafe Source0: https://github.com/TunSafe/TunSafe/archive/%{commit}.tar.gz BuildRequires: clang BuildRequires: systemd %description High performance and secure VPN client that uses the WireGuard protocol. %prep %setup -q -n TunSafe-%{commit} %build sed -i "s|clang++-6.0|clang++ -g %{optflags}|;s|-lrt|-lrt %{build_ldflags}|" build_linux.sh make %install install -Dm755 %{name} %{buildroot}/%{_bindir}/%{name} install -Dm644 installer/TunSafe.conf %{buildroot}%{_sysconfdir}/%{name}/%{name}.conf mkdir -p %{buildroot}%{_unitdir} cat > %{buildroot}%{_unitdir}/tunsafe@.service << 'EOF' [Unit] Description=TunSafe VPN (%i) After=network-online.target Wants=network-online.target [Service] Type=simple ExecStart=/usr/bin/tunsafe start -n %i /etc/tunsafe/%i.conf ExecStop=/usr/bin/tunsafe stop %i Restart=on-failure RestartSec=5 CapabilityBoundingSet=CAP_NET_ADMIN CAP_NET_BIND_SERVICE AmbientCapabilities=CAP_NET_ADMIN CAP_NET_BIND_SERVICE [Install] WantedBy=multi-user.target EOF %files %license LICENSE.AGPL.TXT installer/LICENSE.TXT %doc docs/*txt installer/ChangeLog.txt TunSafe.conf %dir %{_sysconfdir}/%{name} %config(noreplace) %{_sysconfdir}/%{name}/%{name}.conf %{_bindir}/%{name} %{_unitdir}/%{name}@.service %changelog