# Generated by go2rpm 1.8.2 %bcond_without check # https://github.com/nexodus-io/nexodus %global goipath github.com/nexodus-io/nexodus %global commit 4f10b8 # REMOVE BEFORE SUBMITTING THIS FOR REVIEW # --- # New Fedora packages should use %%gometa -f, which makes the package # ExclusiveArch to %%golang_arches_future and thus excludes the package from # %%ix86. If the new package is needed as a dependency for another pacage, # please consider removing that package from %%ix86 in the same way, instead of # building more go packages for i686. If your package is not a leaf package, # you'll need to coordinate the removal of the package's dependents first. # --- # REMOVE BEFORE SUBMITTING THIS FOR REVIEW %if 0%{?fedora} %gometa -f %else %gometa %endif %global common_description %{expand: A prototype of connectivity as a service.} %global golicenses LICENSE %global godocs docs DCO CONTRIBUTING.md README.md Name: nexodus Version: 0 %if 0%{?fedora} Release: %autorelease -p %else Release: 0.1.20240510git4f10b8.fc39 %endif Summary: A prototype of connectivity as a service License: Apache-2.0 URL: %{gourl} # Our custom tarball with vendored deps Source: nexodus-4f10b8.tar.gz #Source: %%{gosource} BuildRequires: systemd-rpm-macros BuildRequires: systemd-units Requires(post): systemd-units Requires(preun): systemd-units Requires(postun): systemd-units Requires: bash-completion Requires: nftables %description %{common_description} %gopkg %prep # -k so vendored deps don't get removed %goprep -k # Using vendored deps in the build instead #%generate_buildrequires #%go_generate_buildrequires %build REQUIRED_GO_VERSION="1.22" GO_VERSION=$(go version | awk '{print $3}' | cut -c 3-) if [[ ! "$GO_VERSION" == $REQUIRED_GO_VERSION* ]]; then v=1.22.1 curl -L https://go.dev/dl/go${v}.linux-amd64.tar.gz -o go${v}.linux-amd64.tar.gz tar -C .. -xzf go${v}.linux-amd64.tar.gz export PATH=/$(pwd)/../go/bin:$PATH fi for cmd in cmd/nexd cmd/nexctl ; do LDFLAGS="$(cat ldflags.txt)" %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 -p -D -m 0644 contrib/rpm/nexodus.service %{buildroot}/usr/lib/systemd/system/nexodus.service install -p -D -m 0644 contrib/rpm/nexodus.sysconfig %{buildroot}%{_sysconfdir}/sysconfig/nexodus for cmd in nexd nexctl ; do install -p -D -m 0644 contrib/man/${cmd}.8.gz %{buildroot}%{_mandir}/man8/${cmd}.8.gz install -p -D -m 0644 contrib/bash_autocomplete %{buildroot}%{_sysconfdir}/bash_completion.d/${cmd} done %files %license LICENSE %doc docs DCO CONTRIBUTING.md README.md %{_bindir}/* /usr/lib/systemd/system/nexodus.service %config(noreplace) %{_sysconfdir}/sysconfig/nexodus %{_mandir}/man8/* %{_sysconfdir}/bash_completion.d/* %gopkgfiles %post %systemd_post nexodus.service %preun %systemd_preun nexodus.service %postun %systemd_postun_with_restart nexodus.service %changelog %if 0%{?fedora} %autochangelog %endif