%global forgeurl https://github.com/yggdrasil-network/yggdrasil-go %global version 0.5.11 %global commit 9c73bacab90806d913df1ef2b6d79b5ebeb0f98b %global date 20241214 %global debug_package %{nil} %global gomodulesmode GO111MODULE=on %forgemeta Name: yggnet Version: %{forgeversion} Release: %{autorelease} Summary: Yggdrasil overlay network License: LGPL-3.0-only URL: https://yggdrasil-network.github.io/ Source0: %{forgesource} Source1: %{name}.sysusers Source2: %{name}.howto BuildRequires: git-core BuildRequires: golang-bin BuildRequires: go-rpm-macros BuildRequires: systemd-rpm-macros %description Yggdrasil is an overlay mesh network that relies on IPv6. Key features of this network: - Supports large, complex or even Internet-scale topologies. - Responds quickly to connection failures or mobility events. - Provides end-to-end encryption for traffic over the network. - Works entirely ad-hoc by design and completely decentralized. - Supported on Linux, macOS, Windows, Android, iOS and more. %prep %forgesetup sed -i -e 's/yggdrasil/%{name}/' src/config/defaults_linux.go for SVC in yggdrasil yggdrasil-default-config do sed -e '/^Description=/!s/yggdrasil/%{name}/g' \ contrib/systemd/${SVC}.service > ${SVC/yggdrasil/%{name}}.service done %build export GOPROXY="https://proxy.golang.org,direct" export GOFLAGS="-trimpath" export GO_LDFLAGS="-s -w" for CMD in yggdrasil yggdrasilctl do %gobuild -o ${CMD/yggdrasil/%{name}} ./cmd/${CMD} done %install for SVC in %{name} %{name}-default-config do install -p -D -m 644 -t %{buildroot}%{_unitdir} ${SVC}.service done install -p -D -m 644 %{SOURCE1} %{buildroot}%{_sysusersdir}/%{name}.conf install -p -D -m 755 -t %{buildroot}%{_bindir} %{name} %{name}ctl install -p -D -m 644 -t %{buildroot}%{_pkgdocdir} %{SOURCE2} CHANGELOG.md README.md %pre %sysusers_create_package %{name} %SOURCE1 %post %systemd_post %{name}.service %preun %systemd_preun %{name}.service %postun %systemd_postun_with_restart %{name}.service %files %license LICENSE %doc %{_pkgdocdir} %{_sysusersdir}/* %{_unitdir}/* %{_bindir}/*