-# TODO:
-# - use system jansson >= 2.6 library
#
# Conditional build:
+%bcond_without gtk3 # GTK+ 3.x GUI library for nvidia-settings
%bcond_without nvidia_settings # build the main package
%bcond_without utils # build utils from samples dir
%bcond_without libXNVCtrl # build libXNVCtrl for external packages
Summary(pl.UTF-8): Narzędzie do konfigurowania sterownika NVIDIA
Name: nvidia-settings
# keep the version in sync with xorg-driver-video-nvidia.spec
-Version: 340.46
+Version: 415.23
Release: 1
License: GPL v2 (with MIT parts)
Group: X11/Applications
-Source0: ftp://download.nvidia.com/XFree86/nvidia-settings/%{name}-%{version}.tar.bz2
-# Source0-md5: 778c3841694544a371cfb92e97d18368
+Source0: https://download.nvidia.com/XFree86/nvidia-settings/%{name}-%{version}.tar.bz2
+# Source0-md5: a008805b7715898d325455b58155a3d4
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: libvdpau-devel >= 1.0
BuildRequires: xorg-lib-libX11-devel
BuildRequires: xorg-lib-libXext-devel
BuildRequires: xorg-lib-libXv-devel
BuildRequires: xorg-lib-libXxf86vm-devel
%if %{with nvidia_settings}
BuildRequires: gtk+2-devel >= 2.0
+%{?with_gtk3:BuildRequires: gtk+3-devel >= 3.0}
BuildRequires: jansson-devel >= 2.2
BuildRequires: m4
BuildRequires: pkgconfig
%endif
+Requires: %{name}-guilib = %{version}-%{release}
+Requires: libvdpau >= 1.0
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
+# requires symbols from main binary
+%define skip_post_check_so libnvidia-gtk[23].so.*
+
%description
The nvidia-settings utility is a tool for configuring the NVIDIA Linux
graphics driver. It operates by communicating with the NVIDIA X
ustawień. Przy wyłączniu nvidia-settings odczytuje bieżące ustawienia
z serwera X i zapisuje je do pliku konfiguracyjnego.
+%package gtk2
+Summary: GTK+ 2.x GUI library for nvidia-settings
+Summary(pl.UTF-8): Biblioteka interfejsu graficznego GTK+ 2.x dla nvidia-settings
+Group: X11/Libraries
+Requires: %{name} = %{version}-%{release}
+Provides: %{name}-guilib = %{version}-%{release}
+
+%description gtk2
+GTK+ 2.x GUI library for nvidia-settings.
+
+%description gtk2 -l pl.UTF-8
+Biblioteka interfejsu graficznego GTK+ 2.x dla nvidia-settings.
+
+%package gtk3
+Summary: GTK+ 3.x GUI library for nvidia-settings
+Summary(pl.UTF-8): Biblioteka interfejsu graficznego GTK+ 3.x dla nvidia-settings
+Group: X11/Libraries
+Requires: %{name} = %{version}-%{release}
+Provides: %{name}-guilib = %{version}-%{release}
+
+%description gtk3
+GTK+ 3.x GUI library for nvidia-settings.
+
+%description gtk3 -l pl.UTF-8
+Biblioteka interfejsu graficznego GTK+ 3.x dla nvidia-settings.
+
%package -n libXNVCtrl-devel
Summary: libXNVCtrl development files
Summary(pl.UTF-8): Pliki programistyczne biblioteki libXNVCtrl
%if %{with nvidia_settings}
%{__make} -C src \
+ %{!?with_gtk3:BUILD_GTK3LIB=} \
NV_USE_BUNDLED_LIBJANSSON=0 \
NV_VERBOSE=1 \
STRIP_CMD=: \
NV_USE_BUNDLED_LIBJANSSON=0 \
NV_VERBOSE=1 \
INSTALL="install -p" \
+ LIBDIR="$RPM_BUILD_ROOT%{_libdir}" \
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
+
+# let RPM autogenerate deps
+chmod 755 $RPM_BUILD_ROOT%{_libdir}/lib*.so*
%endif
%if %{with libXNVCtrl}
%clean
rm -rf $RPM_BUILD_ROOT
+%post gtk2 -p /sbin/ldconfig
+%postun gtk2 -p /sbin/ldconfig
+
+%post gtk3 -p /sbin/ldconfig
+%postun gtk3 -p /sbin/ldconfig
+
%if %{with nvidia_settings}
%files
%defattr(644,root,root,755)
%{_desktopdir}/nvidia-settings.desktop
%{_pixmapsdir}/nvidia-settings.png
/etc/xdg/autostart/%{name}.desktop
+
+%files gtk2
+%defattr(644,root,root,755)
+%attr(755,root,root) %{_libdir}/libnvidia-gtk2.so.%{version}
+
+%if %{with gtk3}
+%files gtk3
+%defattr(644,root,root,755)
+%attr(755,root,root) %{_libdir}/libnvidia-gtk3.so.%{version}
+%endif
%endif
%if %{with libXNVCtrl}