nebula/nebula.spec

105 lines
2.6 KiB
RPMSpec
Raw Permalink Normal View History

2022-06-03 17:54:17 +00:00
# Generated by go2rpm 1.6.0
%bcond_without check
2022-06-03 17:54:17 +00:00
# https://github.com/slackhq/nebula
%global goipath github.com/slackhq/nebula
2022-10-10 12:58:02 +00:00
Version: 1.6.1
2022-06-03 17:54:17 +00:00
%gometa
%global goname nebula
2022-06-03 17:54:17 +00:00
%global common_description %{expand:
A scalable overlay networking tool with a focus on performance, simplicity and
security.}
2022-06-03 17:54:17 +00:00
%global golicenses LICENSE
%global godocs examples AUTHORS README.md CHANGELOG.md
2022-06-03 17:54:17 +00:00
Name: %{goname}
Release: %autorelease
Summary: A scalable overlay networking tool with a focus on performance, simplicity and security
2022-06-03 17:54:17 +00:00
License: MIT
URL: %{gourl}
Source0: %{gosource}
2023-08-21 21:52:01 +00:00
Source1: %{name}-vendor-%{version}.tar.gz
2022-06-03 17:54:17 +00:00
BuildRequires: systemd-rpm-macros
2023-08-21 21:52:01 +00:00
BuildRequires: go-rpm-macros
BuildRequires: compiler(go-compiler)
2022-06-04 06:57:48 +00:00
# Let's be sure that people do not upgrade from the "old" nebula. We can sensibly drop it by F39
Conflicts: nebula < 1.0
2022-06-03 17:54:17 +00:00
%description
%{common_description}
2022-06-03 17:54:17 +00:00
%gopkg
2022-06-03 17:54:17 +00:00
%prep
2023-08-21 21:52:01 +00:00
%if 0%{?fedora}
2022-06-03 17:54:17 +00:00
%goprep
# https://github.com/slackhq/nebula/pull/791
sed -i 's/\(Wants=.*\)$/\1 nss-lookup.target time-sync.target/' dist/fedora/nebula.service
2022-06-03 17:54:17 +00:00
%generate_buildrequires
%go_generate_buildrequires
2023-08-21 21:52:01 +00:00
%else
%autosetup -a 1
mkdir -p %{_builddir}/src/github.com/slackhq/
cp -r %{_builddir}/%{name}-%{version} %{_builddir}/src/github.com/slackhq/%{name}
mkdir -p %{_builddir}/%{name}-%{version}/_build/src/github.com/slackhq/nebula
mv %{_builddir}/src %{_builddir}/%{name}-%{version}/_build/src
%endif
2022-06-03 17:54:17 +00:00
%build
export LDFLAGS="-X main.Build=%{version}-Fedora $(LDFLAGS)"
2023-08-21 21:52:01 +00:00
%if 0%{?fedora}
2022-06-03 17:54:17 +00:00
for cmd in cmd/* ; do
%gobuild -o %{gobuilddir}/bin/$(basename $cmd) %{goipath}/$cmd
done
2023-08-21 21:52:01 +00:00
%else
export GOPATH="%{_builddir}/%{name}-%{version}/_build"
pushd $GOPATH/src/github.com/slackhq/nebula
go generate
popd
for cmd in cmd/* ; do
%gobuild -o bin/$(basename $cmd) %{goipath}/$cmd
done
%endif
2022-06-03 17:54:17 +00:00
%install
%gopkginstall
install -m 0755 -vd %{buildroot}%{_bindir}
2023-08-21 21:52:01 +00:00
install -m 0755 -vp bin/* %{buildroot}%{_bindir}/
2022-06-03 17:54:17 +00:00
install -m 0755 -vd %{buildroot}%{_sysconfdir}/%{name}
install -m 0640 -vp examples/config.yml %{buildroot}%{_sysconfdir}/%{name}
install -m 0644 -vDp dist/fedora/nebula.service %{buildroot}%{_unitdir}/%{name}.service
2022-06-03 17:54:17 +00:00
%if %{with check}
%check
%gocheck
%endif
2022-06-03 17:54:17 +00:00
%post
%systemd_post nebula.service
2022-06-03 17:54:17 +00:00
%preun
%systemd_preun nebula.service
2022-06-03 17:54:17 +00:00
%postun
%systemd_postun_with_restart nebula.service
2022-06-03 17:54:17 +00:00
%files
%license LICENSE
%dir %{_sysconfdir}/%{name}
%config(noreplace) %{_sysconfdir}/%{name}/config.yml
%doc examples AUTHORS README.md CHANGELOG.md
%{_bindir}/*
%{_unitdir}/%{name}.service
2022-06-03 17:54:17 +00:00
%gopkgfiles
2022-06-03 17:54:17 +00:00
%changelog
%autochangelog