File sriov-network-device-plugin.spec of Package sriov-network-device-plugin
#
# spec file for package sriov-network-device-plugin
#
# Copyright (c) 2025 SUSE LLC
#
# 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: sriov-network-device-plugin
Version: 0
Release: 0
Summary: Kubernetes device plugin for discovering and advertising SR-IOV available resources in the host
License: Apache-2.0
URL: https://github.com/k8snetworkplumbingwg/sriov-network-device-plugin
Source: %{name}-%{version}.tar
Source1: vendor.tar.gz
BuildRequires: golang(API) = 1.23
ExcludeArch: s390
ExcludeArch: %{ix86}
%description
The SR-IOV Network Device Plugin is a Kubernetes device plugin for discovering and advertising networking resources in the form of
(i) SR-IOV virtual functions [VFs], (ii) PCI physical functions [PFs] and (iii) Auxiliary network devices (in particular Subfunctions [SFs])
which are available on a Kubernetes host.
To deploy workloads with SR-IOV resources this plugin needs to work together a CNI meta plugin supporting Device Plugin based network
provisioning (e.g., Multus CNI) and a CNI capable of consuming the SR-IOV network device allocated to the Pod (e.g., sriov-cni).
List of supported SR-IOV devices (not limited to NICs): https://github.com/k8snetworkplumbingwg/sriov-network-device-plugin/blob/main/README.md
(select the right version/tag)
%prep
%autosetup -a1 -n %{name}-%{version} -p1
%build
# Following go-build settings have been taken from upstream Makefile (for the STATIC option, the one set by rancher/ecm hardened
# image used as baseline: https://github.com/rancher/image-build-sriov-network-device-plugin/blob/v3.9.0-build20250425/Dockerfile#L18 )
#
# - CGO being disabled:
%define cgoenabled "0"
# - go-build constrain (aka tag) "no_openssl" being set:
%define buildgotags "no_openssl"
# - go-build to invoke external linker (i.e., gcc's ld) to which "static" option is bein passed
%define buildldflags "-extldflags \"-static\""
# - force rebuilding of packages that are already up-to-date
#define buildgoflags "-a"
CGO_ENABLED=%{cgoenabled} go build -mod=vendor -buildmode=pie -ldflags %{buildldflags} ${buildgoflags} -tags %{buildgotags} -o sriovdp ./cmd/sriovdp
%install
install -D -m0755 sriovdp %{buildroot}%{_bindir}/sriovdp
install -D -m0755 images/entrypoint.sh %{buildroot}/entrypoint.sh
%files
%license LICENSE
%doc README.md
%{_bindir}/sriovdp
/entrypoint.sh
%changelog