Author: kwizart
Update of /cvs/nonfree/rpms/xorg-x11-drv-nvidia/devel
In directory old02.ovh.rpmfusion.lan:/tmp/cvs-serv8975
Modified Files:
xorg-x11-drv-nvidia.spec
Log Message:
Only install systemd service on RHEL7 Fedora 15 and laters
Index: xorg-x11-drv-nvidia.spec
===================================================================
RCS file: /cvs/nonfree/rpms/xorg-x11-drv-nvidia/devel/xorg-x11-drv-nvidia.spec,v
retrieving revision 1.116
retrieving revision 1.117
diff -u -r1.116 -r1.117
--- xorg-x11-drv-nvidia.spec 20 Aug 2013 17:35:08 -0000 1.116
+++ xorg-x11-drv-nvidia.spec 20 Aug 2013 17:42:25 -0000 1.117
@@ -22,10 +22,12 @@
Source6: blacklist-nouveau.conf
BuildRequires: desktop-file-utils
+%if 0%{?rhel} > 6 || 0%{?fedora} >= 15
Buildrequires: systemd
Requires(post): systemd
Requires(preun): systemd
Requires(postun): systemd
+%endif
ExclusiveArch: i686 x86_64 armv7hl
@@ -230,11 +232,13 @@
#Install the initscript
tar jxf nvidia-persistenced-init.tar.bz2
+%if 0%{?rhel} > 6 || 0%{?fedora} >= 15
mkdir -p $RPM_BUILD_ROOT%{_unitdir}
install -pm 0644 nvidia-persistenced-init/systemd/nvidia-persistenced.service.template \
$RPM_BUILD_ROOT%{_unitdir}/nvidia-persistenced.service
#Change the daemon running owner
sed -i -e "s/__USER__/root/"
$RPM_BUILD_ROOT%{_unitdir}/nvidia-persistenced.service
+%endif
#Create the default nvidia config directory
mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/nvidia
@@ -269,7 +273,9 @@
&>/dev/null
done
fi
+%if 0%{?rhel} > 6 || 0%{?fedora} >= 15
/bin/systemctl daemon-reload >/dev/null 2>&1 || :
+%endif
fi || :
%triggerpostun -- xorg-x11-drv-nvidia < 1:%{version}-5
@@ -321,20 +327,24 @@
done
fi
+%if 0%{?rhel} > 6 || 0%{?fedora} >= 15
/bin/systemctl --no-reload disable nvidia-persistenced.service > /dev/null
2>&1 || :
/bin/systemctl stop nvidia-persistenced.service > /dev/null 2>&1 || :
+%endif
#Backup and disable previously used xorg.conf
[ -f %{_sysconfdir}/X11/xorg.conf ] && \
mv %{_sysconfdir}/X11/xorg.conf %{_sysconfdir}/X11/xorg.conf.%{name}_uninstalled
&>/dev/null
fi ||:
+%if 0%{?rhel} > 6 || 0%{?fedora} >= 15
%postun
/bin/systemctl daemon-reload >/dev/null 2>&1 || :
if [ $1 -ge 1 ] ; then
# Package upgrade, not uninstall
/bin/systemctl try-restart nvidia-persistenced.service >/dev/null 2>&1 ||
:
fi
+%endif
%postun libs -p /sbin/ldconfig
@@ -354,7 +364,9 @@
%config %{_sysconfdir}/X11/xorg.conf.d/00-nvidia.conf
%config(noreplace) %{_prefix}/lib/modprobe.d/blacklist-nouveau.conf
%config(noreplace) %{_sysconfdir}/X11/nvidia-xorg.conf
+%if 0%{?rhel} > 6 || 0%{?fedora} >= 15
%{_unitdir}/nvidia-persistenced.service
+%endif
%{_bindir}/nvidia-bug-report.sh
%{_bindir}/nvidia-debugdump
%{_bindir}/nvidia-smi