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: b5bb34001d4312a0058461dea471918f
18 Source1: %{name}.desktop
20 Source3: %{name}-autostart.desktop
21 URL: ftp://download.nvidia.com/XFree86/nvidia-settings/
22 BuildRequires: OpenGL-devel
23 BuildRequires: libvdpau-devel >= 1.0
24 BuildRequires: xorg-lib-libX11-devel
25 BuildRequires: xorg-lib-libXext-devel
26 BuildRequires: xorg-lib-libXv-devel
27 BuildRequires: xorg-lib-libXxf86vm-devel
28 %if %{with nvidia_settings}
29 BuildRequires: gtk+2-devel >= 2.0
30 %{?with_gtk3:BuildRequires: gtk+3-devel >= 3.0}
31 BuildRequires: jansson-devel >= 2.2
33 BuildRequires: pkgconfig
34 BuildRequires: wayland-devel
36 Requires(post,postun): desktop-file-utils
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 %define _enable_debug_packages 0
49 The nvidia-settings utility is a tool for configuring the NVIDIA Linux
50 graphics driver. It operates by communicating with the NVIDIA X
51 driver, querying and updating state as appropriate. This communication
52 is done with the NV-CONTROL X extension.
54 Values such as brightness and gamma, XVideo attributes, temperature,
55 and OpenGL settings can be queried and configured via nvidia-settings.
57 When nvidia-settings starts, it reads the current settings from its
58 configuration file and sends those settings to the X server. Then, it
59 displays a graphical user interface (GUI) interface for configuring
60 the current settings. When nvidia-settings exits, it queries the
61 current settings from the X server and saves them to the configuration
64 %description -l pl.UTF-8
65 Narzędzie nvidia-settings służy do konfiguracji sterownika do kart
66 graficznych firmy NVIDIA. Działa komunikując się ze sterownikiem X
67 NVIDIA, sprawdzając i uaktualniając stan w razie potrzeby. Komunikacja
68 odbywa się poprzez rozszerzenie X NV-CONTROL.
70 Za pomocą nvidia-settings można odczytywać i zmieniać wartości takie
71 jak jasność i korekcja gamma, atrybuty XVideo, temperatura barw i
74 Przy uruchamianiu nvidia-settings odczytuje bieżące ustawienia z pliku
75 konfiguracyjnego i wysyła te ustawienia do serwera X. Następnie
76 wyświetla graficzny interfejs użytkownika (GUI) do konfiguracji
77 ustawień. Przy wyłączniu nvidia-settings odczytuje bieżące ustawienia
78 z serwera X i zapisuje je do pliku konfiguracyjnego.
81 Summary: GTK+ 2.x GUI library for nvidia-settings
82 Summary(pl.UTF-8): Biblioteka interfejsu graficznego GTK+ 2.x dla nvidia-settings
84 Requires: %{name} = %{version}-%{release}
85 Provides: %{name}-guilib = %{version}-%{release}
88 GTK+ 2.x GUI library for nvidia-settings.
90 %description gtk2 -l pl.UTF-8
91 Biblioteka interfejsu graficznego GTK+ 2.x dla nvidia-settings.
94 Summary: GTK+ 3.x GUI library for nvidia-settings
95 Summary(pl.UTF-8): Biblioteka interfejsu graficznego GTK+ 3.x dla nvidia-settings
97 Requires: %{name} = %{version}-%{release}
98 Provides: %{name}-guilib = %{version}-%{release}
101 GTK+ 3.x GUI library for nvidia-settings.
103 %description gtk3 -l pl.UTF-8
104 Biblioteka interfejsu graficznego GTK+ 3.x dla nvidia-settings.
106 %package -n libXNVCtrl-devel
107 Summary: libXNVCtrl development files
108 Summary(pl.UTF-8): Pliki programistyczne biblioteki libXNVCtrl
110 Group: Development/Libraries
111 Requires: xorg-lib-libX11-devel
112 Requires: xorg-lib-libXext-devel
113 Requires: xorg-lib-libXxf86vm-devel
114 Obsoletes: libXNVCtrl-static < 195.36.24
116 %description -n libXNVCtrl-devel
117 Library for accessing NV-CONTROL extension in NVIDIA's latest drivers.
119 %description -n libXNVCtrl-devel -l pl.UTF-8
120 Biblioteka do obsługi rozszerzenia NV-CONTROL z najnowszych
127 %if %{with libXNVCtrl}
128 CFLAGS="%{rpmcppflags} %{rpmcflags} -fPIC" \
129 %{__make} -C src/libXNVCtrl \
136 CFLAGS="%{rpmcppflags} %{rpmcflags} -fPIC" \
137 %{__make} -C samples \
140 OUTPUTDIR=$(pwd)/_out/utils \
143 %if %{with nvidia_settings}
144 CFLAGS="%{rpmcppflags} %{rpmcflags}" \
145 LDFLAGS="%{rpmldflags}" \
147 %{!?with_gtk3:BUILD_GTK3LIB=} \
148 NV_USE_BUNDLED_LIBJANSSON=0 \
158 rm -rf $RPM_BUILD_ROOT
159 %if %{with nvidia_settings}
160 install -d $RPM_BUILD_ROOT{%{_bindir},%{_mandir}/man1,%{_desktopdir},%{_pixmapsdir},/etc/xdg/autostart}
162 NV_USE_BUNDLED_LIBJANSSON=0 \
164 INSTALL="install -p" \
165 LIBDIR="$RPM_BUILD_ROOT%{_libdir}" \
167 DESTDIR=$RPM_BUILD_ROOT
168 cp -p %{SOURCE1} $RPM_BUILD_ROOT%{_desktopdir}
169 cp -p %{SOURCE2} $RPM_BUILD_ROOT%{_pixmapsdir}
170 cp -p %{SOURCE3} $RPM_BUILD_ROOT/etc/xdg/autostart/%{name}.desktop
172 # let RPM autogenerate deps
173 chmod 755 $RPM_BUILD_ROOT%{_libdir}/lib*.so*
176 %if %{with libXNVCtrl}
177 install -d $RPM_BUILD_ROOT%{_examplesdir}/libXNVCtrl-%{version} \
178 $RPM_BUILD_ROOT{%{_libdir},%{_includedir}/NVCtrl}
179 cp -a samples/* $RPM_BUILD_ROOT%{_examplesdir}/libXNVCtrl-%{version}
180 cp -p src/libXNVCtrl/nv_control.h $RPM_BUILD_ROOT%{_includedir}/NVCtrl
181 cp -p src/libXNVCtrl/NVCtrl.h $RPM_BUILD_ROOT%{_includedir}/NVCtrl
182 cp -p src/libXNVCtrl/NVCtrlLib.h $RPM_BUILD_ROOT%{_includedir}/NVCtrl
183 cp -p src/libXNVCtrl/libXNVCtrl.a $RPM_BUILD_ROOT%{_libdir}
185 install -d $RPM_BUILD_ROOT%{_pkgconfigdir}
186 cat <<'EOF' > $RPM_BUILD_ROOT%{_pkgconfigdir}/libXNVCtrl.pc
189 includedir=${prefix}/include/NVCtrl
192 Description: Library for accessing NV-CONTROL extension in NVIDIA's latest drivers.
194 Libs: -L${libdir} -lXNVCtrl
195 Cflags: -I${includedir}
201 install -d $RPM_BUILD_ROOT%{_bindir}
202 for prog in _out/utils/nv-control-*; do
208 install -p $prog $RPM_BUILD_ROOT%{_bindir}
213 rm -rf $RPM_BUILD_ROOT
217 %update_desktop_database_post
221 %update_desktop_database_postun
223 %post gtk2 -p /sbin/ldconfig
224 %postun gtk2 -p /sbin/ldconfig
226 %post gtk3 -p /sbin/ldconfig
227 %postun gtk3 -p /sbin/ldconfig
229 %if %{with nvidia_settings}
231 %defattr(644,root,root,755)
232 %attr(755,root,root) %{_bindir}/nvidia-settings
234 %attr(755,root,root) %{_bindir}/nv-control-3dvisionpro
235 %attr(755,root,root) %{_bindir}/nv-control-dpy
236 %attr(755,root,root) %{_bindir}/nv-control-dvc
237 %attr(755,root,root) %{_bindir}/nv-control-events
238 %attr(755,root,root) %{_bindir}/nv-control-framelock
239 %attr(755,root,root) %{_bindir}/nv-control-info
240 %attr(755,root,root) %{_bindir}/nv-control-targets
241 %attr(755,root,root) %{_bindir}/nv-control-warpblend
243 %attr(755,root,root) %{_libdir}/libnvidia-wayland-client.so.*
244 %{_mandir}/man1/nvidia-settings.1*
245 %{_desktopdir}/nvidia-settings.desktop
246 %{_pixmapsdir}/nvidia-settings.png
247 /etc/xdg/autostart/%{name}.desktop
250 %defattr(644,root,root,755)
251 %attr(755,root,root) %{_libdir}/libnvidia-gtk2.so.%{version}
255 %defattr(644,root,root,755)
256 %attr(755,root,root) %{_libdir}/libnvidia-gtk3.so.%{version}
260 %if %{with libXNVCtrl}
261 %files -n libXNVCtrl-devel
262 %defattr(644,root,root,755)
263 %doc doc/{FRAMELOCK,NV-CONTROL-API}.txt
264 %{_libdir}/libXNVCtrl.a
265 %{_includedir}/NVCtrl
266 %{_pkgconfigdir}/libXNVCtrl.pc
267 %{_examplesdir}/libXNVCtrl-%{version}