diff options
| -rw-r--r-- | tunsafe.spec | 25 |
1 files changed, 23 insertions, 2 deletions
diff --git a/tunsafe.spec b/tunsafe.spec index 657337d..d1afa6c 100644 --- a/tunsafe.spec +++ b/tunsafe.spec @@ -10,6 +10,7 @@ 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. @@ -18,17 +19,37 @@ High performance and secure VPN client that uses the WireGuard protocol. %setup -q -n TunSafe-%{commit} %build -sed -i "s|clang++-6.0|clang++ -g $CXXFLAGS|;s|-lrt|-lrt $LDFLAGS|" build_linux.sh +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} +mkdir -p %{buildroot}%{_sysconfdir}/%{name} +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 + +[Install] +WantedBy=multi-user.target +EOF + %files %license LICENSE.AGPL.TXT installer/LICENSE.TXT %doc docs/*txt installer/TunSafe.conf installer/ChangeLog.txt %{_bindir}/%{name} - +%{_sysconfdir}/%{name} +%{_unitdir}/%{name}@.service %changelog |
