File go-l2tp.spec of Package go-l2tp

#
# spec file for package go-l2tp
#
# Copyright (c) 2022, Martin Hauke <mardnh@gmx.de>
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via https://bugs.opensuse.org/
#


Name:           go-l2tp
Version:        0~git20201125
Release:        0
Summary:        Modern L2TP tools
License:        MIT
Group:          Productivity/Networking/Other
#Git-Clone:     https://github.com/katalix/go-l2tp.git
URL:            https://github.com/katalix/go-l2tp
Source:         %{name}-%{version}.tar.xz
Source1:        vendor.tar.gz
BuildRequires:  go1.18
BuildRequires:  golang-packaging
%{go_provides}

%description
Modern L2TP tools.

* ql2tpd
A minimal daemon for creating static L2TPv3 sessions.

* kl2tpd
A client/LAC-mode daemon for creating L2TPv2 sessions.
It spawns the standard Linux pppd for PPP protocol support.

- kpppoed
A PPPoE daemon for creating L2TPv2 Access Concentrator sessions
in response to PPPoE requests. It spawns kl2tpd for L2TP protocol
support.

%prep
%autosetup -a 1

%build
for f in kl2tpd kpppoed ql2tpd; do
  go build \
  -mod=vendor \
  -buildmode=pie \
  -o "$f" "./cmd/$f"
done

# create documentation
for f in kl2tpd kpppoed ql2tpd; do
  go doc "./cmd/$f" > "README.$f"
done

### TODO
#go doc l2tp
#go doc pppoe
#go doc config

%install
for f in kl2tpd kpppoed ql2tpd; do
  install -D -m0755 "$f" "%{buildroot}%{_sbindir}/$f"
  install -d "%{buildroot}%{_sysconfdir}/$f"
  touch "%{buildroot}%{_sysconfdir}/$f/$f.toml"
done


%files
%license LICENSE
%doc README.md README.*
%dir %{_sysconfdir}/kl2tpd
%config %{_sysconfdir}/kl2tpd/kl2tpd.toml
%dir %{_sysconfdir}/kpppoed
%config %{_sysconfdir}/kpppoed/kpppoed.toml
%dir %{_sysconfdir}/ql2tpd
%config %{_sysconfdir}/ql2tpd/ql2tpd.toml
%{_sbindir}/kl2tpd
%{_sbindir}/kpppoed
%{_sbindir}/ql2tpd

%changelog
openSUSE Build Service is sponsored by