# Generated by go2rpm 1.14.0 %bcond check 1 %bcond bootstrap 0 %if %{with bootstrap} %global debug_package %{nil} %endif %if %{with bootstrap} %global __requires_exclude %{?__requires_exclude:%{__requires_exclude}|}^golang\\(.*\\)$ %endif # The '-z now' flag, which is the opposite of '-z lazy', isn't supported: # https://github.com/NVIDIA/nvidia-container-toolkit/commit/1407ace94ab7c150 # https://github.com/NVIDIA/go-nvml/issues/18 # https://github.com/NVIDIA/nvidia-container-toolkit/issues/49 %global _hardening_ldflags %(echo %_hardening_ldflags | sed 's/-Wl,-z,now//g') # These are the extra external linker flags being used: # https://github.com/NVIDIA/nvidia-container-toolkit/commit/772cf77dcc2347ce # https://github.com/NVIDIA/nvidia-container-toolkit/pull/333 %global __golang_extldflags -Wl,--export-dynamic -Wl,--unresolved-symbols=ignore-in-object-files # https://github.com/NVIDIA/nvidia-container-toolkit %global goipath github.com/NVIDIA/nvidia-container-toolkit Version: 1.16.1 %gometa -L -f %global common_description %{expand: The NVIDIA Container Toolkit allows users to build and run NVIDIA GPU accelerated containers. The toolkit includes a container runtime library and utilities to automatically configure containers to leverage NVIDIA GPUs.} %global golicenses LICENSE Name: %{goname} Release: %autorelease Summary: Build and run containers leveraging NVIDIA GPUs License: Apache-2.0 URL: %{gourl} Source: %{gosource} Provides: nvidia-container-toolkit = %{version}-%{release} %description %{common_description} %gopkg %prep %goprep -A %autopatch -p1 %if %{without bootstrap} %generate_buildrequires %go_generate_buildrequires %endif %if %{without bootstrap} %build # %%goprep calls %%goenv, which sets currentgoldflags to: # -X github.com/NVIDIA/nvidia-container-toolkit/version=1.16.1 # # Unfortunately, this definition is incorrect. So, correct it. %undefine currentgoldflags %define currentgoldflags -X %{goipath}/internal/info.version=%{version} for cmd in cmd/nvidia-cdi-hook cmd/nvidia-ctk ; do %gobuild -o %{gobuilddir}/bin/$(basename $cmd) %{goipath}/$cmd done %endif %install %gopkginstall %if %{without bootstrap} install -m 0755 -vd %{buildroot}%{_bindir} install -m 0755 -vp %{gobuilddir}/bin/* %{buildroot}%{_bindir}/ %endif %if %{without bootstrap} %if %{with check} %check # The cmd/nvidia-container-runtime test fails with: # exec: "nvidia-container-runtime": executable file not found in $PATH # # ... with both the proprietary NVIDIA driver version 555.58.02 and without. # # The internal/system/nvdevices test fails with the proprietary NVIDIA driver # version 555.58.02. # # %%gocheck calls %%goenv, which again sets currentgoldflags incorrectly as # described above. Hopefully, it won't disrupt the tests. %gocheck \ -d cmd/nvidia-container-runtime \ -d internal/system/nvdevices \ %{nil} %endif %endif %if %{without bootstrap} %files %license LICENSE %doc CHANGELOG.md CONTRIBUTING.md DEVELOPMENT.md README.md RELEASE.md %{_bindir}/nvidia-cdi-hook %{_bindir}/nvidia-ctk %endif %gopkgfiles %changelog %autochangelog