File nvidia-modprobe.spec of Package nvidia-modprobe
#
# spec file for package nvidia-modprobe
#
# 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: nvidia-modprobe
Version: 575.64.03
Release: 0
Summary: NVIDIA kernel module loader
License: GPL-2.0-or-later
URL: http://www.nvidia.com/object/unix.html
ExclusiveArch: x86_64 aarch64
Source0: https://download.nvidia.com/XFree86/%{name}/%{name}-%{version}.tar.bz2
Source1: nvidia-modprobe.rpmlintrc
Patch0: %{name}-man-page-permissions.patch
Patch2: https://github.com/NVIDIA/nvidia-modprobe/pull/3.patch#/reproducible.patch
BuildRequires: gcc
BuildRequires: m4
Requires(post): permissions
Requires(verify): permissions
%description
This utility is used by user-space NVIDIA driver components to make sure the
NVIDIA kernel modules are loaded and that the NVIDIA character device files are
present.
%prep
%autosetup -p1
# Remove additional CFLAGS added when enabling DEBUG
sed -i '/+= -O0 -g/d' utils.mk
%build
export CFLAGS="%{optflags}"
export LDFLAGS="%{?__global_ldflags}"
%make_build \
DEBUG=1 \
NV_VERBOSE=1 \
PREFIX=%{_prefix} \
STRIP_CMD=true \
MANPAGE_GZIP=0
%install
%make_install \
NV_VERBOSE=1 \
PREFIX=%{_prefix} \
STRIP_CMD=true \
MANPAGE_GZIP=0
%if 0%{?suse_version} < 1600
mkdir -p $RPM_BUILD_ROOT/etc/permissions.d
cat > $RPM_BUILD_ROOT/etc/permissions.d/%{name} << EOF
# nvidia-modprobe (bsc#1230950)
/usr/bin/nvidia-modprobe root:root 4755
EOF
%endif
%verifyscript
%verify_permissions -e /usr/bin/nvidia-modprobe
%post
%set_permissions /usr/bin/nvidia-modprobe
%files
%license COPYING
%if 0%{?suse_version} < 1600
/etc/permissions.d/%{name}
%endif
%attr(4755, root, root) %{_bindir}/%{name}
%{_mandir}/man1/%{name}.1%{?ext_man}
%changelog