3 %bcond_without gtk3 # GTK+ 3.x GUI library for nvidia-settings
4 %bcond_without nvidia_settings # build the main package
5 %bcond_without utils # build utils from samples dir
6 %bcond_without libXNVCtrl # build libXNVCtrl for external packages
8 Summary: Tool for configuring the NVIDIA driver
9 Summary(pl.UTF-8): Narzędzie do konfigurowania sterownika NVIDIA
11 # keep the version in sync with xorg-driver-video-nvidia.spec
14 License: GPL v2 (with MIT parts)
15 Group: X11/Applications
16 Source0: https://download.nvidia.com/XFree86/nvidia-settings/%{name}-%{version}.tar.bz2
17 # Source0-md5: 4d1b7bf13b934d53081807de4d5b89d4
18 Source1: %{name}.desktop
20 Source3: %{name}-autostart.desktop
22 URL: ftp://download.nvidia.com/XFree86/nvidia-settings/
23 BuildRequires: OpenGL-devel
24 BuildRequires: libvdpau-devel >= 1.0
25 BuildRequires: xorg-lib-libX11-devel
26 BuildRequires: xorg-lib-libXext-devel
27 BuildRequires: xorg-lib-libXv-devel
28 BuildRequires: xorg-lib-libXxf86vm-devel
29 %if %{with nvidia_settings}
30 BuildRequires: gtk+2-devel >= 2.0
31 %{?with_gtk3:BuildRequires: gtk+3-devel >= 3.0}
32 BuildRequires: jansson-devel >= 2.2
34 BuildRequires: pkgconfig
35 BuildRequires: wayland-devel
37 Requires: %{name}-guilib = %{version}-%{release}
38 Requires: libvdpau >= 1.0
39 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
41 # requires symbols from main binary
42 %define skip_post_check_so libnvidia-gtk[23].so.*
45 The nvidia-settings utility is a tool for configuring the NVIDIA Linux
46 graphics driver. It operates by communicating with the NVIDIA X
47 driver, querying and updating state as appropriate. This communication
48 is done with the NV-CONTROL X extension.
50 Values such as brightness and gamma, XVideo attributes, temperature,
51 and OpenGL settings can be queried and configured via nvidia-settings.
53 When nvidia-settings starts, it reads the current settings from its
54 configuration file and sends those settings to the X server. Then, it
55 displays a graphical user interface (GUI) interface for configuring
56 the current settings. When nvidia-settings exits, it queries the
57 current settings from the X server and saves them to the configuration
60 %description -l pl.UTF-8
61 Narzędzie nvidia-settings służy do konfiguracji sterownika do kart
62 graficznych firmy NVIDIA. Działa komunikując się ze sterownikiem X
63 NVIDIA, sprawdzając i uaktualniając stan w razie potrzeby. Komunikacja
64 odbywa się poprzez rozszerzenie X NV-CONTROL.
66 Za pomocą nvidia-settings można odczytywać i zmieniać wartości takie
67 jak jasność i korekcja gamma, atrybuty XVideo, temperatura barw i
70 Przy uruchamianiu nvidia-settings odczytuje bieżące ustawienia z pliku
71 konfiguracyjnego i wysyła te ustawienia do serwera X. Następnie
72 wyświetla graficzny interfejs użytkownika (GUI) do konfiguracji
73 ustawień. Przy wyłączniu nvidia-settings odczytuje bieżące ustawienia
74 z serwera X i zapisuje je do pliku konfiguracyjnego.
77 Summary: GTK+ 2.x GUI library for nvidia-settings
78 Summary(pl.UTF-8): Biblioteka interfejsu graficznego GTK+ 2.x dla nvidia-settings
80 Requires: %{name} = %{version}-%{release}
81 Provides: %{name}-guilib = %{version}-%{release}
84 GTK+ 2.x GUI library for nvidia-settings.
86 %description gtk2 -l pl.UTF-8
87 Biblioteka interfejsu graficznego GTK+ 2.x dla nvidia-settings.
90 Summary: GTK+ 3.x GUI library for nvidia-settings
91 Summary(pl.UTF-8): Biblioteka interfejsu graficznego GTK+ 3.x dla nvidia-settings
93 Requires: %{name} = %{version}-%{release}
94 Provides: %{name}-guilib = %{version}-%{release}
97 GTK+ 3.x GUI library for nvidia-settings.
99 %description gtk3 -l pl.UTF-8
100 Biblioteka interfejsu graficznego GTK+ 3.x dla nvidia-settings.
102 %package -n libXNVCtrl-devel
103 Summary: libXNVCtrl development files
104 Summary(pl.UTF-8): Pliki programistyczne biblioteki libXNVCtrl
106 Group: Development/Libraries
107 Requires: xorg-lib-libX11-devel
108 Requires: xorg-lib-libXext-devel
109 Requires: xorg-lib-libXxf86vm-devel
110 Obsoletes: libXNVCtrl-static
112 %description -n libXNVCtrl-devel
113 Library for accessing NV-CONTROL extension in NVIDIA's latest drivers.
115 %description -n libXNVCtrl-devel -l pl.UTF-8
116 Biblioteka do obsługi rozszerzenia NV-CONTROL z najnowszych
124 %if %{with libXNVCtrl}
125 CFLAGS="%{rpmcppflags} %{rpmcflags} -fPIC" \
126 %{__make} -C src/libXNVCtrl \
133 CFLAGS="%{rpmcppflags} %{rpmcflags} -fPIC" \
134 %{__make} -C samples \
137 OUTPUTDIR=$(pwd)/_out/utils \
140 %if %{with nvidia_settings}
141 CFLAGS="%{rpmcppflags} %{rpmcflags}" \
142 LDFLAGS="%{rpmldflags}" \
144 %{!?with_gtk3:BUILD_GTK3LIB=} \
145 NV_USE_BUNDLED_LIBJANSSON=0 \
155 rm -rf $RPM_BUILD_ROOT
156 %if %{with nvidia_settings}
157 install -d $RPM_BUILD_ROOT{%{_bindir},%{_mandir}/man1,%{_desktopdir},%{_pixmapsdir},/etc/xdg/autostart}
159 NV_USE_BUNDLED_LIBJANSSON=0 \
161 INSTALL="install -p" \
162 LIBDIR="$RPM_BUILD_ROOT%{_libdir}" \
164 DESTDIR=$RPM_BUILD_ROOT
165 cp -p %{SOURCE1} $RPM_BUILD_ROOT%{_desktopdir}
166 cp -p %{SOURCE2} $RPM_BUILD_ROOT%{_pixmapsdir}
167 cp -p %{SOURCE3} $RPM_BUILD_ROOT/etc/xdg/autostart/%{name}.desktop
169 # let RPM autogenerate deps
170 chmod 755 $RPM_BUILD_ROOT%{_libdir}/lib*.so*
173 %if %{with libXNVCtrl}
174 install -d $RPM_BUILD_ROOT%{_examplesdir}/libXNVCtrl-%{version} \
175 $RPM_BUILD_ROOT{%{_libdir},%{_includedir}/NVCtrl}
176 cp -a samples/* $RPM_BUILD_ROOT%{_examplesdir}/libXNVCtrl-%{version}
177 cp -p src/libXNVCtrl/nv_control.h $RPM_BUILD_ROOT%{_includedir}/NVCtrl
178 cp -p src/libXNVCtrl/NVCtrl.h $RPM_BUILD_ROOT%{_includedir}/NVCtrl
179 cp -p src/libXNVCtrl/NVCtrlLib.h $RPM_BUILD_ROOT%{_includedir}/NVCtrl
180 cp -p src/libXNVCtrl/libXNVCtrl.a $RPM_BUILD_ROOT%{_libdir}
182 install -d $RPM_BUILD_ROOT%{_pkgconfigdir}
183 cat <<'EOF' > $RPM_BUILD_ROOT%{_pkgconfigdir}/libXNVCtrl.pc
186 includedir=${prefix}/include/NVCtrl
189 Description: Library for accessing NV-CONTROL extension in NVIDIA's latest drivers.
191 Libs: -L${libdir} -lXNVCtrl
192 Cflags: -I${includedir}
198 install -d $RPM_BUILD_ROOT%{_bindir}
199 for prog in _out/utils/nv-control-*; do
205 install -p $prog $RPM_BUILD_ROOT%{_bindir}
210 rm -rf $RPM_BUILD_ROOT
212 %post -p /sbin/ldconfig
213 %postun -p /sbin/ldconfig
215 %post gtk2 -p /sbin/ldconfig
216 %postun gtk2 -p /sbin/ldconfig
218 %post gtk3 -p /sbin/ldconfig
219 %postun gtk3 -p /sbin/ldconfig
221 %if %{with nvidia_settings}
223 %defattr(644,root,root,755)
224 %attr(755,root,root) %{_bindir}/nvidia-settings
226 %attr(755,root,root) %{_bindir}/nv-control-3dvisionpro
227 %attr(755,root,root) %{_bindir}/nv-control-dpy
228 %attr(755,root,root) %{_bindir}/nv-control-dvc
229 %attr(755,root,root) %{_bindir}/nv-control-events
230 %attr(755,root,root) %{_bindir}/nv-control-framelock
231 %attr(755,root,root) %{_bindir}/nv-control-info
232 %attr(755,root,root) %{_bindir}/nv-control-targets
233 %attr(755,root,root) %{_bindir}/nv-control-warpblend
235 %attr(755,root,root) %{_libdir}/libnvidia-wayland-client.so.*
236 %{_mandir}/man1/nvidia-settings.1*
237 %{_desktopdir}/nvidia-settings.desktop
238 %{_pixmapsdir}/nvidia-settings.png
239 /etc/xdg/autostart/%{name}.desktop
242 %defattr(644,root,root,755)
243 %attr(755,root,root) %{_libdir}/libnvidia-gtk2.so.%{version}
247 %defattr(644,root,root,755)
248 %attr(755,root,root) %{_libdir}/libnvidia-gtk3.so.%{version}
252 %if %{with libXNVCtrl}
253 %files -n libXNVCtrl-devel
254 %defattr(644,root,root,755)
255 %doc doc/{FRAMELOCK,NV-CONTROL-API}.txt
256 %{_libdir}/libXNVCtrl.a
257 %{_includedir}/NVCtrl
258 %{_pkgconfigdir}/libXNVCtrl.pc
259 %{_examplesdir}/libXNVCtrl-%{version}