diff --git a/libnvidia-container-1.13.1.tar.gz b/libnvidia-container-1.13.1.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..2e7adbfd4fe6ea002b01dfd03dd0b001a5e4e1cb Binary files /dev/null and b/libnvidia-container-1.13.1.tar.gz differ diff --git a/libnvidia-container-fix-makefile.patch b/libnvidia-container-fix-makefile.patch new file mode 100644 index 0000000000000000000000000000000000000000..3965bd5a972513b615b31f39e89d2d3601f7ff93 --- /dev/null +++ b/libnvidia-container-fix-makefile.patch @@ -0,0 +1,14 @@ +Index: libnvidia-container-1.13.1/Makefile +=================================================================== +--- libnvidia-container-1.13.1.orig/Makefile ++++ libnvidia-container-1.13.1/Makefile +@@ -143,6 +143,9 @@ ifeq ($(WITH_TIRPC), yes) + LIB_CPPFLAGS += -isystem $(DEPS_DIR)$(includedir)/tirpc -DWITH_TIRPC + LIB_LDLIBS_STATIC += -l:libtirpc.a + LIB_LDLIBS_SHARED += -lpthread ++else ++CPPFLAGS += -I/usr/include/tirpc ++LIB_LDLIBS_SHARED += -lpthread -ltirpc + endif + ifeq ($(WITH_SECCOMP), yes) + LIB_CPPFLAGS += -DWITH_SECCOMP $(shell pkg-config --cflags libseccomp) diff --git a/libnvidia-container.spec b/libnvidia-container.spec new file mode 100644 index 0000000000000000000000000000000000000000..e49d333553c987202a98a2c31cdb57f3cc2242f6 --- /dev/null +++ b/libnvidia-container.spec @@ -0,0 +1,119 @@ +%define anolis_release 1 +%define debug_package %{nil} +%define _major 1 +%define modprobe_version 495.44 + +Name: libnvidia-container +Version: 1.13.1 +Release: %{anolis_release}%{?dist} +Summary: NVIDIA Container Toolkit + +License: BSD-3-Clause AND Apache-2.0 AND GPL-3.0-or-later AND LGPL-3.0-or-later AND MIT AND GPL-2.0-only +URL: https://github.com/NVIDIA/libnvidia-container +Source0: libnvidia-container-1.13.1.tar.gz +Source1: nvidia-modprobe-495.44.tar.gz +Patch0: libnvidia-container-fix-makefile.patch + +BuildRequires: make +BuildRequires: gcc +BuildRequires: golang +BuildRequires: rpcgen +BuildRequires: libcap-devel elfutils-libelf-devel libseccomp-devel libtirpc-devel + +%description +The nvidia-container library provides an interface to configure GNU/Linux +containers leveraging NVIDIA hardware. The implementation relies on several +kernel subsystems and is designed to be agnostic of the container runtime. + +%package -n %{name}%{_major} +Summary: NVIDIA container runtime library +%description -n %{name}%{_major} +The nvidia-container library provides an interface to configure GNU/Linux +containers leveraging NVIDIA hardware. The implementation relies on several +kernel subsystems and is designed to be agnostic of the container runtime. + +This package requires the NVIDIA driver (>= 340.29) to be installed separately. + +%package devel +Requires: %{name}%{_major} = %{version}-%{release} +Summary: NVIDIA container runtime library (development files) +%description devel +The nvidia-container library provides an interface to configure GNU/Linux +containers leveraging NVIDIA hardware. The implementation relies on several +kernel subsystems and is designed to be agnostic of the container runtime. + +%package static +Requires: %{name}-devel = %{version}-%{release} +Summary: NVIDIA container runtime library (static library) +%description static +The nvidia-container library provides an interface to configure GNU/Linux +containers leveraging NVIDIA hardware. The implementation relies on several +kernel subsystems and is designed to be agnostic of the container runtime. + +This package requires the NVIDIA driver (>= 340.29) to be installed separately. + +%package -n %{name}%{_major}-debuginfo +Requires: %{name}%{_major} = %{version}-%{release} +Summary: NVIDIA container runtime library (debugging symbols) +%description -n %{name}%{_major}-debuginfo +The nvidia-container library provides an interface to configure GNU/Linux +containers leveraging NVIDIA hardware. The implementation relies on several +kernel subsystems and is designed to be agnostic of the container runtime. + +This package contains the debugging symbols for the library. + + +%package tools +Requires: %{name}%{_major} >= %{version}-%{release} +Summary: NVIDIA container runtime library (command-line tools) +%description tools +The nvidia-container library provides an interface to configure GNU/Linux +containers leveraging NVIDIA hardware. The implementation relies on several +kernel subsystems and is designed to be agnostic of the container runtime. + +This package contains command-line tools that facilitate using the library. + + +%prep +%autosetup + +%build +# add nvidia-modprobe for deps +mkdir -p deps/src/nvidia-modprobe-%{modprobe_version} +tar -v -C deps/src/nvidia-modprobe-%{modprobe_version} --strip-components=1 -xz nvidia-modprobe-%{modprobe_version}/modprobe-utils -f %{SOURCE1} +patch -d deps/src/nvidia-modprobe-%{modprobe_version} -p1 < mk/nvidia-modprobe.patch +touch deps/src/nvidia-modprobe-%{modprobe_version}/.download_stamp + +%make_build REVISION=%{version} WITH_LIBELF=yes + +%install +DESTDIR=%{buildroot} %{__make} install prefix=%{_prefix} exec_prefix=%{_exec_prefix} bindir=%{_bindir} libdir=%{_libdir} includedir=%{_includedir} docdir=%{_licensedir} REVISION=%{version} WITH_LIBELF=yes + +%post -n %{name}%{_major} -p /sbin/ldconfig +%postun -n %{name}%{_major} -p /sbin/ldconfig + +%files -n %{name}%{_major} +%license %{_licensedir}/* +%{_libdir}/lib*.so.* + +%files devel +%license %{_licensedir}/* +%{_includedir}/*.h +%{_libdir}/lib*.so +%{_libdir}/pkgconfig/*.pc + +%files static +%license %{_licensedir}/* +%{_libdir}/lib*.a + +%files -n %{name}%{_major}-debuginfo +%license %{_licensedir}/* +%{_prefix}/lib/debug%{_libdir}/lib*.so.* + +%files tools +%license %{_licensedir}/* +%{_bindir}/* + +%changelog +* Thu Jun 1 2023 forrest_ly - 1.13.1-1 +- Add libnvidia-container diff --git a/nvidia-modprobe-495.44.tar.gz b/nvidia-modprobe-495.44.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..462da37bf1689d4b0bc97448159048451e54f96e Binary files /dev/null and b/nvidia-modprobe-495.44.tar.gz differ