#
# Conditional build:
%bcond_without nvidia_settings # build the main package
+%bcond_without utils # build utils from samples dir
%bcond_without libXNVCtrl # build libXNVCtrl for http://websvn.kde.org/trunk/kdenonbeta/nvidia/
Summary: Tool for configuring the NVIDIA driver
Summary(pl.UTF-8): Narzędzie do konfigurowania sterownika NVIDIA
Name: nvidia-settings
-Version: 295.40
+# keep the version in sync with xorg-driver-video-nvidia.spec
+Version: 331.20
Release: 1
License: GPL
Group: X11
Source0: ftp://download.nvidia.com/XFree86/nvidia-settings/%{name}-%{version}.tar.bz2
-# Source0-md5: e9fd5dcb7f69c12334d199a783544d42
+# Source0-md5: bbe5b7beaedb274d4dc81640f8e561ce
Source1: %{name}.desktop
Source2: %{name}.png
+Source3: %{name}-autostart.desktop
URL: ftp://download.nvidia.com/XFree86/nvidia-settings/
BuildRequires: OpenGL-devel
+BuildRequires: libvdpau-devel
BuildRequires: xorg-lib-libX11-devel
BuildRequires: xorg-lib-libXext-devel
BuildRequires: xorg-lib-libXv-devel
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
%description
-The `nvidia-settings` utility is a tool for configuring the NVIDIA
-Linux graphics driver. It operates by communicating with the NVIDIA X
+The nvidia-settings utility is a tool for configuring the NVIDIA Linux
+graphics driver. It operates by communicating with the NVIDIA X
driver, querying and updating state as appropriate. This communication
is done with the NV-CONTROL X extension.
X_CFLAGS="%{rpmcppflags} %{rpmcflags} -fPIC"
%endif
+%if %{with utils}
+%{__make} -C samples \
+ NV_VERBOSE=1 \
+ CC="%{__cc}" \
+ OUTPUTDIR=$(pwd)/_out/utils \
+ X_CFLAGS="%{rpmcppflags} %{rpmcflags} -fPIC"
+%endif
+
%if %{with nvidia_settings}
%{__make} \
NV_VERBOSE=1 \
%install
rm -rf $RPM_BUILD_ROOT
%if %{with nvidia_settings}
-install -d $RPM_BUILD_ROOT{%{_bindir},%{_mandir}/man1,%{_desktopdir},%{_pixmapsdir}}
+install -d $RPM_BUILD_ROOT{%{_bindir},%{_mandir}/man1,%{_desktopdir},%{_pixmapsdir},/etc/xdg/autostart}
%{__make} install \
INSTALL="install -p" \
- prefix=$RPM_BUILD_ROOT%{_prefix}
+ PREFIX=%{_prefix} \
+ DESTDIR=$RPM_BUILD_ROOT
cp -p %{SOURCE1} $RPM_BUILD_ROOT%{_desktopdir}
cp -p %{SOURCE2} $RPM_BUILD_ROOT%{_pixmapsdir}
+cp -p %{SOURCE3} $RPM_BUILD_ROOT/etc/xdg/autostart/%{name}.desktop
%endif
%if %{with libXNVCtrl}
install -d $RPM_BUILD_ROOT%{_examplesdir}/libXNVCtrl-%{version} \
$RPM_BUILD_ROOT{%{_libdir},%{_includedir}/NVCtrl}
cp -a samples/* $RPM_BUILD_ROOT%{_examplesdir}/libXNVCtrl-%{version}
+rm -r $RPM_BUILD_ROOT%{_examplesdir}/libXNVCtrl-%{version}/_out
+cp -p src/libXNVCtrl/nv_control.h $RPM_BUILD_ROOT%{_includedir}/NVCtrl
cp -p src/libXNVCtrl/NVCtrl.h $RPM_BUILD_ROOT%{_includedir}/NVCtrl
cp -p src/libXNVCtrl/NVCtrlLib.h $RPM_BUILD_ROOT%{_includedir}/NVCtrl
cp -p src/libXNVCtrl/libXNVCtrl.a $RPM_BUILD_ROOT%{_libdir}
+
+install -d $RPM_BUILD_ROOT%{_pkgconfigdir}
+cat <<'EOF' > $RPM_BUILD_ROOT%{_pkgconfigdir}/libXNVCtrl.pc
+prefix=%{_prefix}
+libdir=%{_libdir}
+includedir=${prefix}/include/NVCtrl
+
+Name: libXNVCtrl
+Description: Library for accessing NV-CONTROL extension in NVIDIA's latest drivers.
+Version: %{version}
+Libs: -L${libdir} -lXNVCtrl
+Cflags: -I${includedir}
+EOF
+#'
+%endif
+
+%if %{with utils}
+install -d $RPM_BUILD_ROOT%{_bindir}
+for prog in _out/utils/nv-control-*; do
+ case "$prog" in
+ *.*)
+ continue
+ ;;
+ esac
+ install -p $prog $RPM_BUILD_ROOT%{_bindir}
+done
%endif
%clean
%{_mandir}/man1/nvidia-settings.1*
%{_desktopdir}/nvidia-settings.desktop
%{_pixmapsdir}/nvidia-settings.png
+/etc/xdg/autostart/%{name}.desktop
+%endif
+
+%if %{with utils}
+%attr(755,root,root) %{_bindir}/nv-control-3dvisionpro
+%attr(755,root,root) %{_bindir}/nv-control-dpy
+%attr(755,root,root) %{_bindir}/nv-control-dvc
+%attr(755,root,root) %{_bindir}/nv-control-events
+%attr(755,root,root) %{_bindir}/nv-control-framelock
+%attr(755,root,root) %{_bindir}/nv-control-gvi
+%attr(755,root,root) %{_bindir}/nv-control-info
+%attr(755,root,root) %{_bindir}/nv-control-targets
+%attr(755,root,root) %{_bindir}/nv-control-warpblend
%endif
%if %{with libXNVCtrl}
%files -n libXNVCtrl-devel
%defattr(644,root,root,755)
%doc doc/{FRAMELOCK,NV-CONTROL-API}.txt
-%dir %{_includedir}/NVCtrl
-%{_includedir}/NVCtrl/NVCtrl.h
-%{_includedir}/NVCtrl/NVCtrlLib.h
%{_libdir}/libXNVCtrl.a
+%{_includedir}/NVCtrl
+%{_pkgconfigdir}/libXNVCtrl.pc
%{_examplesdir}/libXNVCtrl-%{version}
%endif