nvidia-390 390.132-5 (znver1;x86_64) 2020-11919
9999

Submitter benbullard79 [@T] cox.net
Platform rolling
Repository non-free
URL https://abf.openmandriva.org/build_lists/782614
Packages
nvidia-390-390.132-5.znver1.source
nvidia-390-390.132-5.znver1.binary
nvidia-390-32bit-390.132-5.znver1.binary
nvidia-390-kernel-modules-desktop-390.132-5.znver1.binary
nvidia-390-kernel-modules-server-390.132-5.znver1.binary
nvidia-390-390.132-5.x86_64.binary
nvidia-390-390.132-5.x86_64.source
nvidia-390-32bit-390.132-5.x86_64.binary
nvidia-390-kernel-modules-desktop-390.132-5.x86_64.binary
nvidia-390-kernel-modules-server-390.132-5.x86_64.binary
Build Date 2020-06-14 01:22:47 +0000 UTC
Last Updated 2020-06-19 20:27:49.87521715 +0000 UTC
$ git diff --patch-with-stat --summary 9c596e4a9b585939c2ecaf7ca26752241c0ff73a..5b8ed2fc9aa4f3923db44a665ee7c8a2cd7f0b1f

 .abf.yml                                           |    8 +-
 kernel-5.5.patch                                   |   42 +
 kernel-5.6.patch                                   |  378 +++++
 kernel-5.7.patch                                   |  103 ++
 modprobe-nvidia.conf                               |    2 +
 nvidia-390.rpmlintrc                               |    4 +
 nvidia-390.spec                                    | 1647 +++++---------------
 ...istenced-319.17-add-missing-libtirpc-link.patch |   12 -
 nvidia-settings-include-xf86vmproto.patch          |   14 -
 xorg-nvidia.conf                                   |   12 +
 10 files changed, 944 insertions(+), 1278 deletions(-)
 create mode 100644 kernel-5.6.patch
 create mode 100644 kernel-5.7.patch
 create mode 100644 modprobe-nvidia.conf
 delete mode 100644 nvidia-persistenced-319.17-add-missing-libtirpc-link.patch
 delete mode 100644 nvidia-settings-include-xf86vmproto.patch
 create mode 100644 xorg-nvidia.conf

diff --git a/.abf.yml b/.abf.yml
index 8422169..1beea93 100644
--- a/.abf.yml
+++ b/.abf.yml
@@ -1,7 +1,9 @@
 sources:
+  NVIDIA-Linux-x86_64-390.132.run: 63d49c0fac620b21a23b361a9f02487534ac9c5c
+
+removed_sources:
   nvidia-modprobe-390.132.tar.bz2: 802727e5eeb6b09a7a053b1054ee0e9f203db0d2
   nvidia-persistenced-390.132.tar.bz2: d9aeabc0ce05049e796eb82c57bb32f8bd378cae
-  nvidia-settings-390.132.tar.bz2:  0b782b517911bb3919cff74a93b51e001586b0ed
+  nvidia-settings-390.132.tar.bz2: 0b782b517911bb3919cff74a93b51e001586b0ed
   nvidia-xconfig-390.132.tar.bz2: e50cd28298fae541ab23f40eda5ea523d00e9769
-  NVIDIA-Linux-x86_64-390.132.run: 63d49c0fac620b21a23b361a9f02487534ac9c5c
-  NVIDIA-Linux-x86-390.132.run: 1966a1d54c3ab415a7b252f4a0d38fa77a7e4c30
+  NVIDIA-Linux-x86-390.132.run: 1966a1d54c3ab415a7b252f4a0d38fa77a7e4c30
\ No newline at end of file
diff --git a/kernel-5.5.patch b/kernel-5.5.patch
index ee4890d..94ff5d9 100644
--- a/kernel-5.5.patch
+++ b/kernel-5.5.patch
@@ -339,6 +339,48 @@
 - #include "nvkms-kapi.h"
 - 
 - struct NvKmsKapiConnectorInfo*
+diff --git a/kernel/common/inc/nv-drm.h b/kernel/common/inc/nv-drm.h
+new file mode 100644
+index 0000000..07e9f3c
+--- /dev/null
++++ b/kernel/common/inc/nv-drm.h
+@@ -0,0 +1,36 @@
++#ifndef _NV_DRM_H_
++#define _NV_DRM_H_
++
++#include "conftest.h"
++
++#if defined(NV_DRM_DRMP_H_PRESENT)
++#include <drm/drmP.h>
++#else
++#include <linux/agp_backend.h>
++#include <linux/file.h>
++#include <linux/init.h>
++#include <linux/jiffies.h>
++#include <linux/kernel.h>
++#include <linux/mutex.h>
++#include <linux/slab.h>
++#include <linux/types.h>
++#include <asm/pgalloc.h>
++#include <linux/uaccess.h>
++
++#include <uapi/drm/drm.h>
++#include <uapi/drm/drm_mode.h>
++
++#include <drm/drm_agpsupport.h>
++#include <drm/drm_crtc.h>
++#include <drm/drm_drv.h>
++#include <drm/drm_prime.h>
++#include <drm/drm_pci.h>
++#include <drm/drm_ioctl.h>
++#include <drm/drm_sysfs.h>
++#include <drm/drm_vblank.h>
++#include <drm/drm_device.h>
++
++#include <drm/drm_gem.h>
++#endif
++
++#endif
 diff --git a/kernel/conftest.sh b/kernel/conftest.sh
 index cc25806..6104639 100755
 --- a/kernel/conftest.sh
diff --git a/kernel-5.6.patch b/kernel-5.6.patch
new file mode 100644
index 0000000..f997cc3
--- /dev/null
+++ b/kernel-5.6.patch
@@ -0,0 +1,378 @@
+diff --git a/kernel/common/inc/nv-linux.h b/kernel/common/inc/nv-linux.h
+index 85041c2..ac5bb95 100644
+--- a/kernel/common/inc/nv-linux.h
++++ b/kernel/common/inc/nv-linux.h
+@@ -553,7 +553,11 @@ static inline void *nv_ioremap(NvU64 phys, NvU64 size)
+ 
+ static inline void *nv_ioremap_nocache(NvU64 phys, NvU64 size)
+ {
++#if defined(NV_IOREMAP_NOCACHE_PRESENT)
+     void *ptr = ioremap_nocache(phys, size);
++#else
++    void *ptr = ioremap(phys, size);
++#endif
+     if (ptr)
+         NV_MEMDBG_ADD(ptr, size);
+     return ptr;
+diff --git a/kernel/common/inc/nv-procfs.h b/kernel/common/inc/nv-procfs.h
+index 3c812ea..e57c4f9 100644
+--- a/kernel/common/inc/nv-procfs.h
++++ b/kernel/common/inc/nv-procfs.h
+@@ -52,6 +52,19 @@
+     })
+ #endif
+ 
++#if defined(NV_HAVE_PROC_OPS)
++#define NV_CREATE_PROC_FILE(filename,parent,__name,__data)               \
++   ({                                                                    \
++        struct proc_dir_entry *__entry;                                  \
++        int mode = (S_IFREG | S_IRUGO);                                  \
++        const struct proc_ops *fops = &nv_procfs_##__name##_fops;        \
++        if (fops->proc_write != 0)                                       \
++            mode |= S_IWUSR;                                             \
++        __entry = NV_CREATE_PROC_ENTRY(filename, mode, parent, fops,     \
++            __data);                                                     \
++        __entry;                                                         \
++    })
++#else
+ #define NV_CREATE_PROC_FILE(filename,parent,__name,__data)               \
+    ({                                                                    \
+         struct proc_dir_entry *__entry;                                  \
+@@ -63,6 +76,7 @@
+             __data);                                                     \
+         __entry;                                                         \
+     })
++#endif
+ 
+ /*
+  * proc_mkdir_mode exists in Linux 2.6.9, but isn't exported until Linux 3.0.
+@@ -104,6 +118,24 @@
+     remove_proc_entry(entry->name, entry->parent);
+ #endif
+ 
++#if defined(NV_HAVE_PROC_OPS)
++#define NV_DEFINE_PROCFS_SINGLE_FILE(__name)                                  \
++    static int nv_procfs_open_##__name(                                       \
++        struct inode *inode,                                                  \
++        struct file *filep                                                    \
++    )                                                                         \
++    {                                                                         \
++        return single_open(filep, nv_procfs_read_##__name,                    \
++            NV_PDE_DATA(inode));                                              \
++    }                                                                         \
++                                                                              \
++    static const struct proc_ops nv_procfs_##__name##_fops = {                \
++        .proc_open       = nv_procfs_open_##__name,                           \
++        .proc_read       = seq_read,                                          \
++        .proc_lseek      = seq_lseek,                                         \
++        .proc_release    = single_release,                                    \
++    };
++#else
+ #define NV_DEFINE_PROCFS_SINGLE_FILE(__name)                                  \
+     static int nv_procfs_open_##__name(                                       \
+         struct inode *inode,                                                  \
+@@ -121,6 +153,7 @@
+         .llseek     = seq_lseek,                                              \
+         .release    = single_release,                                         \
+     };
++#endif
+ 
+ #endif  /* CONFIG_PROC_FS */
+ 
+diff --git a/kernel/common/inc/nv-time.h b/kernel/common/inc/nv-time.h
+index 2c799c9..0206062 100644
+--- a/kernel/common/inc/nv-time.h
++++ b/kernel/common/inc/nv-time.h
+@@ -30,7 +30,12 @@
+ #include <linux/ktime.h>
+ #endif
+ 
+-static inline void nv_gettimeofday(struct timeval *tv)
++struct nv_timeval {
++    __kernel_long_t      tv_sec;
++    __kernel_suseconds_t tv_usec;
++};
++
++static inline void nv_gettimeofday(struct nv_timeval *tv)
+ {
+ #ifdef NV_DO_GETTIMEOFDAY_PRESENT
+     do_gettimeofday(tv);
+@@ -39,7 +44,7 @@ static inline void nv_gettimeofday(struct timeval *tv)
+ 
+     ktime_get_real_ts64(&now);
+ 
+-    *tv = (struct timeval) {
++    *tv = (struct nv_timeval) {
+         .tv_sec = now.tv_sec,
+         .tv_usec = now.tv_nsec/1000,
+     };
+
+diff --git a/kernel/nvidia-modeset/nvidia-modeset-linux.c b/kernel/nvidia-modeset/nvidia-modeset-linux.c
+index d42aabb..f0404fb 100644
+--- a/kernel/nvidia-modeset/nvidia-modeset-linux.c
++++ b/kernel/nvidia-modeset/nvidia-modeset-linux.c
+@@ -216,7 +216,7 @@ void NVKMS_API_CALL nvkms_usleep(NvU64 usec)
+ 
+ NvU64 NVKMS_API_CALL nvkms_get_usec(void)
+ {
+-    struct timeval tv;
++    struct nv_timeval tv;
+ 
+     nv_gettimeofday(&tv);
+ 
+diff --git a/kernel/nvidia-uvm/uvm_linux.h b/kernel/nvidia-uvm/uvm_linux.h
+index 8784a82..c256cdb 100644
+--- a/kernel/nvidia-uvm/uvm_linux.h
++++ b/kernel/nvidia-uvm/uvm_linux.h
+@@ -329,7 +329,16 @@ static inline uint64_t NV_DIV64(uint64_t dividend, uint64_t divisor, uint64_t *r
+ }
+ #endif
+ 
+-#if defined(CLOCK_MONOTONIC_RAW)
++#if defined(NV_KTIME_GET_RAW_TS64_PRESENT)
++static inline NvU64 NV_GETTIME(void)
++{
++    struct timespec64 ts64 = {0};
++
++    ktime_get_raw_ts64(&ts64);
++
++    return (ts64.tv_sec * 1000000000ULL + ts64.tv_nsec);
++}
++#elif defined(CLOCK_MONOTONIC_RAW)
+ /* Return a nanosecond-precise value */
+ static inline NvU64 NV_GETTIME(void)
+ {
+@@ -345,7 +354,7 @@ static inline NvU64 NV_GETTIME(void)
+  * available non-GPL symbols. */
+ static inline NvU64 NV_GETTIME(void)
+ {
+-    struct timeval tv = {0};
++    struct nv_timeval tv = {0};
+ 
+     nv_gettimeofday(&tv);
+ 
+diff --git a/kernel/nvidia/nv-procfs.c b/kernel/nvidia/nv-procfs.c
+index 5808a88..bc60a08 100644
+--- a/kernel/nvidia/nv-procfs.c
++++ b/kernel/nvidia/nv-procfs.c
+@@ -414,6 +414,15 @@ done:
+     return ((status < 0) ? status : (int)count);
+ }
+ 
++#if defined(NV_HAVE_PROC_OPS)
++static struct proc_ops nv_procfs_registry_fops = {
++    .proc_open    = nv_procfs_open_registry,
++    .proc_read    = seq_read,
++    .proc_write   = nv_procfs_write_file,
++    .proc_lseek   = seq_lseek,
++    .proc_release = nv_procfs_close_registry,
++};
++#else
+ static struct file_operations nv_procfs_registry_fops = {
+     .owner   = THIS_MODULE,
+     .open    = nv_procfs_open_registry,
+@@ -422,6 +431,7 @@ static struct file_operations nv_procfs_registry_fops = {
+     .llseek  = seq_lseek,
+     .release = nv_procfs_close_registry,
+ };
++#endif
+ 
+ /*
+  * Forwards error to nv_log_error which exposes data to vendor callback
+@@ -517,12 +527,20 @@ done:
+     return status;
+ }
+ 
++#if defined(NV_HAVE_PROC_OPS)
++static struct proc_ops nv_procfs_exercise_error_forwarding_fops = {
++    .proc_open    = nv_procfs_open_exercise_error_forwarding,
++    .proc_write   = nv_procfs_write_file,
++    .proc_release = nv_procfs_close_exercise_error_forwarding,
++};
++#else
+ static struct file_operations nv_procfs_exercise_error_forwarding_fops = {
+     .owner   = THIS_MODULE,
+     .open    = nv_procfs_open_exercise_error_forwarding,
+     .write   = nv_procfs_write_file,
+     .release = nv_procfs_close_exercise_error_forwarding,
+ };
++#endif
+ 
+ static int
+ nv_procfs_read_unbind_lock(
+@@ -650,6 +668,15 @@ done:
+     return rc;
+ }
+ 
++#if defined(NV_HAVE_PROC_OPS)
++static struct proc_ops nv_procfs_unbind_lock_fops = {
++    .proc_open    = nv_procfs_open_unbind_lock,
++    .proc_read    = seq_read,
++    .proc_write   = nv_procfs_write_file,
++    .proc_lseek   = seq_lseek,
++    .proc_release = nv_procfs_close_unbind_lock,
++};
++#else
+ static struct file_operations nv_procfs_unbind_lock_fops = {
+     .owner   = THIS_MODULE,
+     .open    = nv_procfs_open_unbind_lock,
+@@ -658,6 +685,7 @@ static struct file_operations nv_procfs_unbind_lock_fops = {
+     .llseek  = seq_lseek,
+     .release = nv_procfs_close_unbind_lock,
+ };
++#endif
+ 
+ static int
+ nv_procfs_read_text_file(
+diff --git a/kernel/nvidia/nvidia.Kbuild b/kernel/nvidia/nvidia.Kbuild
+index 8ae1016..da7f135 100644
+--- a/kernel/nvidia/nvidia.Kbuild
++++ b/kernel/nvidia/nvidia.Kbuild
+@@ -117,6 +117,7 @@ NV_CONFTEST_FUNCTION_COMPILE_TESTS += on_each_cpu
+ NV_CONFTEST_FUNCTION_COMPILE_TESTS += smp_call_function
+ NV_CONFTEST_FUNCTION_COMPILE_TESTS += acpi_evaluate_integer
+ NV_CONFTEST_FUNCTION_COMPILE_TESTS += ioremap_cache
++NV_CONFTEST_FUNCTION_COMPILE_TESTS += ioremap_nocache
+ NV_CONFTEST_FUNCTION_COMPILE_TESTS += ioremap_wc
+ NV_CONFTEST_FUNCTION_COMPILE_TESTS += acpi_walk_namespace
+ NV_CONFTEST_FUNCTION_COMPILE_TESTS += pci_domain_nr
+@@ -169,7 +170,9 @@ NV_CONFTEST_TYPE_COMPILE_TESTS += outer_flush_all
+ NV_CONFTEST_TYPE_COMPILE_TESTS += proc_dir_entry
+ NV_CONFTEST_TYPE_COMPILE_TESTS += scatterlist
+ NV_CONFTEST_TYPE_COMPILE_TESTS += sg_table
++NV_CONFTEST_TYPE_COMPILE_TESTS += proc_ops
+ NV_CONFTEST_TYPE_COMPILE_TESTS += file_operations
++NV_CONFTEST_TYPE_COMPILE_TESTS += ktime_get_raw_ts64
+ NV_CONFTEST_TYPE_COMPILE_TESTS += vm_operations_struct
+ NV_CONFTEST_TYPE_COMPILE_TESTS += atomic_long_type
+ NV_CONFTEST_TYPE_COMPILE_TESTS += pci_save_state
+diff --git a/kernel/nvidia/nvlink_linux.c b/kernel/nvidia/nvlink_linux.c
+index 0014280..537b257 100644
+--- a/kernel/nvidia/nvlink_linux.c
++++ b/kernel/nvidia/nvlink_linux.c
+@@ -518,8 +518,8 @@ void * NVLINK_API_CALL nvlink_memcpy(void *dest, void *src, NvLength size)
+ 
+ static NvBool nv_timer_less_than
+ (
+-    const struct timeval *a,
+-    const struct timeval *b
++    const struct nv_timeval *a,
++    const struct nv_timeval *b
+ )
+ {
+     return (a->tv_sec == b->tv_sec) ? (a->tv_usec < b->tv_usec) 
+@@ -528,9 +528,9 @@ static NvBool nv_timer_less_than
+ 
+ static void nv_timeradd
+ (
+-    const struct timeval    *a,
+-    const struct timeval    *b,
+-    struct timeval          *result
++    const struct nv_timeval    *a,
++    const struct nv_timeval    *b,
++    struct nv_timeval          *result
+ )
+ {
+     result->tv_sec = a->tv_sec + b->tv_sec;
+@@ -544,9 +544,9 @@ static void nv_timeradd
+ 
+ static void nv_timersub
+ (
+-    const struct timeval    *a,
+-    const struct timeval    *b,
+-    struct timeval          *result
++    const struct nv_timeval    *a,
++    const struct nv_timeval    *b,
++    struct nv_timeval          *result
+ )
+ {
+     result->tv_sec = a->tv_sec - b->tv_sec;
+@@ -566,7 +566,7 @@ void NVLINK_API_CALL nvlink_sleep(unsigned int ms)
+     unsigned long us;
+     unsigned long jiffies;
+     unsigned long mdelay_safe_msec;
+-    struct timeval tm_end, tm_aux;
++    struct nv_timeval tm_end, tm_aux;
+ 
+     nv_gettimeofday(&tm_aux);
+ 
+diff --git a/kernel/nvidia/os-interface.c b/kernel/nvidia/os-interface.c
+index 344daa8..39d0a19 100644
+--- a/kernel/nvidia/os-interface.c
++++ b/kernel/nvidia/os-interface.c
+@@ -430,7 +430,7 @@ NV_STATUS NV_API_CALL os_get_current_time(
+     NvU32 *useconds
+ )
+ {
+-    struct timeval tm;
++    struct nv_timeval tm;
+ 
+     nv_gettimeofday(&tm);
+ 
+@@ -444,9 +444,15 @@ NV_STATUS NV_API_CALL os_get_current_time(
+ 
+ void NV_API_CALL os_get_current_tick(NvU64 *nseconds)
+ {
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 5, 0)
++    struct timespec64 ts;
++
++    jiffies_to_timespec64(jiffies, &ts);
++#else
+     struct timespec ts;
+ 
+     jiffies_to_timespec(jiffies, &ts);
++#endif
+ 
+     *nseconds = ((NvU64)ts.tv_sec * NSEC_PER_SEC + (NvU64)ts.tv_nsec);
+ }
+@@ -502,7 +508,7 @@ NV_STATUS NV_API_CALL os_delay_us(NvU32 MicroSeconds)
+     unsigned long usec;
+ 
+ #ifdef NV_CHECK_DELAY_ACCURACY
+-    struct timeval tm1, tm2;
++    struct nv_timeval tm1, tm2;
+ 
+     nv_gettimeofday(&tm1);
+ #endif
+@@ -542,9 +548,9 @@ NV_STATUS NV_API_CALL os_delay(NvU32 MilliSeconds)
+     unsigned long MicroSeconds;
+     unsigned long jiffies;
+     unsigned long mdelay_safe_msec;
+-    struct timeval tm_end, tm_aux;
++    struct nv_timeval tm_end, tm_aux;
+ #ifdef NV_CHECK_DELAY_ACCURACY
+-    struct timeval tm_start;
++    struct nv_timeval tm_start;
+ #endif
+ 
+     nv_gettimeofday(&tm_aux);
+@@ -1926,7 +1932,7 @@ static NV_STATUS NV_API_CALL _os_ipmi_receive_resp
+ {
+     struct ipmi_recv_msg    *rx_msg;
+     int                     err_no;
+-    struct timeval          tv;
++    struct nv_timeval          tv;
+     NvU64                   start_time;
+ 
+     nv_gettimeofday(&tv);
+
+--- a/kernel/conftest.sh	2020-06-02 10:43:50.078085798 +1000
++++ b/kernel/conftest.sh	2020-06-02 10:49:08.498078838 +1000
+@@ -1876,7 +1882,7 @@
+         atomic64_type)
+             # Determine if atomic64_t and associated functions are defined
+             CODE="
+-            #include <asm/atomic.h>
++            #include <linux/atomic.h>
+             void conftest_atomic64(void) {
+                 atomic64_t data;
+                 atomic64_read(&data);
+@@ -3462,7 +3468,7 @@
+             #     2008-01-25  9ee85241fdaab358dff1d8647f20a478cfa512a1
+             #
+             CODE="
+-            #include <acpi/acpi_bus.h>
++            #include <linux/acpi.h>
+             int conftest_register_acpi_notifier(void) {
+                 return register_acpi_notifier();
+             }"
diff --git a/kernel-5.7.patch b/kernel-5.7.patch
new file mode 100644
index 0000000..616dfc3
--- /dev/null
+++ b/kernel-5.7.patch
@@ -0,0 +1,103 @@
+diff --git a/NVIDIA-Linux-x86_64-390.132/kernel/conftest.sh b/NVIDIA-Linux-x86_64-390.132/kernel/conftest.sh
+index 6104639..9c98580 100755
+--- a/NVIDIA-Linux-x86_64-390.132/kernel/conftest.sh
++++ b/NVIDIA-Linux-x86_64-390.132/kernel/conftest.sh
+@@ -131,6 +131,7 @@ test_headers() {
+     # Arch specific headers which need testing
+     FILES_ARCH="asm/book3s/64/hash-64k.h"
+     FILES_ARCH="$FILES_ARCH asm/set_memory.h"
++    FILES_ARCH="$FILES_ARCH asm/pgtable.h"
+     FILES_ARCH="$FILES_ARCH asm/powernv.h"
+     FILES_ARCH="$FILES_ARCH asm/tlbflush.h"
+ 
+@@ -397,6 +398,8 @@ compile_test() {
+             # Determine if the set_memory_uc() function is present.
+             #
+             CODE="
++	    #include <asm/page.h>
++	    #include <asm/pgtable.h>
+             #if defined(NV_ASM_SET_MEMORY_H_PRESENT)
+             #include <asm/set_memory.h>
+             #else
+@@ -414,6 +417,8 @@ compile_test() {
+             # Determine if the set_memory_array_uc() function is present.
+             #
+             CODE="
++	    #include <asm/page.h>
++	    #include <asm/pgtable.h>
+             #if defined(NV_ASM_SET_MEMORY_H_PRESENT)
+             #include <asm/set_memory.h>
+             #else
+@@ -466,6 +471,8 @@ compile_test() {
+             # Determine if the set_pages_uc() function is present.
+             #
+             CODE="
++            #include <asm/page.h>
++            #include <asm/pgtable.h>
+             #if defined(NV_ASM_SET_MEMORY_H_PRESENT)
+             #include <asm/set_memory.h>
+             #else
+@@ -1189,6 +1196,22 @@ compile_test() {
+             compile_check_conftest "$CODE" "NV_IOREMAP_CACHE_PRESENT" "" "functions"
+         ;;
+ 
++        ioremap_nocache)
++            #
++            # Determine if the ioremap_nocache() function is present.
++            #
++            # Removed by commit 4bdc0d676a64 ("remove ioremap_nocache and
++            # devm_ioremap_nocache") in v5.6 (2020-01-06)
++            #
++            CODE="
++            #include <asm/io.h>
++            void conftest_ioremap_nocache(void) {
++                ioremap_nocache();
++            }"
++
++            compile_check_conftest "$CODE" "NV_IOREMAP_NOCACHE_PRESENT" "" "functions"
++        ;;
++
+         ioremap_wc)
+             #
+             # Determine if the ioremap_wc() function is present.
+@@ -1422,6 +1445,31 @@ compile_test() {
+             compile_check_conftest "$CODE" "NV_SG_ALLOC_TABLE_FROM_PAGES_PRESENT" "" "functions"
+         ;;
+ 
++        proc_ops)
++            CODE="
++            #include <linux/proc_fs.h>
++            int conftest_proc_ops(void) {
++                return offsetof(struct proc_ops, proc_open);
++            }"
++
++            compile_check_conftest "$CODE" "NV_HAVE_PROC_OPS" "" "types"
++        ;;
++
++        ktime_get_raw_ts64)
++            #
++            # Determine if the ktime_get_raw_ts64() function is present.
++            #
++            CODE="
++            #include <linux/ktime.h>
++            int conftest_ktime_get_raw_ts64(void) {
++                struct timespec64 ts = {0};
++
++                ktime_get_raw_ts64(&ts64);
++            }"
++
++            compile_check_conftest "$CODE" "NV_KTIME_GET_RAW_TS64_PRESENT" "" "functions"
++        ;;
++
+         efi_enabled)
+             #
+             # Determine if the efi_enabled symbol is present, or if
+@@ -1821,7 +1869,7 @@ compile_test() {
+             # Determine if atomic_long_t and associated functions are defined
+             # Added in 2.6.16 2006-01-06 d3cb487149bd706aa6aeb02042332a450978dc1c
+             CODE="
+-            #include <asm/atomic.h>
++            #include <linux/atomic.h>
+             void conftest_atomic_long(void) {
+                 atomic_long_t data;
+                 atomic_long_read(&data);
diff --git a/modprobe-nvidia.conf b/modprobe-nvidia.conf
new file mode 100644
index 0000000..c7f1a88
--- /dev/null
+++ b/modprobe-nvidia.conf
@@ -0,0 +1,2 @@
+blacklist nouveau
+
diff --git a/nvidia-390.rpmlintrc b/nvidia-390.rpmlintrc
index f3c7ca6..96bc4c1 100644
--- a/nvidia-390.rpmlintrc
+++ b/nvidia-390.rpmlintrc
@@ -4,3 +4,7 @@ addFilter("E: unstripped-binary-or-object")
 addFilter("E: hardcoded-library-path")
 addFilter("E: external-depfilter-with-internal-depgen")
 addFilter("E: devel-file-in-non-devel-package")
+addFilter("E: explicit-lib-dependency")
+addFilter("E: setuid-binary")
+addFilter("E: non-executable-script")
+addFilter("E: Empty %files")
\ No newline at end of file
diff --git a/nvidia-390.spec b/nvidia-390.spec
index 7c2579a..a51945e 100644
--- a/nvidia-390.spec
+++ b/nvidia-390.spec
@@ -1,1277 +1,426 @@
-## I love OpenSource :-(
-#%%define _disable_lto 1
-%global ldflags %{ldflags} -fuse-ld=bfd
-%define debug_package %{nil}
-
-## NOTE: When modifying this .spec, you do not necessarily need to care about
-##       the %simple stuff. It is fine to break them, I'll fix it when I need them :)
-## - Anssi
-
-# %simple mode can be used to transform an arbitrary nvidia installer
-# package to rpms, similar to %atibuild mode in fglrx.
-# Macros version, rel, nsource, pkgname, distsuffix should be manually defined.
-%define simple 0
-%{?_without_simple: %global simple 0}
-%{?_with_simple: %global simple 1}
-
-%define name	nvidia-390
-%define kname nvidia
-
-%if !%simple
-# When updating, please add new ids to ldetect-lst (merge2pcitable.pl)
-%define version 390.132
-%define rel 2
-# the highest supported videodrv abi
-%define videodrv_abi 23
-%endif
-
-%define priority 9710
-
-%define pkgname32 NVIDIA-Linux-x86-%{version}
-%define pkgname64 NVIDIA-Linux-x86_64-%{version}
-
-# For now, backportability is kept for 2008.0 forwards.
-
-%define drivername nvidia-390
-%define driverpkgname x11-driver-video-%{drivername}
-%define modulename %{drivername}
-# for description and documentation
-%define cards GeForce 8xxx and later cards
-%define xorg_extra_modules %{_libdir}/xorg/extra-modules
-%define nvidia_driversdir %{_libdir}/%{drivername}/xorg
-%define nvidia_extensionsdir %{_libdir}/%{drivername}/xorg
-%define nvidia_modulesdir %{_libdir}/%{drivername}/xorg
-%define nvidia_libdir %{_libdir}/%{drivername}
-%define nvidia_libdir32 %{_prefix}/lib/%{drivername}
-%define nvidia_bindir %{nvidia_libdir}/bin
-# The entry in Cards+ this driver should be associated with, if there is
-# no entry in ldetect-lst default pcitable:
-# cooker ldetect-lst should be up-to-date
-%define ldetect_cards_name %nil
-
-# NVIDIA cards not listed in main ldetect-lst pcitable are not likely
-# to be supported by nv which is from the same time period. Therefore
-# mark them as not working with nv. (main pcitable entries override
-# our entries)
-%if %simple
-# nvidia/vesa
-%define ldetect_cards_name NVIDIA GeForce 7050
-%endif
-
-%define biarches x86_64 znver1
-
-%if !%simple
-%ifarch %{ix86}
-%define nsource %{SOURCE0}
-%define pkgname %{pkgname32}
-%endif
-%ifarch x86_64
-%define nsource %{SOURCE1}
-%define pkgname %{pkgname64}
-%endif
-%ifarch znver1
-%define nsource %{SOURCE1}
-%define pkgname %{pkgname64}
-%endif
-%endif
-
-# Other packages should not require any NVIDIA libraries, and this package
-# should not be pulled in when libGL.so.1 is required
-%global __provides_exclude 'libGL\\.so\\.1(.*)|devel\\(libGL(.*)|\\.so'
-%define common_requires_exceptions ^libGL\\.so\\|^libGLcore\\.so\\|^libGLdispatch\\.so|^libnvidia.*\\.so
-
-%ifarch %{biarches}
-# (anssi) Allow installing of 64-bit package if the runtime dependencies
-# of 32-bit libraries are not satisfied. If a 32-bit package that requires
-# libGL.so.1 is installed, the 32-bit mesa libs are pulled in and that will
-# pull the dependencies of 32-bit nvidia libraries in as well.
-%global __requires_exclude %common_requires_exceptions\\|^lib.*so\\.[^(]\\+\\(([^)]\\+)\\)\\?$
-%else
-%global __requires_exclude %common_requires_exceptions
-%endif
-
-# https://devtalk.nvidia.com/default/topic/523762/libnvidia-encode-so-310-19-has-dependency-on-missing-library/
-%define __requires_exclude_from libnvidia-encode.so.%{version}
-
-Summary:	NVIDIA proprietary X.org driver and libraries, current driver series
-Name:		%{name}
-Version:	%{version}
-Release:	%{rel}
-%if !%simple
-Source0:	https://download.nvidia.com/XFree86/Linux-x86/%{version}/%{pkgname32}.run
-Source1:	https://download.nvidia.com/XFree86/Linux-x86_64/%{version}/%{pkgname64}.run
-# GPLv2 source code; see also http://cgit.freedesktop.org/~aplattner/
-Source2:	https://download.nvidia.com/XFree86/nvidia-settings/nvidia-settings-%{version}.tar.bz2
-Source3:	https://download.nvidia.com/XFree86/nvidia-xconfig/nvidia-xconfig-%{version}.tar.bz2
-# Script for building rpms of arbitrary nvidia installers (needs this .spec appended)
-Source4:	nvidia-mdvbuild-skel
-Source5:	https://download.nvidia.com/XFree86/nvidia-modprobe/nvidia-modprobe-%{version}.tar.bz2
-Source6:	https://download.nvidia.com/XFree86/nvidia-persistenced/nvidia-persistenced-%{version}.tar.bz2
-Source100:	nvidia-390.rpmlintrc
-# include xf86vmproto for X_XF86VidModeGetGammaRampSize, fixes build on cooker
-Patch3:		nvidia-settings-include-xf86vmproto.patch
-Patch8:		nvidia-persistenced-319.17-add-missing-libtirpc-link.patch
-Patch10:	kernel-5.5.patch
-%endif
-License:	Freeware
-URL:		http://www.nvidia.com/object/unix.html
-Group:		System/Kernel and hardware
-ExclusiveArch:	%{ix86} x86_64 znver1
-%if !%simple
-BuildRequires:	imagemagick
-BuildRequires:	pkgconfig(vdpau) >= 1.1
-BuildRequires:	pkgconfig(xrender)
-BuildRequires:	pkgconfig(gtk+-2.0)
-BuildRequires:	pkgconfig(xv)
-BuildRequires:	pkgconfig(libtirpc)
-BuildRequires:	pkgconfig(gl)
-BuildRequires:	pkgconfig(xxf86vm)
-BuildRequires:	pkgconfig(dbus-1)
-BuildRequires:  pkgconfig(xrandr)
-%endif
-BuildRequires:	rpm-build >= 1:5.3.12
+%bcond_with kernel_rc
+
+
+Summary:	Binary-only driver for nvidia graphics chips
+Name:		nvidia-390
+Version:	390.132
+Release:	5
+ExclusiveArch:	%{x86_64}
+Url:		http://www.nvidia.com/object/unix.html
+Source0:	http://download.nvidia.com/XFree86/Linux-x86_64/%{version}/NVIDIA-Linux-x86_64-%{version}.run
+Source1:	https://gitweb.frugalware.org/frugalware-current/raw/master/source/x11-extra/nvidia/xorg-nvidia.conf	
+Source2:	https://gitweb.frugalware.org/frugalware-current/raw/master/source/x11-extra/nvidia/modprobe-nvidia.conf	
+Patch1:		kernel-5.5.patch
+Patch2:		kernel-5.6.patch
+Patch3:		kernel-5.7.patch
+Group:		Hardware
+License:	distributable
+# Just to be on the safe side, it may not be wise
+# to load clang-built modules into a gcc-built kernel
+BuildRequires:	gcc
+Requires:	%{name}-kernel-modules = %{EVRD}
 
 %description
-Source package of the current NVIDIA proprietary driver. Binary
-packages are named x11-driver-video-nvidia-390.
-
-%package -n %{driverpkgname}
-Summary:	NVIDIA proprietary X.org driver and libraries for %cards
-Group: 		System/Kernel and hardware
-Requires(post): update-alternatives >= 1.9.0
-Requires(postun): update-alternatives >= 1.9.0
-Requires:	x11-server-common
-# Proprietary driver handling rework:
-Conflicts:	harddrake < 10.4.163
-Conflicts:	drakx-kbd-mouse-x11 < 0.21
-Conflicts:	x11-server-common < 1.3.0.0-17
-Suggests:	%{drivername}-doc-html = %{version}
-# for missing libwfb.so
-Conflicts:	x11-server-common < 1.4
-# Proper support for versioned kmod() was added in 2008.1:
-Requires:	dkms-nvidia-390 = %{version}
-# At least mplayer dlopens libvdpau.so.1, so the software will not pull in
-# the vdpau library package. We ensure its installation here.
-# (vdpau package exists in main on 2009.0+)
-Requires:	%{_lib}vdpau1
-Conflicts:	x11-server-common < 1.6.0-11
-%if !%simple
-# Conflict with the next videodrv ABI break.
-# The NVIDIA driver supports the previous ABI versions as well and therefore
-# a strict version-specific requirement would not be enough.
-### This is problematic as it can cause removal of xserver instead (Anssi 04/2011)
-###Conflicts:	xserver-abi(videodrv-%(echo $((%{videodrv_abi} + 1))))
-%endif
-# Obsoletes for naming changes:
-Obsoletes:	nvidia < 1:%{version}-%{release}
-Provides:	nvidia = 1:%{version}-%{release}
-Obsoletes:	nvidia97xx < %{version}-%{release}
-Provides:	nvidia97xx = %{version}-%{release}
-%ifarch %{biarches}
-Suggests:	%{driverpkgname}-32bit = %{version}-%{release}
-%endif
-Conflicts:	%{drivername}-cuda-opencl <= 325.15-1
-
-%description -n %{driverpkgname}
-NVIDIA proprietary X.org graphics driver, related libraries and
-configuration tools for %cards,
-including the associated Quadro cards.
-
-NOTE: You should use XFdrake to configure your NVIDIA card. The
-correct packages will be automatically installed and configured.
-
-If you do not want to use XFdrake, see README.manual-setup.
-
-This NVIDIA driver should be used with %cards,
-including the associated Quadro cards.
-
-%ifarch %{biarches}
-%package -n %{driverpkgname}-32bit
-Summary:	32-bit compatibility libraries for the NVIDIA proprietary driver
-Group:		System/Kernel and hardware
-Conflicts:	%{drivername}-cuda-opencl <= 325.15-1
-
-%description -n %{driverpkgname}-32bit
-32-bit compatibility libraries for the NVIDIA proprietary driver.
+This is a binary-only driver for nvidia graphics chips.
+
+It is NOT supported.
+It may WIPE YOUR HARDDISK, SEND ALL YOUR DATA TO YOUR COMPETITORS,
+and worse.
+It is developed by a very Anti-Linux company, and source code is not
+released so nobody but them can tell what it actually does.
+
+The preferred way to solve the problem is to BOYCOTT NVIDIA!
+Alternatively, use the Nouveau driver that comes with the default
+installation.
+
+This package should only be used as a last resort.
+
+%ifarch %{x86_64}
+%package 32bit
+Summary:	Binary-only 32-bit driver for nvidia graphics chips
+
+%description 32bit
+This is a 32-bit binary-only driver for nvidia graphics chips.
+
+It is NOT supported.
+It may WIPE YOUR HARDDISK, SEND ALL YOUR DATA TO YOUR COMPETITORS,
+and worse.
+It is developed by a very Anti-Linux company, and source code is not
+released so nobody but them can tell what it actually does.
+
+The preferred way to solve the problem is to BOYCOTT NVIDIA!
+Alternatively, use the Nouveau driver that comes with the default
+installation.
+
+This package should only be used as a last resort.
+%endif
+
+%package kernel-modules-desktop
+%define kversion %(rpm -q --qf '%%{VERSION}-%%{RELEASE}\\n' kernel-release-desktop-devel |tail -n1)
+%define kdir %(rpm -q --qf '%%{VERSION}-desktop-%%{RELEASE}%%{DISTTAG}\\n' kernel-release-desktop-devel |tail -n1)
+Summary:	Kernel modules needed by the binary-only nvidia driver
+Provides:	%{name}-kernel-modules = %{EVRD}
+Requires:	kernel-release-desktop = %{kversion}
+Conflicts:	kernel-release-desktop < %{kversion}
+Conflicts:	kernel-release-desktop > %{kversion}
+Group:		Hardware
+Provides:	should-restart = system
+Requires(post,postun):	sed dracut grub2 kmod
+BuildRequires:	kernel-release-desktop-devel
+
+%description kernel-modules-desktop
+Kernel modules needed by the binary-only nvidia driver
+
+%package kernel-modules-server
+%define skversion %(rpm -q --qf '%%{VERSION}-%%{RELEASE}\\n' kernel-release-server-devel |tail -n1)
+%define skdir %(rpm -q --qf '%%{VERSION}-server-%%{RELEASE}%%{DISTTAG}\\n' kernel-release-server-devel |tail -n1)
+Summary:	Kernel modules needed by the binary-only nvidia driver
+Provides:	%{name}-kernel-modules = %{EVRD}
+Requires:	kernel-release-server = %{skversion}
+Conflicts:	kernel-release-server < %{skversion}
+Conflicts:	kernel-release-server > %{skversion}
+Group:		Hardware
+Provides:	should-restart = system
+Requires(post,postun):	sed dracut grub2 kmod
+BuildRequires:	kernel-release-server-devel
+
+%description kernel-modules-server
+Kernel modules needed by the binary-only nvidia driver
+
+%if %{with kernel_rc}
+%package kernel-modules-rc-desktop
+%define rkversion %(rpm -q --qf '%%{VERSION}-%%{RELEASE}\\n' kernel-rc-desktop-devel |tail -n1)
+%define rkdir %(rpm -q --qf '%%{VERSION}-desktop-%%{RELEASE}%%{DISTTAG}\\n' kernel-rc-desktop-devel |tail -n1)
+Summary:	Kernel modules needed by the binary-only nvidia driver
+Provides:	%{name}-kernel-modules = %{EVRD}
+Requires:	kernel-rc-desktop = %{rkversion}
+Conflicts:	kernel-rc-desktop < %{rkversion}
+Conflicts:	kernel-rc-desktop > %{rkversion}
+Group:		Hardware
+Provides:	should-restart = system
+Requires(post,postun):	sed dracut grub2 kmod
+BuildRequires:	kernel-rc-desktop-devel
+
+%description kernel-modules-rc-desktop
+Kernel modules needed by the binary-only nvidia driver
+
+%package kernel-modules-rc-server
+%define rskversion %(rpm -q --qf '%%{VERSION}-%%{RELEASE}\\n' kernel-rc-server-devel |tail -n1)
+%define rskdir %(rpm -q --qf '%%{VERSION}-server-%%{RELEASE}%%{DISTTAG}\\n' kernel-rc-server-devel |tail -n1)
+Summary:	Kernel modules needed by the binary-only nvidia driver
+Provides:	%{name}-kernel-modules = %{EVRD}
+Requires:	kernel-rc-server = %{rskversion}
+Conflicts:	kernel-rc-server < %{rskversion}
+Conflicts:	kernel-rc-server > %{rskversion}
+Group:		Hardware
+Provides:	should-restart = system
+Requires(post,postun):	sed dracut grub2 kmod
+BuildRequires:	kernel-rc-server-devel
+
+%description kernel-modules-rc-server
+Kernel modules needed by the binary-only nvidia driver
 %endif
 
-%package -n dkms-%{drivername}
-Summary:	NVIDIA kernel module for %cards
-Group:		System/Kernel and hardware
-Requires:	dkms >= 2.2.0.3.1-3.20130827.8
-Requires(post):	dkms  >= 2.2.0.3.1-3.20130827.8
-Requires(preun): dkms >= 2.2.0.3.1-3.20130827.8
-Obsoletes:	dkms-nvidia < 1:%{version}-%{release}
-Provides:	dkms-nvidia = 1:%{version}-%{release}
-Obsoletes:	dkms-nvidia97xx < %{version}-%{release}
-Provides:	dkms-nvidia97xx = %{version}-%{release}
-
-%description -n dkms-%{drivername}
-NVIDIA kernel module for %cards. This
-is to be used with the %{driverpkgname} package.
-
-%package -n %{drivername}-devel
-Summary:	NVIDIA OpenGL/CUDA development liraries and headers
-Group:		Development/C
-Requires:	%{driverpkgname} = %{version}-%{release}
-Requires:	%{drivername}-cuda-opencl = %{version}-%{release}
-Obsoletes:	nvidia-devel < 1:%{version}-%{release}
-Provides:	nvidia-devel = 1:%{version}-%{release}
-Obsoletes:	nvidia97xx-devel < %{version}-%{release}
-Provides:	nvidia97xx-devel = %{version}-%{release}
-Requires:	%{_lib}vdpau-devel
-
-%description -n %{drivername}-devel
-NVIDIA OpenGL/CUDA headers for %cards. This package
-is not required for normal use.
-
-%package -n %{drivername}-cuda-opencl
-Summary:	CUDA and OpenCL libraries for NVIDIA proprietary driver
-Group:		System/Kernel and hardware
-Provides:	%{drivername}-cuda = %{version}-%{release}
-Requires:	dkms-nvidia-390 = %{version}
-Conflicts:	nvidia < 1:195.36.15-4
-%if "%_lib" == "lib64"
-Provides:	libnvcuvid.so.1()(64bit)
-%ifarch %biarches
-Provides:	libnvcuvid.so.1
-%endif
-%else
-Provides:	libnvcuvid.so.1
-%endif
+%prep
+%setup -T -c %{name}-%{version}
+sh %{S:0} --extract-only
 
-%description -n %{drivername}-cuda-opencl
-Cuda and OpenCL libraries for NVIDIA proprietary driver. This package is not
-required for normal use, it provides libraries to use NVIDIA cards for High
-Performance Computing (HPC).
+cd NVIDIA-Linux-x86_64-%{version}
+%patch1 -p1
+%patch2 -p1
+%patch3 -p2
 
-# HTML doc splitted off because of size, for live cds:
-%package -n %{drivername}-doc-html
-Summary:	NVIDIA html documentation (%{drivername})
-Group:		System/Kernel and hardware
-Requires:	%{driverpkgname} = %{version}-%{release}
 
-%description -n %{drivername}-doc-html
-HTML version of the README.txt file provided in package
-%{driverpkgname}.
+%build
 
-%prep
-#define _default_patch_fuzz 2
-# No patches applied when %simple is set
-%if %simple
-%setup -q -c -T
-%else
-%setup -q -c -T -a 2 -a 3 -a 5 -a 6
-cd nvidia-settings-%{version}
-%patch3 -p1
-cd ..
-cd nvidia-persistenced-%{version}
-%patch8 -p1
-cd ..
-%endif
+cd NVIDIA-Linux-x86_64-%{version}
 
-sh %{nsource} --extract-only
+cp -a kernel kernel-server
 
-%if !%simple
-cd %{pkgname}
-%ifarch x86_64
-# extra patches here
-%patch10 -p1 
-%endif
-# extra patches here
-cd ..
+%if %{with kernel_rc}
+cp -a kernel kernel-rc
+cp -a kernel kernel-rc-server
 %endif
 
-rm -rf %{pkgname}/usr/src/nv/precompiled
+cd kernel
+make SYSSRC=%{_prefix}/src/linux-%{kdir} CC=%{_bindir}/gcc
 
-%if %simple
-# for old releases
-mkdir -p %{pkgname}/kernel
-%endif
+cd ../kernel-server
+make SYSSRC=%{_prefix}/src/linux-%{skdir} CC=%{_bindir}/gcc
 
-# (tmb) nuke nVidia provided dkms.conf as we need our own
-rm -f %{pkgname}/kernel/dkms.conf
-
-# install our own dkms.conf
-cat > %{pkgname}/kernel/dkms.conf <<EOF
-PACKAGE_NAME="%{drivername}"
-PACKAGE_VERSION="%{version}-%{release}"
-BUILT_MODULE_NAME[0]="nvidia"
-DEST_MODULE_LOCATION[0]="/kernel/drivers/char/drm"
-DEST_MODULE_NAME[0]="nvidia"
-BUILT_MODULE_NAME[1]="nvidia-modeset"
-DEST_MODULE_LOCATION[1]="/kernel/drivers/char/drm"
-DEST_MODULE_NAME[1]="nvidia-modeset"
-%ifarch x86_64
-BUILT_MODULE_NAME[2]="nvidia-uvm"
-DEST_MODULE_LOCATION[2]="/kernel/drivers/char/drm"
-DEST_MODULE_NAME[2]="nvidia-uvm"
-%endif
-BUILT_MODULE_NAME[3]="nvidia-drm"
-DEST_MODULE_LOCATION[3]="/kernel/drivers/char/drm"
-DEST_MODULE_NAME[3]="nvidia-drm"
-MAKE[0]="'make' CC=clang CXX=clang++ SYSSRC=\${kernel_source_dir} modules"
-AUTOINSTALL="yes"
-EOF
-
-
-cat > README.manual-setup <<EOF
-This file describes the procedure for the manual installation of this NVIDIA
-driver package. You can find the instructions for the recommended automatic
-installation in the file 'README.install.urpmi' in this directory.
-
-- Open %{_sysconfdir}/X11/xorg.conf and make the following changes:
-  o Change the Driver to "nvidia" in the Device section
-  o Make the line below the only 'glx' related line in the Module section,
-    adding it if it is not already there:
-      Load "glx"
-  o Remove any 'ModulePath' lines from the Files section
-- Run "update-alternatives --set gl_conf %{_sysconfdir}/%{drivername}/ld.so.conf" as root.
-- Run "ldconfig -X" as root.
-EOF
-
-%if !%simple
-rm nvidia-settings-%{version}/src/*/*.a ||:
+%if %{with kernel_rc}
+cd ../kernel-rc
+make SYSSRC=%{_prefix}/src/linux-%{rkdir} CC=%{_bindir}/gcc IGNORE_CC_MISMATCH=1
 
-%build
-#export CC=gcc  CXX=g++
-export LD=ld.bfd 
-%setup_compile_flags
-
-# (tpg) needed for patch 6
-# i couldn't push this to patch 6 because of fuzz error
-# even with fuzz 2 this does not work
-# drop this if upstream will accept patches
-pushd nvidia-settings-%{version}
-sed -i -e 's#nv_warning_msg([^)]*err_str);#nv_warning_msg(*err_str, "%s");#g' src/gtk+-2.x/ctkdisplayconfig-utils.c
-popd
-
-# (tpg) need to provide a patch to fix format error
-export CFLAGS="%{optflags} -Wno-error=format-security"
-
-%make_build -C nvidia-settings-%{version}/src/libXNVCtrl CC=clang
-%make_build -C nvidia-settings-%{version} NV_KEEP_UNSTRIPPED_BINARIES=false CC=clang
-%make_build -C nvidia-xconfig-%{version} NV_KEEP_UNSTRIPPED_BINARIES=false
-%make_build -C nvidia-modprobe-%{version} NV_KEEP_UNSTRIPPED_BINARIES=false
-%make_build -C nvidia-persistenced-%{version} NV_KEEP_UNSTRIPPED_BINARIES=false
-
-# %simple
+cd ../kernel-rc-server
+make SYSSRC=%{_prefix}/src/linux-%{rskdir} CC=%{_bindir}/gcc IGNORE_CC_MISMATCH=1
 %endif
 
 %install
-cd %{pkgname}
-
-# dkms
-install -d -m755 %{buildroot}%{_usrsrc}/%{drivername}-%{version}-%{release}
-cat > nvllbuild << EOF
-#!/bin/sh
-set -e
-export "CC=clang" LDFLAGS="$LDFLAGS --build-id=none"
-ln -s Module.symvers nvidia-drm/Module.symvers 
-ln -s Module.symvers nvidia-modeset/Module.symvers 
-ln -s Module.symvers nvidia-uvm/Module.symvers 
-make  KERN_DIR=\$1 modules
-
-EOF
-install -m 0755 nvllbuild %{buildroot}%{_usr}/src/%{name}-%{version}-%{release}
-# menu entry
-install -d -m755 %{buildroot}%{_datadir}/%{drivername}
-cat > %{buildroot}%{_datadir}/%{drivername}/%{disttag}-nvidia-settings.desktop <<EOF
-[Desktop Entry]
-Name=NVIDIA Display Settings
-Comment=Configure NVIDIA X driver
-Exec=%{_bindir}/nvidia-settings
-Icon=%{drivername}-settings
-Terminal=false
-Type=Application
-Categories=GTK;Settings;HardwareSettings;
-EOF
-
-#Make sure the nvidia xorg driver actually gets loaded.
-install -d -m755 %{buildroot}%{_sysconfdir}/X11/xorg.conf.d/
-cat > %{buildroot}%{_sysconfdir}/X11/xorg.conf.d/20-nvidia.conf <<EOF
-Section "Device"
-        Identifier "My GPU"
-        Driver "nvidia"
-EndSection
-EOF
-
-#Blacklist the nouveau driver
-install -d -m755 %{buildroot}%{_sysconfdir}/modprobe.d/
-cat > %{buildroot}%{_sysconfdir}/modprobe.d/blacklist-nouveau.conf <<EOF
-blacklist nouveau
-
-EOF
-
-install -d -m755 %{buildroot}%{_datadir}/applications
-touch %{buildroot}%{_datadir}/applications/%{disttag}-nvidia-settings.desktop
-
-# icons
-install -d -m755 %{buildroot}%{_iconsdir}/hicolor/{16x16,32x32,48x48}/apps
-%if !%simple
-convert nvidia-settings.png -resize 16x16 %{buildroot}%{_iconsdir}/hicolor/16x16/apps/%{drivername}-settings.png
-convert nvidia-settings.png -resize 32x32 %{buildroot}%{_iconsdir}/hicolor/32x32/apps/%{drivername}-settings.png
-convert nvidia-settings.png -resize 48x48 %{buildroot}%{_iconsdir}/hicolor/48x48/apps/%{drivername}-settings.png
-%else
-# no imagemagick
-[ -e nvidia-settings.png ] || cp -a usr/share/pixmaps/nvidia-settings.png .
-install -m644 nvidia-settings.png %{buildroot}%{_iconsdir}/hicolor/48x48/apps/%{drivername}-settings.png
-%endif
-
-error_fatal() {
-	echo "Error: $@." >&2
-	exit 1
-}
+cd NVIDIA-Linux-x86_64-%{version}
 
-error_unhandled() {
-	echo "Warning: $@." >&2
-	echo "Warning: $@." >> warns.log
-%if !%simple
-	# cause distro builds to fail in case of unhandled files
-	exit 1
-%endif
+inst() {
+	install -m 644 -D $(basename $1) %{buildroot}"$1"
+	if [ -e "32/$(basename $1)" ]; then
+		install -m 644 -D "32/$(basename $1)" %{buildroot}$(echo $1 |sed -e 's,%_lib,lib,')
+	fi
 }
-
-parseparams() {
-	for value in $rest; do
-		local param=$1
-		[ -n "$param" ] || error_fatal "unhandled parameter $value"
-		shift
-		eval $param=$value
-
-		[ -n "$value" ] || error_fatal "empty $param"
-
-		# resolve libdir based on $arch
-		if [ "$param" = "arch" ]; then
-			case "$arch" in
-			NATIVE)		nvidia_libdir=%{nvidia_libdir};;
-			COMPAT32)	nvidia_libdir=%{nvidia_libdir32};;
-			*)		error_fatal "unknown arch $arch"
-			esac
-		fi
-	done
+instx() {
+	install -m 755 -D $(basename $1) %{buildroot}"$1"
+	if [ -e "32/$(basename $1)" ]; then
+		install -m 755 -D "32/$(basename $1)" %{buildroot}$(echo $1 |sed -e 's,%_lib,lib,')
+	fi
 }
-
-add_to_list() {
-%if !%simple
-	# on distro builds, only use .manifest for %doc files
-	[ "${2#%doc}" = "${2}" ] && return
+sl() {
+	if [ -n "$2" ]; then ln -s lib$1.so.%{version} %{buildroot}%{_libdir}/lib$1.so.$2; fi
+	if [ -z "$3" ]; then ln -s lib$1.so.%{version} %{buildroot}%{_libdir}/lib$1.so; fi
+%ifarch %{x86_64}
+	if [ -e %{buildroot}%{_prefix}/lib/lib$1.so.%{version} ]; then
+		if [ -n "$2" ]; then ln -s lib$1.so.%{version} %{buildroot}%{_prefix}/lib/lib$1.so.$2; fi
+		if [ -z "$3" ]; then ln -s lib$1.so.%{version} %{buildroot}%{_prefix}/lib/lib$1.so; fi
+	fi
 %endif
-	local list="$1.files"
-	local entry="$2"
-	echo $entry >> $list
-}
-
-install_symlink() {
-	local pkg="$1"
-	local dir="$2"
-	mkdir -p %{buildroot}$dir
-	ln -s $dest %{buildroot}$dir/$file
-	add_to_list $pkg $dir/$file
-}
-
-install_lib_symlink() {
-	local pkg="$1"
-	local dir="$2"
-	case "$file" in
-	libvdpau_*.so)
-		# vdpau drivers => not put into -devel
-		;;
-	*.so)
-		pkg=nvidia-devel;;
-	esac
-	install_symlink $pkg $dir
 }
 
-install_file_only() {
-	local pkg="$1"
-	local dir="$2"
-	mkdir -p %{buildroot}$dir
-	# replace 0444 with more usual 0644
-	[ "$perms" = "0444" ] && perms="0644"
-	install -m $perms $file %{buildroot}$dir
-}
-
-install_file() {
-	local pkg="$1"
-	local dir="$2"
-	install_file_only $pkg $dir
-	add_to_list $pkg $dir/$(basename $file)
-}
-
-install_src_file() {
-	local pkg="$1"
-	local dir="$2"
-	local moddir=$(dirname $file)
-	local subdir=${moddir#kernel}
-	install_file_only $pkg $dir$subdir
-	add_to_list $pkg $dir$subdir/$(basename $file)
-}
-
-get_module_dir() {
-	local subdir="$1"
-	case "$subdir" in
-	extensions*)	echo %{nvidia_extensionsdir};;
-	drivers/)	echo %{nvidia_driversdir};;
-	/)		echo %{nvidia_modulesdir};;
-	*)		error_unhandled "unhandled module subdir $subdir"
-			echo %{nvidia_modulesdir};;
-	esac
-}
-
-for file in nvidia.files nvidia-devel.files nvidia-cuda.files nvidia-dkms.files nvidia-html.files; do
-	rm -f $file
-	touch $file
+# X driver
+instx %{_libdir}/xorg/modules/drivers/nvidia_drv.so
+inst %{_datadir}/vulkan/icd.d/nvidia_icd.json.template
+
+# OpenGL core library
+instx %{_libdir}/libnvidia-glcore.so.%{version}
+sl nvidia-glcore
+inst %{_datadir}/glvnd/egl_vendor.d/10_nvidia.json
+
+# GLX extension module for X
+#instx %{_libdir}/xorg/modules/nvidia/extensions/libglxserver_nvidia.so.%{version}
+#ln -s libglxserver_nvidia.so.%{version} %{buildroot}%{_libdir}/xorg/modules/nvidia/extensions/libglxserver_nvidia.so
+instx %{_libdir}/libGLX_nvidia.so.%{version}
+sl GLX_nvidia 0 n
+
+# EGL
+instx %{_libdir}/libEGL_nvidia.so.%{version}
+sl EGL_nvidia 0
+instx %{_libdir}/libnvidia-eglcore.so.%{version}
+sl nvidia-eglcore
+
+# OpenGL ES
+instx %{_libdir}/libGLESv1_CM_nvidia.so.%{version}
+sl GLESv1_CM_nvidia 1
+instx %{_libdir}/libGLESv2_nvidia.so.%{version}
+sl GLESv2_nvidia.so 2
+
+# GLSI
+instx %{_libdir}/libnvidia-glsi.so.%{version}
+sl nvidia-glsi
+
+# CUDA
+instx %{_libdir}/libcuda.so.%{version}
+sl cuda 1
+instx %{_libdir}/libnvcuvid.so.%{version}
+sl nvcuvid 1
+instx %{_libdir}/libnvidia-ml.so.%{version}
+sl nvidia-ml 1
+# CUDA?
+instx %{_libdir}/libnvidia-ptxjitcompiler.so.%{version}
+sl nvidia-ptxjitcompiler 1
+
+instx %{_libdir}/libnvidia-fatbinaryloader.so.%{version}
+
+# nvidia-tls library
+instx %{_libdir}/libnvidia-tls.so.%{version}
+sl nvidia-tls
+
+# OpenCL
+inst %{_sysconfdir}/OpenCL/vendors/nvidia.icd
+instx %{_libdir}/libnvidia-cfg.so.%{version}
+sl nvidia-cfg 1
+
+instx %{_libdir}/libnvidia-compiler.so.%{version}
+instx %{_libdir}/libnvidia-opencl.so.%{version}
+
+# Encode (what is this?)
+instx %{_libdir}/libnvidia-encode.so.%{version}
+sl nvidia-encode 1
+
+# Fbc (Framebuffer console?)
+instx %{_libdir}/libnvidia-fbc.so.%{version}
+sl nvidia-fbc 1
+
+# Yuck...
+instx %{_libdir}/libnvidia-gtk2.so.%{version}
+instx %{_libdir}/libnvidia-gtk3.so.%{version}
+
+# IFR
+instx %{_libdir}/libnvidia-ifr.so.%{version}
+sl nvidia-ifr 1
+
+# VDPAU
+instx %{_libdir}/vdpau/libvdpau_nvidia.so.%{version}
+ln -s libvdpau_nvidia.so.%{version} %{buildroot}%{_libdir}/vdpau/libvdpau_nvidia.so.1.0
+ln -s libvdpau_nvidia.so.%{version} %{buildroot}%{_libdir}/vdpau/libvdpau_nvidia.so.1
+ln -s libvdpau_nvidia.so.%{version} %{buildroot}%{_libdir}/vdpau/libvdpau_nvidia.so
+
+# Wayland
+# FIXME can this be replaced by https://github.com/NVIDIA/egl-wayland ?
+wlibso=$(ls libnvidia-egl-wayland.so* | sed 's/.*so.\(.*\)/\1/')
+instx %{_libdir}/libnvidia-egl-wayland.so.$wlibso
+ln -s libnvidia-egl-wayland.so.$wlibso %{buildroot}%{_libdir}/libnvidia-egl-wayland.so.1
+ln -s libnvidia-egl-wayland.so.$wlibso %{buildroot}%{_libdir}/libnvidia-egl-wayland.so
+inst %{_datadir}/egl/egl_external_platform.d/10_nvidia_wayland.json
+
+# Tools
+for i in *.1.gz; do
+	gunzip $i
 done
-
-# install files according to .manifest
-#set +x
-cat .manifest | sed 's/INHERIT_PATH_DEPTH:[0-9]//;s/MODULE:.*//'| tail -n +9 |  while read line; do
-
-	arch=
-	style=
-	subdir=
-	dest=
-	nvidia_libdir=
-
-	rest=${line}
-	file=${rest%%%% *}
-	rest=${rest#* }
-	perms=${rest%%%% *}
-	rest=${rest#* }
-	type=${rest%%%% *}
-	[ "${rest#* }" = "$rest" ] && rest= || rest=${rest#* }
-
-	case "$type" in
-	CUDA_LIB)
-		parseparams arch subdir
-		install_file nvidia-cuda $nvidia_libdir/$subdir
-		;;
-	CUDA_SYMLINK)
-		parseparams arch subdir dest
-		install_lib_symlink nvidia-cuda $nvidia_libdir/$subdir
-		;;
-	EXPLICIT_PATH)
-		parseparams dest
-		install_file nvidia %{_datadir}/nvidia
-    		;;
-	GLVND_LIB)
-		parseparams arch
-		install_file nvidia $nvidia_libdir
-		;;
-	GLVND_EGL_ICD_JSON)
-		# (tmb) skip for now
-		case $libtype in NON_GLVND);; *) continue; esac
-		install_file nvidia %{_sysconfdir}/%{drivername}
-		;;
-	GLVND_SYMLINK)
-		parseparams arch dest
-		install_lib_symlink nvidia $nvidia_libdir
-		;;
-	GLX_CLIENT_LIB)
-		parseparams arch libtype
-		# (tmb) skip for now
-		case $libtype in NON_GLVND);; *) continue; esac
-		install_file nvidia $nvidia_libdir
-		;;
-	GLX_CLIENT_SYMLINK)
-		parseparams arch dest libtype
-		# (tmb) skip for now
-		case $libtype in NON_GLVND);; *) continue; esac
-		install_lib_symlink nvidia $nvidia_libdir
-		;;
-	NVCUVID_LIB)
-		parseparams arch subdir
-		install_file nvidia-cuda $nvidia_libdir/$subdir
-		;;
-	NVCUVID_LIB_SYMLINK)
-		parseparams arch dest
-		install_lib_symlink nvidia $nvidia_libdir
-		;;
-	OPENCL_LIB)
-		parseparams arch subdir
-		install_file nvidia-cuda $nvidia_libdir/$subdir
-		;;
-	OPENCL_LIB_SYMLINK)
-		parseparams arch subdir dest
-		install_lib_symlink nvidia-cuda $nvidia_libdir/$subdir
-		;;
-	OPENCL_WRAPPER_LIB)
-		parseparams arch subdir
-		install_file nvidia-cuda $nvidia_libdir/$subdir
-		;;
-	OPENCL_WRAPPER_SYMLINK)
-		parseparams arch subdir dest
-		install_lib_symlink nvidia-cuda $nvidia_libdir/$subdir
-		;;
-	OPENGL_LIB)
-		parseparams arch
-		install_file nvidia $nvidia_libdir
-		;;
-	OPENGL_SYMLINK)
-		parseparams arch dest
-		install_lib_symlink nvidia $nvidia_libdir
-		;;
-	TLS_LIB)
-		parseparams arch style subdir
-		install_file nvidia $nvidia_libdir/$subdir
-		;;
-	TLS_SYMLINK)
-		parseparams arch style subdir dest
-		install_lib_symlink nvidia $nvidia_libdir/$subdir
-		;;
-	UTILITY_LIB)
-		# backward-compatibility
-		[ -n "${rest}" ] || rest="NATIVE $rest"
-		parseparams arch subdir
-		install_file nvidia $nvidia_libdir/$subdir
-		;;
-	UTILITY_LIB_SYMLINK)
-		# backward-compatibility
-		[ "${rest#* }" != "$rest" ] || rest="NATIVE $rest"
-		parseparams arch dest
-		install_lib_symlink nvidia $nvidia_libdir
-		;;
-	VDPAU_LIB|VDPAU_WRAPPER_LIB)
-		parseparams arch subdir
-		# on 2009.0+, only install libvdpau_nvidia.so
-		case $file in *libvdpau_nvidia.so*);; *) continue; esac
-		install_file nvidia $nvidia_libdir/$subdir
-		;;
-	VDPAU_SYMLINK|VDPAU_WRAPPER_SYMLINK)
-		parseparams arch subdir dest
-		# on 2009.0+, only install libvdpau_nvidia.so
-		case $file in *libvdpau_nvidia.so*);; *) continue; esac
-		install_lib_symlink nvidia $nvidia_libdir/$subdir
-		;;
-	VULKAN_ICD_JSON)
-		install_file nvidia %{_sysconfdir}/vulkan/icd.d/
-		;;
-	XLIB_STATIC_LIB)
-		install_file nvidia-devel %{nvidia_libdir}
-		;;
-	XLIB_SHARED_LIB)
-		install_file nvidia %{nvidia_libdir}
-		;;
-	XLIB_SYMLINK)
-		parseparams dest
-		install_lib_symlink nvidia %{nvidia_libdir}
-		;;
-	LIBGL_LA)
-		# (Anssi) we don't install .la files
-		;;
-	XMODULE_SHARED_LIB|GLX_MODULE_SHARED_LIB)
-		parseparams subdir
-		install_file nvidia $(get_module_dir $subdir)
-		;;
-	XMODULE_NEWSYM)
-		# symlink that is created only if it doesn't already
-		# exist (i.e. as part of x11-server)
-		case "$file" in
-		libwfb.so)
-		# 2008.1+ has this one already
-			continue
-			;;
-		*)
-			error_unhandled "unknown XMODULE_NEWSYM type file $file, skipped"
-			continue
-		esac
-		parseparams subdir dest
-		install_symlink nvidia $(get_module_dir $subdir)
-		;;
-	XORG_OUTPUTCLASS_CONFIG)
-		# dont install xorg driver autoloader conf
-		continue
-		;;
-	XMODULE_SYMLINK|GLX_MODULE_SYMLINK)
-		parseparams subdir dest
-		install_symlink nvidia $(get_module_dir $subdir)
-		;;
-	VDPAU_HEADER)
-		# already in vdpau-devel
-		continue
-		parseparams subdir
-		install_file_only nvidia-devel %{_includedir}/%{drivername}/$subdir
-		;;
-	OPENGL_HEADER|CUDA_HEADER)
-		parseparams subdir
-		install_file_only nvidia-devel %{_includedir}/%{drivername}/$subdir
-		;;
-	EGL_CLIENT_LIB)
-		parseparams arch libtype
-		# (tmb) skip for now
-		case $libtype in NON_GLVND);; *) continue; esac
-		install_file nvidia $nvidia_libdir
-		;;
-	EGL_CLIENT_SYMLINK)
-		parseparams arch dest libtype
-		# (tmb) skip for now
-		case $libtype in NON_GLVND);; *) continue; esac
-		install_lib_symlink nvidia $nvidia_libdir
-		;;
-	EGL_EXTERNAL_PLATFORM_JSON)
-		echo 
-		;;
-	ENCODEAPI_LIB|NVIFR_LIB)
-		parseparams arch dest
-		install_file nvidia $nvidia_libdir/$subdir
-		;;
-	ENCODEAPI_LIB_SYMLINK|NVIFR_LIB_SYMLINK)
-		parseparams arch dest
-		install_lib_symlink nvidia $nvidia_libdir
-		;;
-	DOCUMENTATION)
-		parseparams subdir
-		case $subdir in
-		*/html)
-			add_to_list nvidia-html "%%doc %{pkgname}/$file"
-			continue
-			;;
-		*/include/*)
-			continue
-			;;
-		esac
-		case $file in
-		*XF86Config*|*nvidia-settings.png)
-			continue;;
-		esac
-		add_to_list nvidia "%%doc %{pkgname}/$file"
-		;;
-	MANPAGE|NVIDIA_MODPROBE_MANPAGE)
-		parseparams subdir
-		case "$file" in
-		*nvidia-installer*)
-			# not installed
-			continue
-			;;
-		*nvidia-settings*|*nvidia-xconfig*|*nvidia-modprobe*|*nvidia-persistenced*)
-%if !%simple
-			# installed separately below
-			continue
-%endif
-			;;
-		*nvidia-smi*|*nvidia-cuda-mps-control*)
-			# ok
-			;;
-		*)
-			error_unhandled "skipped unknown man page $(basename $file)"
-			continue
-		esac
-		install_file_only nvidia %{_mandir}/$subdir
-		;;
-	UTILITY_BINARY)
-		case "$file" in
-		*nvidia-settings|*nvidia-xconfig|*nvidia-persistenced)
-%if !%simple
-			# not installed, we install our own copy
-			continue
-%endif
-			;;
-		*nvidia-smi|*nvidia-bug-report.sh|*nvidia-debugdump)
-       	    #ok
-        	;;
-        *nvidia-cuda-mps-control|*nvidia-cuda-mps-server)
-			# ok
-			;;
-		*)
-			error_unhandled "unknown binary $(basename $file) will be installed to %{nvidia_bindir}/$(basename $file)"
-			;;
-		esac
-		install_file nvidia %{nvidia_bindir}
-		;;
-	UTILITY_BIN_SYMLINK)
-		case $file in nvidia-uninstall) continue;; esac
-		parseparams dest
-		install_symlink nvidia %{nvidia_bindir}
-		;;
-    NVIDIA_MODPROBE)
-    # A suid-root tool (GPLv2) used as fallback for loading the module and
-	# creating the device nodes in case the driver component is running a
-	# a non-root user (e.g. a CUDA application). While the module is automatically
-	# loaded by udev rules, the device nodes are not automatically created
-	# like with regular drivers and therefore this tool is installed on
-	# distro as well, at least for now.
-	# We install our self-compiled version in non-simple mode
-%if %simple
-	install_file nvidia %{nvidia_bindir}
-%endif
-		;;
-	INSTALLER_BINARY)
-		# not installed
-		;;
-	KERNEL_MODULE_SRC|DKMS_CONF)
-		install_src_file nvidia-dkms %{_usrsrc}/%{drivername}-%{version}-%{release}
-		;;
-	CUDA_ICD)
-		# in theory this should go to the cuda subpackage, but it goes into the main package
-		# as this avoids one broken symlink and it is small enough to not cause space issues
-		install_file nvidia %{_sysconfdir}/%{drivername}
-		;;
-	APPLICATION_PROFILE)
-		parseparams subdir
-		# application profile filenames are versioned, we can use a common
-		# non-alternativesized directory
-		install_file nvidia %{_datadir}/nvidia/$subdir
-		;;
-	DOT_DESKTOP)
-		# we provide our own for now
-		;;
-	*)
-		error_unhandled "file $(basename $file) of unknown type $type will be skipped"
-	esac
-done
-
-[ -z "$warnings" ] || echo "Please inform Anssi Hannula <anssi@mandriva.org> or http://qa.mandriva.com/ of the above warnings." >> warns.log
-
-%if %simple
-find %{buildroot}%{_libdir} %{buildroot}%{_prefix}/lib -type d | while read dir; do
-	dir=${dir#%{buildroot}}
-	echo "$dir" | grep -q nvidia && echo "%%dir $dir" >> nvidia.files
-done
-[ -d %{buildroot}%{_includedir}/%{drivername} ] && echo "%{_includedir}/%{drivername}" >> nvidia-devel.files
-
-# for old releases in %%simple mode
-if ! [ -e %{buildroot}%{_usrsrc}/%{drivername}-%{version}-%{release}/dkms.conf ]; then
-	install -m644 kernel/dkms.conf %{buildroot}%{_usrsrc}/%{drivername}-%{version}-%{release}/dkms.conf
-fi
-%endif
-
-%if !%simple
-# confirm SONAME; if something else than libvdpau_nvidia.so or libvdpau_nvidia.so.1, adapt .spec as needed:
-[ "$(objdump -p %{buildroot}%{nvidia_libdir}/vdpau/libvdpau_nvidia.so.%{version} | grep SONAME | gawk '{ print $2 }')" = "libvdpau_nvidia.so.1" ]
-
-rm -f %{buildroot}%{nvidia_libdir}/vdpau/libvdpau_nvidia.so.1
-rm -f %{buildroot}%{nvidia_libdir32}/vdpau/libvdpau_nvidia.so.1
-%endif
-
-# vdpau alternative symlink
-install -d -m755 %{buildroot}%{_libdir}/vdpau
-touch %{buildroot}%{_libdir}/vdpau/libvdpau_nvidia.so.1
-%ifarch %{biarches}
-install -d -m755 %{buildroot}%{_prefix}/lib/vdpau
-touch %{buildroot}%{_prefix}/lib/vdpau/libvdpau_nvidia.so.1
-%endif
-
-%if !%simple
-# self-built binaries
-install -m755 ../nvidia-settings-%{version}/src/_out/*/nvidia-settings %{buildroot}%{nvidia_bindir}
-install -m755 ../nvidia-xconfig-%{version}/_out/*/nvidia-xconfig %{buildroot}%{nvidia_bindir}
-install -m755 ../nvidia-persistenced-%{version}/_out/*/nvidia-persistenced %{buildroot}%{nvidia_bindir}
-install -m4755 ../nvidia-modprobe-%{version}/_out/*/nvidia-modprobe %{buildroot}%{nvidia_bindir}
-%endif
-# binary alternatives
-install -d -m755 %{buildroot}%{_bindir}
-touch %{buildroot}%{_bindir}/nvidia-settings
-touch %{buildroot}%{_bindir}/nvidia-smi
-touch %{buildroot}%{_bindir}/nvidia-debugdump
-touch %{buildroot}%{_bindir}/nvidia-xconfig
-touch %{buildroot}%{_bindir}/nvidia-bug-report.sh
-touch %{buildroot}%{_bindir}/nvidia-modprobe
-touch %{buildroot}%{_bindir}/nvidia-persistenced
-touch %{buildroot}%{_bindir}/nvidia-cuda-mps-control
-touch %{buildroot}%{_bindir}/nvidia-cuda-mps-server
-# rpmlint:
-chmod 0755 %{buildroot}%{_bindir}/*
-
-%if !%simple
-# install man pages
-install -m755 ../nvidia-settings-%{version}/doc/_out/*/nvidia-settings.1 %{buildroot}%{_mandir}/man1
-install -m755 ../nvidia-xconfig-%{version}/_out/*/nvidia-xconfig.1 %{buildroot}%{_mandir}/man1
-install -m644 ../nvidia-modprobe-%{version}/_out/*/nvidia-modprobe.1 %{buildroot}%{_mandir}/man1
-install -m644 ../nvidia-persistenced-%{version}/_out/*/nvidia-persistenced.1 %{buildroot}%{_mandir}/man1
-%endif
-# bug #41638 - whatis entries of nvidia man pages appear wrong
-gunzip %{buildroot}%{_mandir}/man1/*.gz
-sed -r -i '/^nvidia\\-[a-z]+ \\- NVIDIA/s,^nvidia\\-,nvidia-,' %{buildroot}%{_mandir}/man1/*.1
-cd %{buildroot}%{_mandir}/man1
-rename nvidia alt-%{drivername} *
-cd -
-touch %{buildroot}%{_mandir}/man1/nvidia-xconfig.1%{_extension}
-touch %{buildroot}%{_mandir}/man1/nvidia-settings.1%{_extension}
-touch %{buildroot}%{_mandir}/man1/nvidia-modprobe.1%{_extension}
-touch %{buildroot}%{_mandir}/man1/nvidia-persistenced.1%{_extension}
-touch %{buildroot}%{_mandir}/man1/nvidia-smi.1%{_extension}
-touch %{buildroot}%{_mandir}/man1/nvidia-cuda-mps-control.1%{_extension}
-
-# cuda nvidia.icd
-install -d -m755 %{buildroot}%{_sysconfdir}/OpenCL/vendors
-touch %{buildroot}%{_sysconfdir}/OpenCL/vendors/nvidia.icd
-
-# ld.so.conf
-install -d -m755 %{buildroot}%{_sysconfdir}/%{drivername}
-echo "%{nvidia_libdir}" > %{buildroot}%{_sysconfdir}/%{drivername}/ld.so.conf
-%ifarch %{biarches}
-echo "%{nvidia_libdir32}" >> %{buildroot}%{_sysconfdir}/%{drivername}/ld.so.conf
-%endif
-
-# modprobe.conf
-install -d -m755 %{buildroot}%{_sysconfdir}/modprobe.d
-touch %{buildroot}%{_sysconfdir}/modprobe.d/display-driver.conf
-echo "install nvidia /sbin/modprobe %{modulename} \$CMDLINE_OPTS" > %{buildroot}%{_sysconfdir}/%{drivername}/modprobe.conf
-
-# xinit script
-install -d -m755 %{buildroot}%{_sysconfdir}/%{drivername}
-cat > %{buildroot}%{_sysconfdir}/%{drivername}/nvidia-settings.xinit <<EOF
-# to be sourced
-#
-# Do not modify this file; the changes will be overwritten.
-# If you want to disable automatic configuration loading, create
-# /etc/sysconfig/nvidia-settings with this line: LOAD_NVIDIA_SETTINGS="no"
-#
-LOAD_NVIDIA_SETTINGS="yes"
-[ -f %{_sysconfdir}/sysconfig/nvidia-settings ] && . %{_sysconfdir}/sysconfig/nvidia-settings
-[ "\$LOAD_NVIDIA_SETTINGS" = "yes" ] && %{_bindir}/nvidia-settings --load-config-only
-EOF
-chmod 0755 %{buildroot}%{_sysconfdir}/%{drivername}/nvidia-settings.xinit
-install -d -m755 %{buildroot}%{_sysconfdir}/X11/xinit.d
-touch %{buildroot}%{_sysconfdir}/X11/xinit.d/nvidia-settings.xinit
-
-
-export EXCLUDE_FROM_STRIP="$(find %{buildroot} -type f \! -name nvidia-settings \! -name nvidia-xconfig \! -name nvidia-modprobe \! -name nvidia-persistenced)"
-
-%post -n %{driverpkgname}
-# XFdrake used to generate an nvidia.conf file
-#[ -L %{_sysconfdir}/modprobe.d/nvidia.conf ] || rm -f %{_sysconfdir}/modprobe.d/nvidia.conf
-
-current_glconf="$(readlink -e %{_sysconfdir}/ld.so.conf.d/GL.conf)"
-
-# owned by libvdpau1, created in case libvdpau1 is installed only just after
-# this package
-mkdir -p %{_libdir}/vdpau
-
-%{_sbindir}/update-alternatives \
-	--install %{_sysconfdir}/ld.so.conf.d/GL.conf gl_conf %{_sysconfdir}/%{drivername}/ld.so.conf %{priority} \
-	--slave %{_mandir}/man1/nvidia-settings.1%{_extension} man_nvidiasettings%{_extension} %{_mandir}/man1/alt-%{drivername}-settings.1%{_extension} \
-	--slave %{_mandir}/man1/nvidia-xconfig.1%{_extension} man_nvidiaxconfig%{_extension} %{_mandir}/man1/alt-%{drivername}-xconfig.1%{_extension} \
-	--slave %{_mandir}/man1/nvidia-smi.1%{_extension} nvidia-smi.1%{_extension} %{_mandir}/man1/alt-%{drivername}-smi.1%{_extension} \
-	--slave %{_mandir}/man1/nvidia-cuda-mps-control.1%{_extension} nvidia-cuda-mps-control.1%{_extension} %{_mandir}/man1/alt-%{drivername}-cuda-mps-control.1%{_extension} \
-	--slave %{_datadir}/applications/%{disttag}-nvidia-settings.desktop nvidia_desktop %{_datadir}/%{drivername}/%{disttag}-nvidia-settings.desktop \
-	--slave %{_bindir}/nvidia-settings nvidia_settings %{nvidia_bindir}/nvidia-settings \
-	--slave %{_bindir}/nvidia-smi nvidia_smi %{nvidia_bindir}/nvidia-smi \
-	--slave %{_bindir}/nvidia-debugdump nvidia_debugdump %{nvidia_bindir}/nvidia-debugdump \
-	--slave %{_bindir}/nvidia-xconfig nvidia_xconfig %{nvidia_bindir}/nvidia-xconfig \
-	--slave %{_bindir}/nvidia-bug-report.sh nvidia_bug_report %{nvidia_bindir}/nvidia-bug-report.sh \
-	--slave %{_bindir}/nvidia-cuda-mps-control nvidia-cuda-mps-control %{nvidia_bindir}/nvidia-cuda-mps-control \
-	--slave %{_bindir}/nvidia-cuda-mps-server nvidia-cuda-mps-server %{nvidia_bindir}/nvidia-cuda-mps-server \
-	--slave %{_bindir}/nvidia-modprobe nvidia-modprobe %{nvidia_bindir}/nvidia-modprobe \
-	--slave %{_bindir}/nvidia-persistenced nvidia-persistenced %{nvidia_bindir}/nvidia-persistenced \
-	--slave %{_sysconfdir}/X11/xinit.d/nvidia-settings.xinit nvidia-settings.xinit %{_sysconfdir}/%{drivername}/nvidia-settings.xinit \
-	--slave %{_libdir}/vdpau/libvdpau_nvidia.so.1 %{_lib}vdpau_nvidia.so.1 %{nvidia_libdir}/vdpau/libvdpau_nvidia.so.%{version} \
-	--slave %{_sysconfdir}/OpenCL/vendors/nvidia.icd nvidia.icd %{_sysconfdir}/%{drivername}/nvidia.icd \
-%ifarch %{biarches}
-	--slave %{_prefix}/lib/vdpau/libvdpau_nvidia.so.1 libvdpau_nvidia.so.1 %{nvidia_libdir32}/vdpau/libvdpau_nvidia.so.%{version} \
-%endif
-	--slave %{xorg_extra_modules} xorg_extra_modules %{nvidia_extensionsdir} \
-
-#Line below breaks module loading	
-#	--slave %{_sysconfdir}/modprobe.d/display-driver.conf display-driver.conf %{_sysconfdir}/%{drivername}/modprobe.conf \
-	
-if [ "${current_glconf}" = "%{_sysconfdir}/nvidia97xx/ld.so.conf" ]; then
-	# Adapt for the renaming of the driver. X.org config still has the old ModulePaths
-	# but they do not matter as we are using alternatives for libglx.so now.
-	%{_sbindir}/update-alternatives --set gl_conf %{_sysconfdir}/%{drivername}/ld.so.conf
-fi
-# explicit /sbin/ldconfig due to alternatives
-/sbin/ldconfig -X
-
-
-%if "%{ldetect_cards_name}" != ""
-[ -x %{_sbindir}/update-ldetect-lst ] && %{_sbindir}/update-ldetect-lst || :
-%endif
-
-%postun -n %{driverpkgname}
-if [ ! -f %{_sysconfdir}/%{drivername}/ld.so.conf ]; then
-  %{_sbindir}/update-alternatives --remove gl_conf %{_sysconfdir}/%{drivername}/ld.so.conf
-fi
-# explicit /sbin/ldconfig due to alternatives
-/sbin/ldconfig -X
-/bin/rm -f %{_sysconfdir}/X11/xorg.conf.d/20-nvidia.conf
-
-%if "%{ldetect_cards_name}" != ""
-[ -x %{_sbindir}/update-ldetect-lst ] && %{_sbindir}/update-ldetect-lst || :
-%endif
-
-%post -n %{drivername}-cuda-opencl
-# explicit /sbin/ldconfig due to a non-standard library directory
-/sbin/ldconfig -X
-
-%post -n dkms-%{drivername}
-/usr/sbin/dkms --rpm_safe_upgrade add -m %{drivername} -v %{version}-%{release} &&
-/usr/sbin/dkms --rpm_safe_upgrade build -m %{drivername} -v %{version}-%{release} &&
-/usr/sbin/dkms --rpm_safe_upgrade install -m %{drivername} -v %{version}-%{release} --force
-
-# rmmod any old driver if present and not in use (e.g. by X)
-rmmod nvidia > /dev/null 2>&1 || true
-sed -i '/GRUB_CMDLINE_LINUX_DEFAULT/ s/\"$/ rd.driver.blacklist=nouveau nvidia-drm.modeset=1\"/' /etc/default/grub
-/usr/sbin/grub2-mkconfig -o /boot/grub2/grub.cfg
-
-%preun -n dkms-%{drivername}
-/usr/sbin/dkms --rpm_safe_upgrade remove -m %{drivername} -v %{version}-%{release} --all
-
-# rmmod any old driver if present and not in use (e.g. by X)
-rmmod nvidia > /dev/null 2>&1 || true
-
-%postun -n dkms-%{drivername}
-sed -i 's/ rd.driver.blacklist=nouveau nvidia-drm.modeset=1//' /etc/default/grub
-/usr/sbin/grub2-mkconfig -o /boot/grub2/grub.cfg
-
-%files -n %{driverpkgname} -f %{pkgname}/nvidia.files
-%defattr(-,root,root)
-# other documentation files are listed in nvidia.files
-%doc README.manual-setup
-
-%if "%{ldetect_cards_name}" != ""
-%{_datadir}/ldetect-lst/pcitable.d/40%{drivername}.lst.gz
-%endif
-
-# ld.so.conf, modprobe.conf, xinit
-%ghost %{_sysconfdir}/X11/xinit.d/nvidia-settings.xinit
-%ghost %{_sysconfdir}/modprobe.d/display-driver.conf
-%dir %{_sysconfdir}/%{drivername}
-%{_sysconfdir}/%{drivername}/modprobe.conf
-%{_sysconfdir}/%{drivername}/ld.so.conf
-%{_sysconfdir}/%{drivername}/nvidia-settings.xinit
-%{_sysconfdir}/vulkan/icd.d/nvidia_icd.json.template
-%{_sysconfdir}/X11/xorg.conf.d/20-nvidia.conf
-
-%if !%simple
-%{_sysconfdir}/%{drivername}/nvidia.icd
-%dir %{_datadir}/nvidia
+instx %{_bindir}/nvidia-bug-report.sh
+instx %{_bindir}/nvidia-smi
+inst %{_mandir}/man1/nvidia-smi.1
+
+# glvk
+#instx %{_libdir}/libnvidia-glvkspirv.so.%{version}
+
+# Assorted stuff
+inst %{_datadir}/nvidia/nvidia-application-profiles-%{version}-rc
+inst %{_datadir}/nvidia/nvidia-application-profiles-%{version}-key-documentation
+
+# Configs
+install -D -m 644 %{S:1} %{buildroot}%{_sysconfdir}/X11/xorg.conf.d/15-nvidia.conf
+install -D -m 644 %{S:2} %{buildroot}%{_sysconfdir}/modprobe.d/nvidia.conf
+
+# Kernel modules
+cd kernel
+inst /lib/modules/%{kdir}/kernel/drivers/video/nvidia.ko
+inst /lib/modules/%{kdir}/kernel/drivers/video/nvidia-drm.ko
+inst /lib/modules/%{kdir}/kernel/drivers/video/nvidia-modeset.ko
+inst /lib/modules/%{kdir}/kernel/drivers/video/nvidia-uvm.ko
+
+cd ../kernel-server
+inst /lib/modules/%{skdir}/kernel/drivers/video/nvidia.ko
+inst /lib/modules/%{skdir}/kernel/drivers/video/nvidia-drm.ko
+inst /lib/modules/%{skdir}/kernel/drivers/video/nvidia-modeset.ko
+inst /lib/modules/%{skdir}/kernel/drivers/video/nvidia-uvm.ko
+
+%files
+%{_libdir}/xorg/modules/drivers/nvidia_drv.so
+%{_datadir}/vulkan/icd.d/nvidia_icd.json.template
+%{_libdir}/libnvidia-glcore.so*
+%{_datadir}/glvnd/egl_vendor.d/10_nvidia.json
+#*%{_libdir}/xorg/modules/nvidia/extensions/libglxserver_nvidia.so*
+%{_libdir}/libGLX_nvidia.so*
+%{_libdir}/libEGL_nvidia.so*
+%{_libdir}/libnvidia-eglcore.so*
+%{_libdir}/libGLESv1_CM_nvidia.so*
+%{_libdir}/libGLESv2_nvidia.so*
+%{_libdir}/libnvidia-glsi.so*
+%{_libdir}/libcuda.so*
+%{_libdir}/libnvcuvid.so*
+%{_libdir}/libnvidia-ml.so*
+%{_libdir}/libnvidia-ptxjitcompiler.so*
+%{_libdir}/libnvidia-fatbinaryloader.so*
+%{_libdir}/libnvidia-tls.so*
+%{_sysconfdir}/OpenCL/vendors/nvidia.icd
+%{_libdir}/libnvidia-cfg.so*
+%{_libdir}/libnvidia-compiler.so*
+%{_libdir}/libnvidia-opencl.so*
+%{_libdir}/libnvidia-encode.so*
+%{_libdir}/libnvidia-fbc.so*
+%{_libdir}/libnvidia-gtk2.so*
+%{_libdir}/libnvidia-gtk3.so*
+%{_libdir}/libnvidia-ifr.so*
+%{_libdir}/vdpau/libvdpau_nvidia.so*
+%{_libdir}/libnvidia-egl-wayland.so*
+%{_datadir}/egl/egl_external_platform.d/10_nvidia_wayland.json
+%{_bindir}/nvidia-bug-report.sh
+%{_bindir}/nvidia-smi
+%{_mandir}/man1/nvidia-smi.1*
+#%%{_libdir}/libnvidia-glvkspirv.so*
 %{_datadir}/nvidia/nvidia-application-profiles-%{version}-rc
 %{_datadir}/nvidia/nvidia-application-profiles-%{version}-key-documentation
-#{_datadir}/nvidia/monitoring.conf
-#{_datadir}/nvidia/pci.ids
-%endif
-
-%dir %{_sysconfdir}/OpenCL
-%dir %{_sysconfdir}/OpenCL/vendors
-%ghost %{_sysconfdir}/OpenCL/vendors/nvidia.icd
-
-%ghost %{_bindir}/nvidia-settings
-%ghost %{_bindir}/nvidia-smi
-%ghost %{_bindir}/nvidia-debugdump
-%ghost %{_bindir}/nvidia-xconfig
-%ghost %{_bindir}/nvidia-modprobe
-%ghost %{_bindir}/nvidia-persistenced
-%ghost %{_bindir}/nvidia-bug-report.sh
-%ghost %{_bindir}/nvidia-cuda-mps-control
-%ghost %{_bindir}/nvidia-cuda-mps-server
-%if !%simple
-%dir %{nvidia_bindir}
-%{nvidia_bindir}/nvidia-settings
-%{nvidia_bindir}/nvidia-smi
-%{nvidia_bindir}/nvidia-debugdump
-%{nvidia_bindir}/nvidia-xconfig
-%{nvidia_bindir}/nvidia-modprobe
-%{nvidia_bindir}/nvidia-persistenced
-%{nvidia_bindir}/nvidia-bug-report.sh
-%{nvidia_bindir}/nvidia-cuda-mps-control
-%{nvidia_bindir}/nvidia-cuda-mps-server
-%endif
-
-%ghost %{_mandir}/man1/nvidia-xconfig.1%{_extension}
-%ghost %{_mandir}/man1/nvidia-settings.1%{_extension}
-%ghost %{_mandir}/man1/nvidia-modprobe.1%{_extension}
-%ghost %{_mandir}/man1/nvidia-persistenced.1%{_extension}
-%ghost %{_mandir}/man1/nvidia-smi.1%{_extension}
-%ghost %{_mandir}/man1/nvidia-cuda-mps-control.1%{_extension}
-%if !%simple
-%{_mandir}/man1/alt-%{drivername}-xconfig.1*
-%{_mandir}/man1/alt-%{drivername}-settings.1*
-%{_mandir}/man1/alt-%{drivername}-modprobe.1*
-%{_mandir}/man1/alt-%{drivername}-persistenced.1*
-%{_mandir}/man1/alt-%{drivername}-smi.1*
-%{_mandir}/man1/alt-%{drivername}-cuda-mps-control.1*
-%else
-%{_mandir}/man1/alt-%{drivername}-*
-%endif
-
-%ghost %{_datadir}/applications/%{disttag}-nvidia-settings.desktop
-%dir %{_datadir}/%{drivername}
-%{_datadir}/%{drivername}/%{disttag}-nvidia-settings.desktop
-
-%if !%simple
-%{_iconsdir}/hicolor/16x16/apps/%{drivername}-settings.png
-%{_iconsdir}/hicolor/32x32/apps/%{drivername}-settings.png
-%endif
-%{_iconsdir}/hicolor/48x48/apps/%{drivername}-settings.png
-
-%if !%simple
-%dir %{nvidia_libdir}
-%dir %{nvidia_libdir}/tls
-%dir %{nvidia_libdir}/vdpau
-%{nvidia_libdir}/tls/libnvidia-tls.so.%{version}
-%{nvidia_libdir}/libGL.so.%{version}
-%{nvidia_libdir}/libnvidia-eglcore.so.%{version}
-%{nvidia_libdir}/libnvidia-egl-wayland.so.*
-%{nvidia_libdir}/libnvidia-glsi.so.%{version}
-%{nvidia_libdir}/libnvidia-gtk2.so.%{version}
-%{nvidia_libdir}/libnvidia-gtk3.so.%{version}
-%{nvidia_libdir}/libnvidia-glcore.so.%{version}
-%{nvidia_libdir}/libnvidia-cfg.so.%{version}
-%{nvidia_libdir}/libnvidia-fbc.so.%{version}
-%{nvidia_libdir}/libnvidia-ifr.so.%{version}
-%{nvidia_libdir}/libnvidia-ml.so.%{version}
-%{nvidia_libdir}/libnvidia-ptxjitcompiler.so.%{version}
-%{nvidia_libdir}/vdpau/libvdpau_nvidia.so.%{version}
-%{nvidia_libdir}/libGL.so.1
-%{nvidia_libdir}/libGLdispatch.so.0
-%{nvidia_libdir}/libEGL.so.1
-%{nvidia_libdir}/libEGL.so.%{version}
-%{nvidia_libdir}/libEGL_nvidia.so.0
-%{nvidia_libdir}/libEGL_nvidia.so.%{version}
-%{nvidia_libdir}/libGLESv*.%{version}*
-%{nvidia_libdir}/libGLESv*.so.1*
-%{nvidia_libdir}/libGLESv*.so.2*
-%{nvidia_libdir}/libGLX_indirect.so.0
-%{nvidia_libdir}/libGLX_nvidia.so.0
-%{nvidia_libdir}/libGLX_nvidia.so.%{version}
-%{nvidia_libdir}/libOpenGL.so.0
-%{nvidia_libdir}/libnvidia-cfg.so.1
-%{nvidia_libdir}/libnvidia-fbc.so.1
-%{nvidia_libdir}/libnvidia-ifr.so.1
-%{nvidia_libdir}/libnvidia-ml.so.1
-%{nvidia_libdir}/libvdpau_nvidia.so
-%{nvidia_libdir}/libnvidia-tls.so.%{version}
-%{nvidia_libdir}/libnvidia-ptxjitcompiler.so
-%{nvidia_libdir}/libnvidia-ptxjitcompiler.so.1
-# %simple
-%endif
-
-%ghost %{_libdir}/vdpau/libvdpau_nvidia.so.1
-%ifarch %{biarches}
-# avoid unowned directory
-%dir %{_prefix}/lib/vdpau
-%ghost %{_prefix}/lib/vdpau/libvdpau_nvidia.so.1
-%endif
-
-%if !%simple
-# 2009.1+ (/usr/lib/drivername/xorg)
-%dir %{nvidia_modulesdir}
-%{nvidia_modulesdir}/libnvidia-wfb.so.1
-%endif
-
-%if !%simple
-%{nvidia_modulesdir}/libnvidia-wfb.so.%{version}
-%endif
-
-%if !%simple
-%{nvidia_extensionsdir}/libglx.so.%%{version}
-%{nvidia_extensionsdir}/libglx.so
-%endif
-
-%if !%simple
-%{nvidia_driversdir}/nvidia_drv.so
-%endif
-
-%ifarch %{biarches}
-%files -n %{driverpkgname}-32bit
-%dir %{nvidia_libdir32}
-%dir %{nvidia_libdir32}/tls
-%dir %{nvidia_libdir32}/vdpau
-%{nvidia_libdir32}/libGL.so.%{version}
-%{nvidia_libdir32}/libEGL_nvidia.so.0
-%{nvidia_libdir32}/libEGL_nvidia.so.%{version}
-%{nvidia_libdir32}/libnvidia-glcore.so.%{version}
-%{nvidia_libdir32}/libnvidia-eglcore.so.%{version}
-%{nvidia_libdir32}/libnvidia-fatbinaryloader.so.%{version}
-%{nvidia_libdir32}/libnvidia-glsi.so.%{version}
-%{nvidia_libdir32}/libnvidia-tls.so.%{version}
-%{nvidia_libdir32}/libnvidia-ptxjitcompiler.so.%{version}
-%{nvidia_libdir32}/libvdpau_nvidia.so
-%{nvidia_libdir32}/vdpau/libvdpau_nvidia.so.%{version}
-%{nvidia_libdir32}/libnvidia-ml.so.%{version}
-%{nvidia_libdir32}/libnvidia-ml.so.1
-%{nvidia_libdir32}/libnvidia-ifr.so.%{version}
-%{nvidia_libdir32}/libnvidia-ifr.so.1
-%{nvidia_libdir32}/libnvidia-fbc.so.%{version}
-%{nvidia_libdir32}/libnvidia-fbc.so.1
-%{nvidia_libdir32}/libGL.so.1
-%{nvidia_libdir32}/libGLdispatch.so.0
-%{nvidia_libdir32}/libEGL.so.1
-%{nvidia_libdir32}/libEGL.so.%{version}
-%{nvidia_libdir32}/libGLESv*.%{version}*
-%{nvidia_libdir32}/libGLESv*.so.1*
-%{nvidia_libdir32}/libGLESv*.so.2*
-%{nvidia_libdir32}/libGLX_indirect.so.0
-%{nvidia_libdir32}/libGLX_nvidia.so.0
-%{nvidia_libdir32}/libGLX_nvidia.so.%{version}
-%{nvidia_libdir32}/libOpenGL.so.0
-%{nvidia_libdir32}/tls/libnvidia-tls.so.%%{version}
-%{nvidia_libdir32}/libnvidia-ptxjitcompiler.so
-%{nvidia_libdir32}/libnvidia-ptxjitcompiler.so.1
-%endif
-
-#%%files -n %{drivername}-devel -f %pkgname/nvidia-devel.files
-%files -n %{drivername}-devel
-%defattr(-,root,root)
-%if !%simple
-%{_includedir}/%{drivername}/GL
-%{nvidia_libdir}/libGL.so
-%{nvidia_libdir}/libEGL.so
-%{nvidia_libdir}/libGLESv*.so
-%{nvidia_libdir}/libcuda.so
-%{nvidia_libdir}/libnvcuvid.so
-%{nvidia_libdir}/libnvidia-cfg.so
-%{nvidia_libdir}/libnvidia-fbc.so
-%{nvidia_libdir}/libnvidia-ifr.so
-%{nvidia_libdir}/libnvidia-ml.so
-%{nvidia_libdir}/libOpenCL.so
-%{nvidia_libdir}/libOpenGL.so
-%{nvidia_libdir}/libnvidia-encode.so
-%ifarch %{biarches}
-%{nvidia_libdir32}/libGL.so
-%{nvidia_libdir32}/libEGL.so
-%{nvidia_libdir32}/libGLESv*.so
-%{nvidia_libdir32}/libcuda.so
-%{nvidia_libdir32}/libOpenCL.so
-%{nvidia_libdir32}/libOpenGL.so
-%{nvidia_libdir32}/libnvidia-ml.so
-%{nvidia_libdir32}/libnvidia-fbc.so
-%{nvidia_libdir32}/libnvidia-ifr.so
-%{nvidia_libdir32}/libnvcuvid.so
-%{nvidia_libdir32}/libnvidia-encode.so
-%endif
-%endif
-
-%files -n dkms-%{drivername}
-%defattr(-,root,root)
-%{_sysconfdir}/modprobe.d/blacklist-nouveau.conf
-%doc %{pkgname}/LICENSE
-%{_usrsrc}/%{drivername}-%{version}-%{release}
-
-%files -n %{drivername}-doc-html -f %pkgname/nvidia-html.files
-%defattr(-,root,root)
-
-#%files -n %{drivername}-cuda-opencl -f %pkgname/nvidia-cuda.files
-%files -n %{drivername}-cuda-opencl
-%defattr(-,root,root)
-%if !%simple
-%{nvidia_libdir}/libOpenCL.so.1.0.0
-%{nvidia_libdir}/libOpenCL.so.1.0
-%{nvidia_libdir}/libOpenCL.so.1
-%{nvidia_libdir}/libnvidia-compiler.so.%{version}
-%{nvidia_libdir}/libcuda.so.%{version}
-%{nvidia_libdir}/libcuda.so.1
-%{nvidia_libdir}/libnvidia-opencl.so.%{version}
-%{nvidia_libdir}/libnvidia-opencl.so.1
-%{nvidia_libdir}/libnvidia-encode.so.%{version}
-%{nvidia_libdir}/libnvidia-encode.so.1
-%{nvidia_libdir}/libnvcuvid.so.%{version}
-%{nvidia_libdir}/libnvcuvid.so.1
-%{nvidia_libdir}/libnvidia-fatbinaryloader.so.%{version}
-%ifarch %{biarches}
-%{nvidia_libdir32}/libOpenCL.so.1.0.0
-%{nvidia_libdir32}/libOpenCL.so.1.0
-%{nvidia_libdir32}/libOpenCL.so.1
-%{nvidia_libdir32}/libnvidia-compiler.so.%{version}
-%{nvidia_libdir32}/libnvidia-opencl.so.%{version}
-%{nvidia_libdir32}/libnvidia-opencl.so.1
-%{nvidia_libdir32}/libnvidia-encode.so.%{version}
-%{nvidia_libdir32}/libnvidia-encode.so.1
-%{nvidia_libdir32}/libnvcuvid.so.%{version}
-%{nvidia_libdir32}/libnvcuvid.so.1
-%{nvidia_libdir32}/libcuda.so.%{version}
-%{nvidia_libdir32}/libcuda.so.1
-%endif
+%{_sysconfdir}/X11/xorg.conf.d/15-nvidia.conf
+%{_sysconfdir}/modprobe.d/nvidia.conf
+
+%ifarch %{x86_64}
+%files 32bit
+%{_prefix}/lib/libnvidia-glcore.so*
+%{_prefix}/lib/libGLX_nvidia.so*
+%{_prefix}/lib/libEGL_nvidia.so*
+%{_prefix}/lib/libnvidia-eglcore.so*
+%{_prefix}/lib/libGLESv1_CM_nvidia.so*
+%{_prefix}/lib/libGLESv2_nvidia.so*
+%{_prefix}/lib/libnvidia-glsi.so*
+%{_prefix}/lib/libcuda.so*
+%{_prefix}/lib/libnvcuvid.so*
+%{_prefix}/lib/libnvidia-ml.so*
+%{_prefix}/lib/libnvidia-ptxjitcompiler.so*
+%{_prefix}/lib/libnvidia-fatbinaryloader.so*
+%{_prefix}/lib/libnvidia-tls.so*
+%{_prefix}/lib/libnvidia-compiler.so*
+%{_prefix}/lib/libnvidia-opencl.so*
+%{_prefix}/lib/libnvidia-encode.so*
+%{_prefix}/lib/libnvidia-fbc.so*
+%{_prefix}/lib/libnvidia-ifr.so*
+%{_prefix}/lib/vdpau/libvdpau_nvidia.so*
+#%%{_prefix}/lib/libnvidia-glvkspirv.so*
+%endif
+
+%files kernel-modules-desktop
+/lib/modules/%{kdir}/kernel/drivers/video/*
+
+%post kernel-modules-desktop
+sed -i 's/GRUB_CMDLINE_LINUX_DEFAULT="/GRUB_CMDLINE_LINUX_DEFAULT="rd.driver.blacklist=nouveau /' %{_sysconfdir}/default/grub
+/sbin/depmod -a %{kdir}
+/usr/bin/dracut -f --kver %{kdir}
+%{_sbindir}/update-grub2
+
+%postun kernel-modules-desktop
+sed -i 's/rd.driver.blacklist=nouveau //g' %{_sysconfdir}/default/grub
+/sbin/depmod -a %{kdir}
+/usr/bin/dracut -f --kver %{kdir}
+%{_sbindir}/update-grub2
+
+%files kernel-modules-server
+/lib/modules/%{skdir}/kernel/drivers/video/*
+
+%post kernel-modules-server
+sed -i 's/GRUB_CMDLINE_LINUX_DEFAULT="/GRUB_CMDLINE_LINUX_DEFAULT="rd.driver.blacklist=nouveau /' %{_sysconfdir}/default/grub
+/sbin/depmod -a %{skdir}
+/usr/bin/dracut -f --kver %{skdir}
+%{_sbindir}/update-grub2
+
+%postun kernel-modules-server
+sed -i 's/rd.driver.blacklist=nouveau //g' %{_sysconfdir}/default/grub
+/sbin/depmod -a %{skdir}
+/usr/bin/dracut -f --kver %{skdir}
+%{_sbindir}/update-grub2
+
+%if %{with kernel_rc}
+%files kernel-modules-rc-desktop
+/lib/modules/%{rkdir}/kernel/drivers/video/*
+
+%post kernel-modules-rc-desktop
+sed -i 's/GRUB_CMDLINE_LINUX_DEFAULT="/GRUB_CMDLINE_LINUX_DEFAULT="rd.driver.blacklist=nouveau /' %{_sysconfdir}/default/grub
+/sbin/depmod -a %{rkdir}
+/usr/bin/dracut -f --kver %{rkdir}
+%{_sbindir}/update-grub2
+
+%postun kernel-modules-rc-desktop
+sed -i 's/rd.driver.blacklist=nouveau //g' %{_sysconfdir}/default/grub
+/sbin/depmod -a %{rkdir}
+/usr/bin/dracut -f --kver %{rkdir}
+%{_sbindir}/update-grub2
+
+%files kernel-modules-rc-server
+/lib/modules/%{rskdir}/kernel/drivers/video/*
+
+%post kernel-modules-rc-server
+sed -i 's/GRUB_CMDLINE_LINUX_DEFAULT="/GRUB_CMDLINE_LINUX_DEFAULT="rd.driver.blacklist=nouveau /' %{_sysconfdir}/default/grub
+/sbin/depmod -a %{rkdir}
+/usr/bin/dracut -f --kver %{rskdir}
+%{_sbindir}/update-grub2
+
+%postun kernel-modules-rc-server
+sed -i 's/rd.driver.blacklist=nouveau //g' %{_sysconfdir}/default/grub
+/sbin/depmod -a %{rskdir}
+/usr/bin/dracut -f --kver %{rskdir}
+%{_sbindir}/update-grub2
 %endif
diff --git a/nvidia-persistenced-319.17-add-missing-libtirpc-link.patch b/nvidia-persistenced-319.17-add-missing-libtirpc-link.patch
deleted file mode 100644
index 56b10ac..0000000
--- a/nvidia-persistenced-319.17-add-missing-libtirpc-link.patch
+++ /dev/null
@@ -1,12 +0,0 @@
-diff -Naur nvidia-persistenced-319.17/Makefile nvidia-persistenced-319.17.tpg/Makefile
---- nvidia-persistenced-319.17/Makefile	2013-04-26 05:01:28.000000000 +0000
-+++ nvidia-persistenced-319.17.tpg/Makefile	2013-05-15 14:59:29.453686110 +0000
-@@ -102,7 +102,7 @@
- HOST_CFLAGS += $(common_cflags)
- 
- ifneq ($(TARGET_OS),FreeBSD)
--  LIBS += -ldl
-+  LIBS += -ldl -ltirpc
- endif
- 
- ##############################################################################
diff --git a/nvidia-settings-include-xf86vmproto.patch b/nvidia-settings-include-xf86vmproto.patch
deleted file mode 100644
index b5ce252..0000000
--- a/nvidia-settings-include-xf86vmproto.patch
+++ /dev/null
@@ -1,14 +0,0 @@
-Index: nvidia-settings-1.0/src/libXNVCtrlAttributes/NvCtrlAttributesVidMode.c
-===================================================================
---- nvidia-settings-1.0/src/libXNVCtrlAttributes/NvCtrlAttributesVidMode.c
-+++ nvidia-settings-1.0/src/libXNVCtrlAttributes/NvCtrlAttributesVidMode.c	2009-12-19 06:13:18.737672555 +0200
-@@ -28,6 +28,9 @@
- #include "msg.h"
- 
- #include <X11/extensions/xf86vmode.h>
-+#ifndef X_XF86VidModeGetGammaRampSize
-+#include <X11/extensions/xf86vmproto.h>
-+#endif
- 
- #include <stdlib.h>
- #include <string.h>
diff --git a/xorg-nvidia.conf b/xorg-nvidia.conf
new file mode 100644
index 0000000..689ba3b
--- /dev/null
+++ b/xorg-nvidia.conf
@@ -0,0 +1,12 @@
+Section "OutputClass"
+    Identifier "nvidia"
+    MatchDriver "nvidia-drm"
+    Driver "nvidia"
+    Option "AllowEmptyInitialConfiguration"
+    Option "PrimaryGPU" "yes"
+    ModulePath "/usr/lib/xorg/modules/nvidia/extensions"
+EndSection
+
+Section "ServerFlags"
+	Option  "IgnoreABI" "True"
+EndSection
Not Available
benbullard79 [@T] cox.netNo Comment.17d 05hrs
benbullard79 [@T] cox.netNo Comment.17d 05hrs