84 lines
1.9 KiB
RPMSpec
84 lines
1.9 KiB
RPMSpec
# Generated by go2rpm 1.6.0
|
|
%bcond_without check
|
|
|
|
# https://github.com/slackhq/nebula
|
|
%global goipath github.com/slackhq/nebula
|
|
Version: 1.7.2
|
|
|
|
%gometa -f
|
|
|
|
%global goname nebula
|
|
|
|
%global common_description %{expand:
|
|
A scalable overlay networking tool with a focus on performance, simplicity and
|
|
security.}
|
|
|
|
%global golicenses LICENSE
|
|
%global godocs examples AUTHORS README.md CHANGELOG.md
|
|
|
|
Name: %{goname}
|
|
Release: %autorelease
|
|
Summary: A scalable overlay networking tool with a focus on performance, simplicity and security
|
|
|
|
License: MIT
|
|
URL: %{gourl}
|
|
Source0: %{gosource}
|
|
Source1: nebula.service
|
|
|
|
BuildRequires: systemd-rpm-macros
|
|
|
|
# Let's be sure that people do not upgrade from the "old" nebula. We can sensibly drop it by F39
|
|
Conflicts: nebula < 1.0
|
|
|
|
%description
|
|
%{common_description}
|
|
|
|
%gopkg
|
|
|
|
%prep
|
|
%goprep
|
|
|
|
%generate_buildrequires
|
|
%go_generate_buildrequires
|
|
|
|
%build
|
|
export LDFLAGS="-X main.Build=%{version}-Fedora $(LDFLAGS)"
|
|
for cmd in cmd/* ; do
|
|
%gobuild -o %{gobuilddir}/bin/$(basename $cmd) %{goipath}/$cmd
|
|
done
|
|
|
|
%install
|
|
%gopkginstall
|
|
install -m 0755 -vd %{buildroot}%{_bindir}
|
|
install -m 0755 -vp %{gobuilddir}/bin/* %{buildroot}%{_bindir}/
|
|
install -m 0755 -vd %{buildroot}%{_sysconfdir}/%{name}
|
|
install -m 0640 -vp examples/config.yml %{buildroot}%{_sysconfdir}/%{name}
|
|
install -m 0644 -vDp %{SOURCE1} %{buildroot}%{_unitdir}/%{name}.service
|
|
|
|
%if %{with check}
|
|
%check
|
|
%gocheck
|
|
%endif
|
|
|
|
%post
|
|
%systemd_post nebula.service
|
|
|
|
%preun
|
|
%systemd_preun nebula.service
|
|
|
|
%postun
|
|
%systemd_postun_with_restart nebula.service
|
|
|
|
%files
|
|
%license LICENSE
|
|
%dir %{_sysconfdir}/%{name}
|
|
%config(noreplace) %{_sysconfdir}/%{name}/config.yml
|
|
%doc examples AUTHORS README.md CHANGELOG.md
|
|
%{_bindir}/*
|
|
%{_unitdir}/%{name}.service
|
|
|
|
%gopkgfiles
|
|
|
|
%changelog
|
|
%autochangelog
|