]> git.pld-linux.org Git - packages/xorg-driver-video-nvidia.git/blobdiff - xorg-driver-video-nvidia.spec
- drop non-dist kernel support
[packages/xorg-driver-video-nvidia.git] / xorg-driver-video-nvidia.spec
index 74665c12514c3b8b681ba2607fd5451aa0b88243..7b39ce5d6bb0b1fe91f2243be4d463fc62f6ec10 100644 (file)
@@ -1,43 +1,61 @@
 # TODO
 # - should -libs Require main package?
 # - drop binary-only nvidia-settings from here, and use nvidia-settings.spec for it?
+# - kernel-drm is required on never kernels. driver for kernel-longterm not requires drm
 #
 # Conditional build:
-%bcond_without dist_kernel     # without distribution kernel
 %bcond_without kernel          # without kernel packages
 %bcond_without userspace       # don't build userspace programs
-%bcond_with    force_userspace # force userspace build (useful if alt_kernel is set)
 %bcond_with    settings        # package nvidia-settings here (GPL version of same packaged from nvidia-settings.spec)
 %bcond_with    verbose         # verbose build (V=1)
 
+# The goal here is to have main, userspace, package built once with
+# simple release number, and only rebuild kernel packages with kernel
+# version as part of release number, without the need to bump release
+# with every kernel change.
+%if 0%{?_pld_builder:1} && %{with kernel} && %{with userspace}
+%{error:kernel and userspace cannot be built at the same time on PLD builders}
+exit 1
+%endif
+
 %if "%{_alt_kernel}" != "%{nil}"
-%undefine      with_userspace
+%if 0%{?build_kernels:1}
+%{error:alt_kernel and build_kernels are mutually exclusive}
+exit 1
 %endif
-%if %{with force_userspace}
-%define                with_userspace 1
+%undefine      with_userspace
+%global                _build_kernels          %{alt_kernel}
+%else
+%global                _build_kernels          %{?build_kernels:,%{?build_kernels}}
 %endif
+
 %if %{without userspace}
 # nothing to be placed to debuginfo package
 %define                _enable_debug_packages  0
 %endif
+
 %define                no_install_post_check_so 1
 
-%define                rel 2
+%define                kbrs    %(echo %{_build_kernels} | tr , '\\n' | while read n ; do echo %%undefine alt_kernel ; [ -z "$n" ] || echo %%define alt_kernel $n ; echo "BuildRequires:kernel%%{_alt_kernel}-module-build >= 3:2.6.20.2" ; done)
+%define                kpkg    %(echo %{_build_kernels} | tr , '\\n' | while read n ; do echo %%undefine alt_kernel ; [ -z "$n" ] || echo %%define alt_kernel $n ; echo %%kernel_pkg ; done)
+%define                bkpkg   %(echo %{_build_kernels} | tr , '\\n' | while read n ; do echo %%undefine alt_kernel ; [ -z "$n" ] || echo %%define alt_kernel $n ; echo %%build_kernel_pkg ; done)
+
+%define                rel     1
 %define                pname   xorg-driver-video-nvidia
 Summary:       Linux Drivers for nVidia GeForce/Quadro Chips
 Summary(hu.UTF-8):     Linux meghajtók nVidia GeForce/Quadro chipekhez
 Summary(pl.UTF-8):     Sterowniki do kart graficznych nVidia GeForce/Quadro
-Name:          %{pname}%{_alt_kernel}
+Name:          %{pname}%{?_pld_builder:%{?with_kernel:-kernel}}%{_alt_kernel}
 # when updating version here, keep nvidia-settings.spec in sync as well
-Version:       313.30
-Release:       %{rel}
+Version:       346.35
+Release:       %{rel}%{?_pld_builder:%{?with_kernel:@%{_kernel_ver_str}}}
 Epoch:         1
 License:       nVidia Binary
 Group:         X11
 Source0:       http://us.download.nvidia.com/XFree86/Linux-x86/%{version}/NVIDIA-Linux-x86-%{version}.run
-# Source0-md5: 69c0f66c9246217a4fe4d28e95bb7bb6
+# Source0-md5: d2b8f7f90ef5037f03f94519f9809511
 Source1:       http://us.download.nvidia.com/XFree86/Linux-x86_64/%{version}/NVIDIA-Linux-x86_64-%{version}-no-compat32.run
-# Source1-md5: e5f147fbcdcad71472b4ddeccf259bd7
+# Source1-md5: 9ca9f07f91361362f304ca8317ddd453
 Source2:       %{pname}-xinitrc.sh
 Source3:       gl.pc.in
 Source4:       10-nvidia.conf
@@ -45,17 +63,16 @@ Source5:    10-nvidia-modules.conf
 Patch0:                X11-driver-nvidia-GL.patch
 Patch1:                X11-driver-nvidia-desktop.patch
 URL:           http://www.nvidia.com/object/unix.html
-%if %{with kernel}
-%{?with_dist_kernel:BuildRequires:     kernel%{_alt_kernel}-module-build >= 3:2.6.20.2}
-%endif
-BuildRequires: %{kgcc_package}
-BuildRequires: rpmbuild(macros) >= 1.379
+BuildRequires: rpmbuild(macros) >= 1.679
+%{?with_kernel:%{expand:%kbrs}}
 BuildRequires: sed >= 4.0
 BuildConflicts:        XFree86-nvidia
 Requires:      %{pname}-libs = %{epoch}:%{version}-%{rel}
 Requires:      xorg-xserver-server
-Requires:      xorg-xserver-server(videodrv-abi) <= 14.1
+Requires:      xorg-xserver-server(videodrv-abi) <= 19.0
 Requires:      xorg-xserver-server(videodrv-abi) >= 2.0
+Provides:      ocl-icd(nvidia)
+Provides:      ocl-icd-driver
 Provides:      xorg-driver-video
 Provides:      xorg-xserver-module(glx)
 Obsoletes:     XFree86-driver-nvidia
@@ -109,7 +126,7 @@ Summary(pl.UTF-8):  Biblioteki OpenGL (GL i GLX) Nvidia
 Group:         X11/Development/Libraries
 Requires(post,postun): /sbin/ldconfig
 Requires:      libvdpau >= 0.3
-Provides:      OpenGL = 2.1
+Provides:      OpenGL = 3.3
 Provides:      OpenGL-GLX = 1.4
 Obsoletes:     X11-OpenGL-core < 1:7.0.0
 Obsoletes:     X11-OpenGL-libGL < 1:7.0.0
@@ -172,32 +189,67 @@ Eszközök az nVidia grafikus kártyák beállításához.
 %description progs -l pl.UTF-8
 Narzędzia do zarządzania kartami graficznymi nVidia.
 
-%package -n kernel%{_alt_kernel}-video-nvidia
-Summary:       nVidia kernel module for nVidia Architecture support
-Summary(de.UTF-8):     Das nVidia-Kern-Modul für die nVidia-Architektur-Unterstützung
-Summary(hu.UTF-8):     nVidia Architektúra támogatás Linux kernelhez.
-Summary(pl.UTF-8):     Moduł jądra dla obsługi kart graficznych nVidia
-Release:       %{rel}@%{_kernel_ver_str}
-Group:         Base/Kernel
-Requires(post,postun): /sbin/depmod
-Requires:      dev >= 2.7.7-10
-%{?with_dist_kernel:%requires_releq_kernel}
-Requires:      %{pname} = %{epoch}:%{version}
-Provides:      X11-driver-nvidia(kernel)
-Obsoletes:     XFree86-nvidia-kernel
-
-%description -n kernel%{_alt_kernel}-video-nvidia
-nVidia Architecture support for Linux kernel.
-
-%description -n kernel%{_alt_kernel}-video-nvidia -l de.UTF-8
-Die nVidia-Architektur-Unterstützung für den Linux-Kern.
-
-%description -n kernel%{_alt_kernel}-video-nvidia -l hu.UTF-8
-nVidia Architektúra támogatás Linux kernelhez.
-
-%description -n kernel%{_alt_kernel}-video-nvidia -l pl.UTF-8
-Obsługa architektury nVidia dla jądra Linuksa. Pakiet wymagany przez
-sterownik nVidii dla Xorg/XFree86.
+%define        kernel_pkg()\
+%package -n kernel%{_alt_kernel}-video-nvidia\
+Summary:       nVidia kernel module for nVidia Architecture support\
+Summary(de.UTF-8):     Das nVidia-Kern-Modul für die nVidia-Architektur-Unterstützung\
+Summary(hu.UTF-8):     nVidia Architektúra támogatás Linux kernelhez.\
+Summary(pl.UTF-8):     Moduł jądra dla obsługi kart graficznych nVidia\
+Release:       %{rel}@%{_kernel_ver_str}\
+Group:         Base/Kernel\
+Requires(post,postun): /sbin/depmod\
+Requires:      dev >= 2.7.7-10\
+%requires_releq_kernel\
+%if %{_kernel_version_code} >= %{_kernel_version_magic 3 10 0}\
+Requires:      %{releq_kernel -n drm}\
+%endif\
+Requires(postun):      %releq_kernel\
+Requires:      %{pname} = %{epoch}:%{version}\
+Provides:      X11-driver-nvidia(kernel)\
+Obsoletes:     XFree86-nvidia-kernel\
+\
+%description -n kernel%{_alt_kernel}-video-nvidia\
+nVidia Architecture support for Linux kernel.\
+\
+%description -n kernel%{_alt_kernel}-video-nvidia -l de.UTF-8\
+Die nVidia-Architektur-Unterstützung für den Linux-Kern.\
+\
+%description -n kernel%{_alt_kernel}-video-nvidia -l hu.UTF-8\
+nVidia Architektúra támogatás Linux kernelhez.\
+\
+%description -n kernel%{_alt_kernel}-video-nvidia -l pl.UTF-8\
+Obsługa architektury nVidia dla jądra Linuksa. Pakiet wymagany przez\
+sterownik nVidii dla Xorg/XFree86.\
+\
+%if %{with kernel}\
+%files -n kernel%{_alt_kernel}-video-nvidia\
+%defattr(644,root,root,755)\
+/lib/modules/%{_kernel_ver}/misc/*.ko*\
+%endif\
+\
+%post  -n kernel%{_alt_kernel}-video-nvidia\
+%depmod %{_kernel_ver}\
+\
+%postun        -n kernel%{_alt_kernel}-video-nvidia\
+%depmod %{_kernel_ver}\
+%{nil}
+
+%define build_kernel_pkg()\
+cd kernel\
+#cat >> Makefile <<'EOF'\
+#\
+#$(obj)/nv-kernel.o: $(src)/nv-kernel.o.bin\
+#      cp $< $@\
+#EOF\
+#mv nv-kernel.o{,.bin}\
+#build_kernel_modules -m nvidia\
+%{__make} SYSSRC=%{_kernelsrcdir} clean\
+%{__make} SYSSRC=%{_kernelsrcdir} module\
+cd ..\
+%install_kernel_modules -D installed -m kernel/nvidia -d misc\
+%{nil}
+
+%{?with_kernel:%{expand:%kpkg}}
 
 %prep
 cd %{_builddir}
@@ -214,17 +266,7 @@ rm -rf NVIDIA-Linux-x86*-%{version}*
 echo 'EXTRA_CFLAGS += -Wno-pointer-arith -Wno-sign-compare -Wno-unused' >> kernel/Makefile.kbuild
 
 %build
-%if %{with kernel}
-cd kernel
-ln -sf Makefile.kbuild Makefile
-cat >> Makefile <<'EOF'
-
-$(obj)/nv-kernel.o: $(src)/nv-kernel.o.bin
-       cp $< $@
-EOF
-mv nv-kernel.o{,.bin}
-%build_kernel_modules -m nvidia
-%endif
+%{?with_kernel:%{expand:%bkpkg}}
 
 %install
 rm -rf $RPM_BUILD_ROOT
@@ -244,8 +286,8 @@ install -p %{SOURCE2} $RPM_BUILD_ROOT/etc/X11/xinit/xinitrc.d/nvidia-settings.sh
 %endif
 
 install -p nvidia-{smi,xconfig,bug-report.sh} $RPM_BUILD_ROOT%{_bindir}
-install -p nvidia-cuda-proxy-{control,server} $RPM_BUILD_ROOT%{_bindir}
-cp -p nvidia-{smi,xconfig,cuda-proxy-control}.1* $RPM_BUILD_ROOT%{_mandir}/man1
+install -p nvidia-cuda-mps-{control,server} $RPM_BUILD_ROOT%{_bindir}
+cp -p nvidia-{smi,xconfig,cuda-mps-control}.1* $RPM_BUILD_ROOT%{_mandir}/man1
 install -p nvidia.icd $RPM_BUILD_ROOT%{_sysconfdir}/OpenCL/vendors
 
 install %{SOURCE4} $RPM_BUILD_ROOT/etc/X11/xorg.conf.d
@@ -254,7 +296,6 @@ sed -i -e 's|@@LIBDIR@@|%{_libdir}|g' $RPM_BUILD_ROOT/etc/X11/xorg.conf.d/10-nvi
 
 for f in \
        libGL.so.%{version}                     \
-       libOpenCL.so.1.0.0                      \
        libcuda.so.%{version}                   \
        libnvcuvid.so.%{version}                \
        libnvidia-cfg.so.%{version}             \
@@ -275,7 +316,7 @@ ln -s libglx.so.%{version} $RPM_BUILD_ROOT%{_libdir}/xorg/modules/extensions/nvi
 install -p nvidia_drv.so $RPM_BUILD_ROOT%{_libdir}/xorg/modules/drivers/nvidia_drv.so.%{version}
 ln -s nvidia_drv.so.%{version} $RPM_BUILD_ROOT%{_libdir}/xorg/modules/drivers/nvidia_drv.so
 install -p libnvidia-wfb.so.%{version} $RPM_BUILD_ROOT%{_libdir}/xorg/modules/extensions/nvidia
-ln -s libnvidia-wfb.so.%{version} $RPM_BUILD_ROOT%{_libdir}/xorg/modules/extensions/nvidia/libnvidia-wfb.so
+ln -s libnvidia-wfb.so.1 $RPM_BUILD_ROOT%{_libdir}/xorg/modules/extensions/nvidia/libnvidia-wfb.so
 
 /sbin/ldconfig -n $RPM_BUILD_ROOT%{_libdir}/nvidia
 /sbin/ldconfig -n $RPM_BUILD_ROOT%{_libdir}/xorg/modules/extensions/nvidia
@@ -295,13 +336,13 @@ echo %{_libdir}/vdpau >>$RPM_BUILD_ROOT%{_sysconfdir}/ld.so.conf.d/nvidia.conf
 # OpenGL ABI for Linux compatibility
 ln -sf libGL.so.%{version} $RPM_BUILD_ROOT%{_libdir}/nvidia/libGL.so.1
 ln -sf libGL.so.1 $RPM_BUILD_ROOT%{_libdir}/nvidia/libGL.so
-ln -sf libOpenCL.so.1 $RPM_BUILD_ROOT%{_libdir}/nvidia/libOpenCL.so
 ln -sf libcuda.so.1 $RPM_BUILD_ROOT%{_libdir}/nvidia/libcuda.so
 ln -sf libnvcuvid.so.1 $RPM_BUILD_ROOT%{_libdir}/nvidia/libnvcuvid.so
 %endif
 
 %if %{with kernel}
-%install_kernel_modules -m kernel/nvidia -d misc
+install -d $RPM_BUILD_ROOT
+cp -a installed/* $RPM_BUILD_ROOT
 %endif
 
 install -d $RPM_BUILD_ROOT%{_pkgconfigdir}
@@ -318,19 +359,13 @@ rm -rf $RPM_BUILD_ROOT
 %post
 cat << 'EOF'
 NOTE: You must also install kernel module for this driver to work
-  kernel-video-nvidia-%{version}
+  kernel%{_alt_kernel}-video-nvidia-%{version}
 
 EOF
 
-%post libs -p /sbin/ldconfig
+%post  libs -p /sbin/ldconfig
 %postun        libs -p /sbin/ldconfig
 
-%post  -n kernel%{_alt_kernel}-video-nvidia
-%depmod %{_kernel_ver}
-
-%postun        -n kernel%{_alt_kernel}-video-nvidia
-%depmod %{_kernel_ver}
-
 %if %{with userspace}
 %files
 %defattr(644,root,root,755)
@@ -355,9 +390,6 @@ EOF
 %dir %{_libdir}/nvidia
 %attr(755,root,root) %{_libdir}/nvidia/libGL.so.*.*
 %attr(755,root,root) %ghost %{_libdir}/nvidia/libGL.so.1
-%attr(755,root,root) %{_libdir}/nvidia/libOpenCL.so.*.*
-%attr(755,root,root) %ghost %{_libdir}/nvidia/libOpenCL.so.1
-%attr(755,root,root) %{_libdir}/nvidia/libOpenCL.so
 %attr(755,root,root) %{_libdir}/nvidia/libcuda.so.*.*
 %attr(755,root,root) %ghost %{_libdir}/nvidia/libcuda.so.1
 %attr(755,root,root) %{_libdir}/nvidia/libcuda.so
@@ -395,11 +427,11 @@ EOF
 %files progs
 %defattr(644,root,root,755)
 %attr(755,root,root) %{_bindir}/nvidia-bug-report.sh
-%attr(755,root,root) %{_bindir}/nvidia-cuda-proxy-control
-%attr(755,root,root) %{_bindir}/nvidia-cuda-proxy-server
+%attr(755,root,root) %{_bindir}/nvidia-cuda-mps-control
+%attr(755,root,root) %{_bindir}/nvidia-cuda-mps-server
 %attr(755,root,root) %{_bindir}/nvidia-smi
 %attr(755,root,root) %{_bindir}/nvidia-xconfig
-%{_mandir}/man1/nvidia-cuda-proxy-control.1*
+%{_mandir}/man1/nvidia-cuda-mps-control.1*
 %{_mandir}/man1/nvidia-smi.1*
 %{_mandir}/man1/nvidia-xconfig.1*
 %if %{with settings}
@@ -410,9 +442,3 @@ EOF
 %{_pixmapsdir}/nvidia-settings.png
 %endif
 %endif
-
-%if %{with kernel}
-%files -n kernel%{_alt_kernel}-video-nvidia
-%defattr(644,root,root,755)
-/lib/modules/%{_kernel_ver}/misc/*.ko*
-%endif
This page took 0.042278 seconds and 4 git commands to generate.