The backup directory path is hardcoded as #define BACKUP_DIRECTORY "/var/lib/nvidia" in backup.c. During RPM packaging in a mock chroot, the build user (mockbuild) cannot write to /var/lib/ (root-owned, 0755), causing the installer to fail.
Currently we work around this by binary-patching the installer with sed -i 's|/var/lib/nvidia|/var/tmp/nvidia|g' nvidia-installer, which is not great.
Would it be possible to add an option like --state-dir=/path or --backup-dir=/path to make this configurable? This would complement a --destdir option. But even without --destdir, having a way to relocate the state directory would help packaging use cases.