1 |
|
2 |
############################################################################## |
3 |
# This .spec file is dual licensed. It can be distributed either with the # |
4 |
# terms of GPL version 2 or newer, or with the MIT license included below. # |
5 |
# Removing either GPL or MIT license when distributing this file is allowed. # |
6 |
############################################################################## |
7 |
# - start of MIT license - |
8 |
# Copyright (c) 2007-2009 Anssi Hannula, Luiz Fernando Capitulino, Colin Guthrie, Thomas Backlund |
9 |
# |
10 |
# Permission is hereby granted, free of charge, to any person |
11 |
# obtaining a copy of this software and associated documentation |
12 |
# files (the "Software"), to deal in the Software without |
13 |
# restriction, including without limitation the rights to use, |
14 |
# copy, modify, merge, publish, distribute, sublicense, and/or sell |
15 |
# copies of the Software, and to permit persons to whom the |
16 |
# Software is furnished to do so, subject to the following |
17 |
# conditions: |
18 |
# |
19 |
# The above copyright notice and this permission notice shall be |
20 |
# included in all copies or substantial portions of the Software. |
21 |
# |
22 |
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, |
23 |
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES |
24 |
# OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND |
25 |
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT |
26 |
# HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, |
27 |
# WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING |
28 |
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR |
29 |
# OTHER DEALINGS IN THE SOFTWARE. |
30 |
# - end of MIT license - |
31 |
|
32 |
%define name fglrx |
33 |
|
34 |
# %atibuild is used to enable the ATI installer --buildpkg mode. |
35 |
# The macros version, rel, ati_dir, distsuffix need to be manually defined. |
36 |
# The macro mdkversion can also be overridden. |
37 |
%define atibuild 0 |
38 |
%{?_without_ati: %global atibuild 0} |
39 |
%{?_with_ati: %global atibuild 1} |
40 |
|
41 |
%if !%{atibuild} |
42 |
# NOTE: These version definitions are overridden by ati-packager.sh when |
43 |
# building with the --buildpkg method of the installer. |
44 |
|
45 |
# When updating, please add new ids to ldetect-lst (merge2pcitable.pl). |
46 |
|
47 |
# version in installer filename: |
48 |
%define oversion 11-3 |
49 |
# Advertised version, for description: |
50 |
%define mversion 11.3 |
51 |
# driver version from ati-packager-helper.sh: |
52 |
%define iversion 8.840 |
53 |
# release: |
54 |
%define rel 1 |
55 |
# rpm version (adds 0 in order to not go backwards if iversion is two-decimal) |
56 |
%define version %{iversion}%([ $(echo %iversion | wc -c) -le 5 ] && echo 0) |
57 |
%else |
58 |
# Best-effort if ATI has made late changes (in atibuild mode) |
59 |
%define _default_patch_fuzz 2 |
60 |
%endif |
61 |
|
62 |
%define priority 1000 |
63 |
%define release %mkrel %{rel} |
64 |
|
65 |
# set to 1 for a prerelease driver with an ubuntu tarball as source |
66 |
%define ubuntu_prerelease 1 |
67 |
|
68 |
%define driverpkgname x11-driver-video-fglrx |
69 |
%define drivername fglrx |
70 |
%define xorg_version pic |
71 |
# highest supported videodrv abi |
72 |
%define videodrv_abi 10 |
73 |
%define xorg_libdir %{_libdir}/xorg |
74 |
%define xorg_dridir %{_libdir}/dri |
75 |
%define xorg_dridir32 %{_prefix}/lib/dri |
76 |
%define ld_so_conf_file ati.conf |
77 |
%define ati_extdir %{_libdir}/%{drivername}/xorg |
78 |
%define xorg_extra_modules %{_libdir}/xorg/extra-modules |
79 |
%define bundle_qt 0 |
80 |
# The entry in Cards+ this driver should be associated with, if there is |
81 |
# no entry in ldetect-lst default pcitable: |
82 |
# cooker ldetect-lst should be up-to-date |
83 |
%define ldetect_cards_name %nil |
84 |
|
85 |
%if %{atibuild} |
86 |
# ATI cards not listed in main ldetect-lst pcitable are not likely |
87 |
# to be supported by radeon which is from the same time period. |
88 |
# radeonhd has greater chance of working due to it not using ID lists. |
89 |
# (main pcitable entries override our entries) |
90 |
%define ldetect_cards_name ATI Radeon HD 2000 and later (vesa/fglrx) |
91 |
%endif |
92 |
|
93 |
%ifarch %ix86 |
94 |
%define xverdir x%{xorg_version} |
95 |
%define archdir arch/x86 |
96 |
%endif |
97 |
%ifarch x86_64 |
98 |
%define xverdir x%{xorg_version}_64a |
99 |
%define archdir arch/x86_64 |
100 |
%endif |
101 |
|
102 |
# Other packages should not require any ATI specific proprietary libraries |
103 |
# (if that is really necessary, we may want to split that specific lib out), |
104 |
# and this package should not be pulled in when libGL.so.1 is required. |
105 |
%define _provides_exceptions \\.so |
106 |
|
107 |
%define qt_requires_exceptions %nil |
108 |
%if %{bundle_qt} |
109 |
# do not require Qt if it is bundled |
110 |
%define qt_requires_exceptions \\|libQtCore\\.so\\|libQtGui\\.so |
111 |
%endif |
112 |
|
113 |
# do not require fglrx stuff, they are all included |
114 |
%define common_requires_exceptions libfglrx.\\+\\.so\\|libati.\\+\\.so%{qt_requires_exceptions} |
115 |
|
116 |
%ifarch x86_64 |
117 |
# (anssi) Allow installing of 64-bit package if the runtime dependencies |
118 |
# of 32-bit libraries are not satisfied. If a 32-bit package that requires |
119 |
# libGL.so.1 is installed, the 32-bit mesa libs are pulled in and that will |
120 |
# pull the dependencies of 32-bit fglrx libraries in as well. |
121 |
%define _requires_exceptions %common_requires_exceptions\\|lib.*so\\.[^(]\\+\\(([^)]\\+)\\)\\?$ |
122 |
%else |
123 |
%define _requires_exceptions %common_requires_exceptions |
124 |
%endif |
125 |
|
126 |
# (anssi) Do not require qt for amdnotifyui (used as event notifier, as |
127 |
# of 04/2010 only for DisplayPort failures). installing |
128 |
# fglrx-control-center will satisfy the dependency. |
129 |
# It is not moved to fglrx-control-center as due to its small size it may |
130 |
# be wanted on e.g. KDE Ones, which can't have the full fglrx-control-center, |
131 |
# and due to it having nothing to do with fglrx-control-center. |
132 |
%define _exclude_files_from_autoreq ^%{_sbindir}/amdnotifyui$ |
133 |
|
134 |
Summary: ATI proprietary X.org driver and libraries |
135 |
Name: %{name} |
136 |
Version: %{version} |
137 |
Release: %{release} |
138 |
%if !%{atibuild} |
139 |
%if !%{ubuntu_prerelease} |
140 |
Source0: https://a248.e.akamai.net/f/674/9206/0/www2.ati.com/drivers/linux/ati-driver-installer-%{oversion}-x86.x86_64.run |
141 |
%else |
142 |
Source0: fglrx-installer_%{iversion}.orig.tar.gz |
143 |
%endif |
144 |
%endif |
145 |
Source1: ati-packager.sh |
146 |
Source2: atieventsd.init |
147 |
%if !%{atibuild} |
148 |
# Generates fglrx.spec from Mandriva SVN for use in AMD installer |
149 |
# archive. Requires kenobi access for fetching names for changelog. |
150 |
# (for manual use) |
151 |
Source10: generate-fglrx-spec-from-svn.sh |
152 |
%endif |
153 |
%if !%{atibuild} |
154 |
# Patches that only affect tools (not built in atibuild mode) |
155 |
Patch1: ati-8.19.10-fglrx_gamma-extutil-include.patch |
156 |
Patch4: fglrx_gamma-fix-underlinking.patch |
157 |
%endif |
158 |
Patch3: fglrx-authfile-locations.patch |
159 |
Patch9: fglrx-make_sh-custom-kernel-dir.patch |
160 |
# do not probe /proc for kernel info as we may be building for a |
161 |
# different kernel |
162 |
Patch10: fglrx-make_sh-no-proc-probe.patch |
163 |
|
164 |
License: Freeware |
165 |
URL: http://ati.amd.com/support/driver.html |
166 |
Group: System/Kernel and hardware |
167 |
ExclusiveArch: %{ix86} x86_64 |
168 |
BuildRoot: %{_tmppath}/%{name}-root |
169 |
%if !%{atibuild} |
170 |
BuildRequires: mesagl-devel |
171 |
BuildRequires: libxmu-devel |
172 |
BuildRequires: libxaw-devel |
173 |
BuildRequires: libxp-devel |
174 |
BuildRequires: libxtst-devel |
175 |
BuildRequires: imake |
176 |
# Used by atieventsd: |
177 |
Suggests: acpid |
178 |
BuildRequires: ImageMagick |
179 |
%endif |
180 |
|
181 |
%description |
182 |
Source package of the ATI proprietary driver. Binary packages are |
183 |
named x11-driver-video-fglrx on %{_vendor}. |
184 |
%if !%{atibuild} |
185 |
This package corresponds to ATI Catalyst version %mversion. |
186 |
%endif |
187 |
|
188 |
%package -n %{driverpkgname} |
189 |
Summary: ATI proprietary X.org driver and libraries |
190 |
Group: System/Kernel and hardware |
191 |
Requires(post): update-alternatives >= 1.9.0 |
192 |
Requires(postun): update-alternatives |
193 |
Obsoletes: ati_igp |
194 |
Suggests: %{drivername}-control-center = %{version} |
195 |
Obsoletes: ati < %{version}-%{release} |
196 |
Provides: ati = %{version}-%{release} |
197 |
Requires: kmod(fglrx) = %{version} |
198 |
Requires: x11-server-common >= 1.9 |
199 |
%if !%{atibuild} |
200 |
# Conflict with the next videodrv ABI break. |
201 |
# The driver may support multiple ABI versions and therefore |
202 |
# a strict version-specific requirement would not be enough. |
203 |
# (ahmad) since X Server 1.10 ABI is now 10 (upstream jumped from 8 to 10) |
204 |
# make it +2 for now |
205 |
Conflicts: xserver-abi(videodrv-%(echo $((%{videodrv_abi} + 1)))) |
206 |
%endif |
207 |
Provides: atieventsd = %{version}-%{release} |
208 |
Obsoletes: atieventsd < %{version}-%{release} |
209 |
|
210 |
%description -n %{driverpkgname} |
211 |
ATI proprietary X.org graphics driver, related libraries and |
212 |
configuration tools. |
213 |
|
214 |
NOTE: You should use XFdrake to configure your ATI card. The |
215 |
correct packages will be automatically installed and configured. |
216 |
|
217 |
If you do not want to use XFdrake, see README.manual-setup. |
218 |
|
219 |
The graphical configuration utility, AMD Catalyst Control Center |
220 |
Linux Edition, is contained in the package |
221 |
%{drivername}-control-center. |
222 |
%if !%{atibuild} |
223 |
This package corresponds to ATI Catalyst version %mversion. |
224 |
%endif |
225 |
|
226 |
%package -n %{drivername}-control-center |
227 |
Summary: AMD Catalyst Control Center Linux Edition |
228 |
Group: System/Kernel and hardware |
229 |
Requires: %{driverpkgname} = %{version} |
230 |
Obsoletes: ati-utils < %{version}-%{release} |
231 |
Provides: ati-utils = %{version}-%{release} |
232 |
Provides: amdcccle = %{version}-%{release} |
233 |
Obsoletes: ati-ccc < %{version}-%{release} |
234 |
Obsoletes: ati-control-center < %{version}-%{release} |
235 |
Provides: ati-control-center = %{version}-%{release} |
236 |
%if !%{bundle_qt} |
237 |
# 2009.0 and 2009.1 have this one in updates only |
238 |
Requires: %{_lib}qtcore4 >= 3:4.5.2 |
239 |
%endif |
240 |
|
241 |
%description -n %{drivername}-control-center |
242 |
AMD Catalyst Control Center Linux Edition, a graphical configuration |
243 |
utility for the ATI proprietary X.org driver. |
244 |
%if !%{atibuild} |
245 |
This package corresponds to ATI Catalyst version %mversion. |
246 |
%endif |
247 |
|
248 |
%package -n dkms-%{drivername} |
249 |
Summary: ATI proprietary kernel module |
250 |
Group: System/Kernel and hardware |
251 |
Requires: dkms |
252 |
Requires(post): dkms |
253 |
Requires(preun): dkms |
254 |
Obsoletes: dkms-ati < %{version}-%{release} |
255 |
Provides: dkms-ati = %{version}-%{release} |
256 |
Requires: %{driverpkgname} = %{version} |
257 |
|
258 |
%description -n dkms-%{drivername} |
259 |
ATI proprietary kernel module. This is to be used with the |
260 |
%{driverpkgname} package. |
261 |
%if !%{atibuild} |
262 |
This package corresponds to ATI Catalyst version %mversion. |
263 |
%endif |
264 |
|
265 |
%package -n %{drivername}-devel |
266 |
Summary: ATI proprietary development libraries and headers |
267 |
Group: Development/C |
268 |
Requires: %{driverpkgname} = %{version}-%{release} |
269 |
Obsoletes: ati-devel < %{version}-%{release} |
270 |
Provides: ati-devel = %{version}-%{release} |
271 |
|
272 |
%description -n %{drivername}-devel |
273 |
ATI proprietary development libraries and headers. This package is |
274 |
not required for normal use. |
275 |
|
276 |
The main driver package name is %{driverpkgname}. |
277 |
|
278 |
%prep |
279 |
%setup -T -c |
280 |
%if %{atibuild} |
281 |
ln -s %{ati_dir}/%{xverdir} %{ati_dir}/arch . |
282 |
# patches affects common, so we cannot symlink it: |
283 |
cp -a %{ati_dir}/common . |
284 |
%else |
285 |
%if %ubuntu_prerelease |
286 |
%setup -q -T -D -a 0 |
287 |
ln -s . common |
288 |
%else |
289 |
sh %{SOURCE0} --extract . |
290 |
%endif |
291 |
|
292 |
mkdir fglrx_tools |
293 |
tar -xzf common/usr/src/ati/fglrx_sample_source.tgz -C fglrx_tools |
294 |
%if 0 |
295 |
cd fglrx_tools # ensure patch does not touch outside |
296 |
%patch1 -p1 |
297 |
%patch4 -p1 |
298 |
cd - |
299 |
cmp common/usr/X11R6/include/X11/extensions/fglrx_gamma.h fglrx_tools/lib/fglrx_gamma/fglrx_gamma.h |
300 |
%endif |
301 |
%if %ubuntu_prerelease |
302 |
[ -d "%xverdir" ] || (echo This driver version does not support your X.org server. Please wait for a new release from ATI. >&2; false) |
303 |
%else |
304 |
[ "%iversion" = "$(./ati-packager-helper.sh --version)" ] |
305 |
%endif |
306 |
%endif |
307 |
|
308 |
cd common # ensure patches do not touch outside |
309 |
%patch3 -p2 |
310 |
%patch9 -p2 |
311 |
%patch10 -p2 |
312 |
cd .. |
313 |
|
314 |
cat > README.install.urpmi <<EOF |
315 |
This driver is for ATI Radeon HD 2000 and newer cards. |
316 |
Reconfiguring is not necessary when upgrading from a previous %{_vendor} ATI |
317 |
driver package. |
318 |
|
319 |
Use XFdrake to configure X to use the correct ATI driver. Any needed |
320 |
packages will be automatically installed if not already present. |
321 |
1. Run XFdrake as root. |
322 |
2. Go to the Graphics Card list. |
323 |
3. Select your card (it is usually already autoselected). |
324 |
4. Answer any questions asked and then quit. |
325 |
|
326 |
If you do not want to use XFdrake or it does not work correctly for |
327 |
you, see README.manual-setup for manual installation instructions. |
328 |
EOF |
329 |
|
330 |
cat > README.manual-setup <<EOF |
331 |
This file describes the procedure for the manual installation of this ATI |
332 |
driver package. You can find the instructions for the recommended automatic |
333 |
installation in the file 'README.install.urpmi' in this directory. |
334 |
|
335 |
- Open %{_sysconfdir}/X11/xorg.conf and make the following changes: |
336 |
o Change the Driver to "fglrx" in the Device section |
337 |
o Make the line below the only 'glx' related line in the Module section: |
338 |
Load "glx" |
339 |
o Remove any 'ModulePath' lines from the Files section |
340 |
- Run "update-alternatives --set gl_conf %{_sysconfdir}/ld.so.conf.d/GL/%{ld_so_conf_file}" as root. |
341 |
- Run "ldconfig" as root. |
342 |
EOF |
343 |
|
344 |
cat > README.8.600.upgrade.urpmi <<EOF |
345 |
REMOVED GRAPHICS DRIVER SUPPORT NOTIFICATION: |
346 |
Versions 8.600 and later of ATI Proprietary Graphics driver (fglrx) only |
347 |
support Radeon HD 2000 (r600) or newer cards. |
348 |
|
349 |
If you have an older Radeon card or are unsure, please reconfigure your |
350 |
driver: |
351 |
1. Run XFdrake as root or select Graphical server configuration in |
352 |
%{_vendor} Control Center. |
353 |
2. Go to the Graphics Card list. |
354 |
3. Select your card (it is usually already autoselected). |
355 |
4. Answer any questions asked and then quit. |
356 |
EOF |
357 |
|
358 |
%build |
359 |
%if !%{atibuild} |
360 |
# %atibuild is done with minimal buildrequires |
361 |
%if 0 |
362 |
cd fglrx_tools/lib/fglrx_gamma |
363 |
xmkmf |
364 |
# parallel make broken (2007-09-18) |
365 |
make CC="%__cc %optflags" SHLIBGLOBALSFLAGS="%{?ldflags} -L%{_prefix}/X11R6/%{_lib}" |
366 |
cd - |
367 |
%endif |
368 |
cd fglrx_tools/fgl_glxgears |
369 |
xmkmf |
370 |
%make RMAN=/bin/true CC="%__cc %optflags -I../../common/usr/include" EXTRA_LDOPTIONS="%{?ldflags}" |
371 |
cd - |
372 |
%if 0 |
373 |
cd fglrx_tools/programs/fglrx_gamma |
374 |
xmkmf |
375 |
%make INSTALLED_LIBS=-L../../lib/fglrx_gamma INCLUDES=-I../../../common/usr/X11R6/include CC="%__cc %optflags" RMAN=/bin/true EXTRA_LDOPTIONS="%{?ldflags}" |
376 |
cd - |
377 |
%endif |
378 |
%endif |
379 |
|
380 |
%install |
381 |
rm -rf %{buildroot} |
382 |
|
383 |
# dkms |
384 |
install -d -m755 %{buildroot}%{_usrsrc}/%{drivername}-%{version}-%{release} |
385 |
cp -a common/lib/modules/fglrx/build_mod/* %{buildroot}%{_usrsrc}/%{drivername}-%{version}-%{release} |
386 |
cp -a %{archdir}/lib/modules/fglrx/build_mod/* %{buildroot}%{_usrsrc}/%{drivername}-%{version}-%{release} |
387 |
|
388 |
#install -d -m755 %{buildroot}%{_usrsrc}/%{drivername}-%{version}-%{release}/patches |
389 |
#install -m644 %{SOURCE3} %{buildroot}%{_usrsrc}/%{drivername}-%{version}-%{release}/patches |
390 |
|
391 |
cat > %{buildroot}%{_usrsrc}/%{drivername}-%{version}-%{release}/dkms.conf <<EOF |
392 |
PACKAGE_NAME="%{drivername}" |
393 |
PACKAGE_VERSION="%{version}-%{release}" |
394 |
BUILT_MODULE_NAME[0]="fglrx" |
395 |
DEST_MODULE_LOCATION[0]="/kernel/drivers/char/drm" |
396 |
# uname_v set to none so that make.sh doesn't try to use "uname -v" to see |
397 |
# if the target kernel is SMP (we may be compiling for a different kernel) |
398 |
MAKE[0]="sh make.sh --uname_r=\${kernelver} --uname_v=none --kernel-dir=\${kernel_source_dir} --no-proc-probe --norootcheck" |
399 |
CLEAN="rm -rf 2.6.x/.tmp_versions; make -C2.6.x clean" |
400 |
AUTOINSTALL="yes" |
401 |
EOF |
402 |
|
403 |
# headers |
404 |
install -d -m755 %{buildroot}%{_includedir} |
405 |
cp -a common/usr/include/* %{buildroot}%{_includedir} |
406 |
chmod 0644 %{buildroot}%{_includedir}/*/*.h |
407 |
|
408 |
#install -d -m755 %{buildroot}%{_includedir}/X11/extensions |
409 |
#install -m644 common/usr/X11R6/include/X11/extensions/*.h %{buildroot}%{_includedir}/X11/extensions |
410 |
|
411 |
# install binaries |
412 |
install -d -m755 %{buildroot}%{_sbindir} |
413 |
install -m755 %{archdir}/usr/sbin/* %{buildroot}%{_sbindir} |
414 |
install -m755 common/usr/sbin/* %{buildroot}%{_sbindir} |
415 |
install -d -m755 %{buildroot}%{_bindir} |
416 |
install -m755 %{archdir}/usr/X11R6/bin/* %{buildroot}%{_bindir} |
417 |
install -m755 common/usr/X11R6/bin/* %{buildroot}%{_bindir} |
418 |
%if !%{atibuild} |
419 |
# install self-built binaries |
420 |
install -m755 fglrx_tools/fgl_glxgears/fgl_glxgears %{buildroot}%{_bindir} |
421 |
%if 0 |
422 |
install -m755 fglrx_tools/programs/fglrx_gamma/fglrx_xgamma %{buildroot}%{_bindir} |
423 |
%endif |
424 |
%endif |
425 |
|
426 |
# atieventsd initscript |
427 |
install -d -m755 %{buildroot}%{_initrddir} |
428 |
install -m755 %{SOURCE2} %{buildroot}%{_initrddir}/atieventsd |
429 |
|
430 |
# amdcccle data files |
431 |
install -d -m755 %{buildroot}%{_datadir}/ati/amdcccle |
432 |
install -m644 common/usr/share/ati/amdcccle/*.qm %{buildroot}%{_datadir}/ati/amdcccle |
433 |
rm -f amdcccle.langs |
434 |
for file in common/usr/share/ati/amdcccle/*.qm; do |
435 |
file=$(basename $file) |
436 |
lang=${file#amdcccle_} |
437 |
lang=${lang%%.qm} |
438 |
echo "%%lang($lang) %{_datadir}/ati/amdcccle/$file" >> amdcccle.langs |
439 |
done |
440 |
|
441 |
# amdcccle super-user mode |
442 |
install -d -m755 %{buildroot}%{_sysconfdir}/security/console.apps |
443 |
install -d -m755 %{buildroot}%{_sysconfdir}/pam.d |
444 |
install -m644 common/etc/security/console.apps/* %{buildroot}%{_sysconfdir}/security/console.apps |
445 |
ln -s su %{buildroot}%{_sysconfdir}/pam.d/amdcccle-su |
446 |
|
447 |
# man pages |
448 |
install -d -m755 %{buildroot}%{_mandir}/man1 %{buildroot}%{_mandir}/man8 |
449 |
%if !%{atibuild} |
450 |
#install -m644 fglrx_tools/programs/fglrx_gamma/fglrx_xgamma.man %{buildroot}%{_mandir}/man1/fglrx_xgamma.1 |
451 |
%endif |
452 |
install -m644 common/usr/share/man/man8/* %{buildroot}%{_mandir}/man8 |
453 |
|
454 |
# menu entry |
455 |
install -d -m755 %{buildroot}%{_datadir}/applications |
456 |
install -m644 common/usr/share/applications/* %{buildroot}%{_datadir}/applications |
457 |
sed -i 's,^Icon=.*$,Icon=%{drivername}-amdcccle,' %{buildroot}%{_datadir}/applications/*.desktop |
458 |
# control center doesn't really use GNOME/KDE libraries: |
459 |
sed -i 's,GNOME;KDE;,,' %{buildroot}%{_datadir}/applications/*.desktop |
460 |
|
461 |
# icons |
462 |
install -d -m755 %{buildroot}%{_miconsdir} %{buildroot}%{_iconsdir} %{buildroot}%{_liconsdir} |
463 |
%if !%{atibuild} |
464 |
convert common/usr/share/icons/ccc_large.xpm -resize 16x16 %{buildroot}%{_miconsdir}/%{drivername}-amdcccle.png |
465 |
convert common/usr/share/icons/ccc_large.xpm -resize 32x32 %{buildroot}%{_iconsdir}/%{drivername}-amdcccle.png |
466 |
convert common/usr/share/icons/ccc_large.xpm -resize 48x48 %{buildroot}%{_liconsdir}/%{drivername}-amdcccle.png |
467 |
%else |
468 |
install -m644 common/usr/share/icons/ccc_large.xpm %{buildroot}%{_iconsdir}/%{drivername}-amdcccle.xpm |
469 |
%endif |
470 |
|
471 |
# fglrx-libGL.so.1.2 and libGL.so.1.2 are exactly the same |
472 |
# fglrx-libglx.so and libglx.so are exactly the same |
473 |
# should we ship both copies or just one? (ubuntu ships just one copy AFAICS) |
474 |
# (ahmad) 03-04-2011 |
475 |
for lib in arch/x86/usr/X11R6/lib/fglrx/fglrx-libGL.so.1.2 \ |
476 |
arch/x86/usr/X11R6/lib/fglrx-libGL.so.1.2 \ |
477 |
arch/x86_64/usr/X11R6/lib64/fglrx/fglrx-libGL.so.1.2 \ |
478 |
arch/x86_64/usr/X11R6/lib64/fglrx-libGL.so.1.2 \ |
479 |
xpic/usr/X11R6/lib/modules/extensions/fglrx/fglrx-libglx.so \ |
480 |
xpic/usr/X11R6/lib/modules/extensions/fglrx-libglx.so \ |
481 |
xpic_64a/usr/X11R6/lib64/modules/extensions/fglrx/fglrx-libglx.so \ |
482 |
xpic_64a/usr/X11R6/lib64/modules/extensions/fglrx-libglx.so; do |
483 |
if [ -e $lib ]; then |
484 |
file_name=$(basename $lib); |
485 |
path=$(dirname $lib); |
486 |
# Remove fglrx prefix |
487 |
new_name=`echo $file_name | sed -e "s|fglrx\-||"`; |
488 |
full_path=`echo "$path/$new_name"`; |
489 |
mv -f $lib $full_path; |
490 |
fi |
491 |
done |
492 |
|
493 |
# install libraries |
494 |
install -d -m755 %{buildroot}%{_libdir}/%{drivername} |
495 |
install -m755 %{archdir}/usr/X11R6/%{_lib}/*.* %{buildroot}%{_libdir}/%{drivername} |
496 |
install -m755 %{archdir}/usr/%{_lib}/* %{buildroot}%{_libdir}/%{drivername} |
497 |
/sbin/ldconfig -n %{buildroot}%{_libdir}/%{drivername} |
498 |
# create devel symlinks |
499 |
for file in %{buildroot}%{_libdir}/%{drivername}/*.so.*.*; do |
500 |
ln -s $(basename $file) ${file%%.so*}.so; |
501 |
done |
502 |
%ifarch x86_64 |
503 |
install -d -m755 %{buildroot}%{_prefix}/lib/%{drivername} |
504 |
install -m755 arch/x86/usr/X11R6/lib/libGL* %{buildroot}%{_prefix}/lib/%{drivername} |
505 |
install -m755 arch/x86/usr/lib/* %{buildroot}%{_prefix}/lib/%{drivername} |
506 |
/sbin/ldconfig -n %{buildroot}%{_prefix}/lib/%{drivername} |
507 |
# create devel symlinks |
508 |
for file in %{buildroot}%{_prefix}/lib/%{drivername}/*.so.*.*; do |
509 |
ln -s $(basename $file) ${file%%.so*}.so; |
510 |
done |
511 |
%endif |
512 |
|
513 |
%if %{bundle_qt} |
514 |
# install the bundled Qt4 libs on distros with qt4 < 4.4.2 |
515 |
install -d -m755 %{buildroot}%{_libdir}/%{drivername}-qt4 |
516 |
install -m755 %{archdir}/usr/share/ati/%{_lib}/* %{buildroot}%{_libdir}/%{drivername}-qt4 |
517 |
# RPATH of amdcccle points to datadir, we create a symlink there: |
518 |
install -d -m755 %{buildroot}/usr/share/ati |
519 |
ln -s %{_libdir}/%{drivername}-qt4 %{buildroot}/usr/share/ati/%{_lib} |
520 |
%endif |
521 |
|
522 |
%if !%{atibuild} |
523 |
#install -m755 fglrx_tools/lib/fglrx_gamma/libfglrx_gamma.so.1.0 %{buildroot}%{_libdir}/%{drivername} |
524 |
#install -m644 fglrx_tools/lib/fglrx_gamma/libfglrx_gamma.a %{buildroot}%{_libdir}/%{drivername} |
525 |
%endif |
526 |
|
527 |
# install X.org files |
528 |
install -d -m755 %{buildroot}%{xorg_libdir}/modules/drivers |
529 |
install -m755 %{xverdir}/usr/X11R6/%{_lib}/modules/drivers/*.so* %{buildroot}%{xorg_libdir}/modules/drivers |
530 |
install -d -m755 %{buildroot}%{xorg_libdir}/modules/linux |
531 |
install -m755 %{xverdir}/usr/X11R6/%{_lib}/modules/linux/*.so* %{buildroot}%{xorg_libdir}/modules/linux |
532 |
install -m644 %{xverdir}/usr/X11R6/%{_lib}/modules/*.*o %{buildroot}%{xorg_libdir}/modules |
533 |
install -d -m755 %{buildroot}%{ati_extdir} |
534 |
install -m755 %{xverdir}/usr/X11R6/%{_lib}/modules/extensions/*.so* %{buildroot}%{ati_extdir} |
535 |
|
536 |
# etc files |
537 |
install -d -m755 %{buildroot}%{_sysconfdir}/ati |
538 |
install -m644 common/etc/ati/* %{buildroot}%{_sysconfdir}/ati |
539 |
chmod 0755 %{buildroot}%{_sysconfdir}/ati/*.sh |
540 |
|
541 |
# dri libraries |
542 |
install -d -m755 %{buildroot}%{xorg_dridir} |
543 |
install -m755 %{archdir}/usr/X11R6/%{_lib}/modules/dri/* %{buildroot}%{xorg_dridir} |
544 |
%ifarch x86_64 |
545 |
install -d -m755 %{buildroot}%{xorg_dridir32} |
546 |
install -m755 arch/x86/usr/X11R6/lib/modules/dri/* %{buildroot}%{xorg_dridir32} |
547 |
%endif |
548 |
|
549 |
# ld.so.conf |
550 |
install -d -m755 %{buildroot}%{_sysconfdir}/ld.so.conf.d/GL |
551 |
echo "%{_libdir}/%{drivername}" > %{buildroot}%{_sysconfdir}/ld.so.conf.d/GL/%{ld_so_conf_file} |
552 |
%ifarch x86_64 |
553 |
echo "%{_prefix}/lib/%{drivername}" >> %{buildroot}%{_sysconfdir}/ld.so.conf.d/GL/%{ld_so_conf_file} |
554 |
%endif |
555 |
touch %{buildroot}%{_sysconfdir}/ld.so.conf.d/GL.conf |
556 |
|
557 |
# modprobe.conf |
558 |
install -d -m755 %{buildroot}%{_sysconfdir}/modprobe.d |
559 |
touch %{buildroot}%{_sysconfdir}/modprobe.d/display-driver |
560 |
install -d -m755 %{buildroot}%{_sysconfdir}/%{drivername} |
561 |
echo "blacklist radeon" > %{buildroot}%{_sysconfdir}/%{drivername}/modprobe.conf |
562 |
|
563 |
# modprobe.preload.d |
564 |
install -d -m755 %{buildroot}%{_sysconfdir}/modprobe.preload.d |
565 |
touch %{buildroot}%{_sysconfdir}/modprobe.preload.d/display-driver |
566 |
echo "fglrx" > %{buildroot}%{_sysconfdir}/%{drivername}/modprobe.preload |
567 |
|
568 |
# XvMCConfig |
569 |
echo "libAMDXvBA.so.1" > %{buildroot}%{_sysconfdir}/%{drivername}/XvMCConfig |
570 |
|
571 |
# install ldetect-lst pcitable files for backports |
572 |
sed -ne 's|^\s*FGL_ASIC_ID(\(0x....\)).*|\1|gp' common/lib/modules/fglrx/build_mod/fglrxko_pci_ids.h | tr '[:upper:]' '[:lower:]' | sort -u | sed 's,^.*$,0x1002\t\0\t"%{ldetect_cards_name}",' > pcitable.fglrx.lst |
573 |
[ $(stat -c%s pcitable.fglrx.lst) -gt 500 ] |
574 |
%if "%{ldetect_cards_name}" != "" |
575 |
install -d -m755 %{buildroot}%{_datadir}/ldetect-lst/pcitable.d |
576 |
gzip -c pcitable.fglrx.lst > %{buildroot}%{_datadir}/ldetect-lst/pcitable.d/40%{drivername}.lst.gz |
577 |
%endif |
578 |
|
579 |
%pre -n %{driverpkgname} |
580 |
# Handle alternatives-era /etc/ati directory |
581 |
# It may confuse rpm due to it containing %config files |
582 |
if [ -L %{_sysconfdir}/ati ]; then |
583 |
rm %{_sysconfdir}/ati |
584 |
fi |
585 |
|
586 |
%post -n %{driverpkgname} |
587 |
# Migrate from pre-alternatives files |
588 |
if [ ! -L %{_datadir}/applications/mandriva-amdcccle.desktop -a -e %{_datadir}/applications/mandriva-amdcccle.desktop ]; then |
589 |
rm -f %{_datadir}/applications/mandriva-amdcccle.desktop |
590 |
fi |
591 |
|
592 |
%{_sbindir}/update-alternatives \ |
593 |
--install %{_sysconfdir}/ld.so.conf.d/GL.conf gl_conf %{_sysconfdir}/ld.so.conf.d/GL/%{ld_so_conf_file} %{priority} \ |
594 |
--slave %{_sysconfdir}/X11/XvMCConfig xvmcconfig %{_sysconfdir}/%{drivername}/XvMCConfig \ |
595 |
--slave %{_libdir}/libAMDXvBA.cap %{_lib}AMDXvBA_cap %{_libdir}/%{drivername}/libAMDXvBA.cap \ |
596 |
%ifarch x86_64 |
597 |
--slave %{_prefix}/lib/libAMDXvBA.cap libAMDXvBA_cap %{_libdir}/%{drivername}/libAMDXvBA.cap \ |
598 |
%endif |
599 |
--slave %{_sysconfdir}/modprobe.d/display-driver display-driver.modconf %{_sysconfdir}/%{drivername}/modprobe.conf \ |
600 |
--slave %{_sysconfdir}/modprobe.preload.d/display-driver display-driver.preload %{_sysconfdir}/%{drivername}/modprobe.preload \ |
601 |
--slave %{xorg_extra_modules} xorg_extra_modules %{ati_extdir} \ |
602 |
--slave %{_libdir}/xorg/modules/extensions/libglx.so libglx %{ati_extdir}/libglx.so |
603 |
if [ "$(readlink -e %{_sysconfdir}/ld.so.conf.d/GL.conf)" = "%{_sysconfdir}/ld.so.conf.d/GL/ati-hd2000.conf" ]; then |
604 |
# Switch from the obsolete hd2000 branch: |
605 |
%{_sbindir}/update-alternatives --set gl_conf %{_sysconfdir}/ld.so.conf.d/GL/%{ld_so_conf_file} |
606 |
fi |
607 |
# When upgrading from alternatives setup, rpm may consider /etc/ati/atiogl.xml |
608 |
# to exist due to the symlink, even when we remove it in %pre: |
609 |
if [ -e %{_sysconfdir}/ati/atiogl.xml.rpmnew -a ! -e %{_sysconfdir}/ati/atiogl.xml ]; then |
610 |
mv %{_sysconfdir}/ati/atiogl.xml.rpmnew %{_sysconfdir}/ati/atiogl.xml |
611 |
echo "Moved %{_sysconfdir}/ati/atiogl.xml.rpmnew back to %{_sysconfdir}/ati/atiogl.xml." |
612 |
fi |
613 |
|
614 |
# empty line so that /sbin/ldconfig is not passed to update-alternatives |
615 |
|
616 |
# Call /sbin/ldconfig explicitely due to alternatives |
617 |
/sbin/ldconfig -X |
618 |
%_post_service atieventsd |
619 |
%if "%{ldetect_cards_name}" != "" |
620 |
[ -x %{_sbindir}/update-ldetect-lst ] && %{_sbindir}/update-ldetect-lst || : |
621 |
%endif |
622 |
|
623 |
%posttrans -n %{driverpkgname} |
624 |
# RPM seems to leave out the active /etc/fglrx* directory, likely due to |
625 |
# it being confused with the /etc/ati symlink. We have to clean up ourself: |
626 |
for dir in %{_sysconfdir}/fglrx %{_sysconfdir}/fglrx-hd2000; do |
627 |
if [ -d $dir ]; then |
628 |
for file in $dir/*; do |
629 |
case "$(basename $file)" in |
630 |
control | signature | logo_mask.xbm.example | logo.xbm.example) |
631 |
# non-config files, rpm would normally remove |
632 |
rm $file;; |
633 |
authatieventsd.sh | fglrxprofiles.csv | fglrxrc | atiogl.xml) |
634 |
# config files, check for modifications |
635 |
case "$(stat -c%s $file)" in |
636 |
545 | 838 | 2769 | 10224 | 11018) |
637 |
rm $file;; |
638 |
*) |
639 |
echo "Saving $file as %{_sysconfdir}/ati/$(basename $file).rpmsave." |
640 |
mv $file %{_sysconfdir}/ati/$(basename $file).rpmsave;; |
641 |
esac |
642 |
;; |
643 |
esac |
644 |
done |
645 |
[ $(ls -c $dir | wc -l) -eq 0 ] && rm -r $dir |
646 |
fi |
647 |
done |
648 |
true |
649 |
|
650 |
%preun -n %{driverpkgname} |
651 |
%_preun_service atieventsd |
652 |
|
653 |
%postun -n %{driverpkgname} |
654 |
if [ ! -f %{_sysconfdir}/ld.so.conf.d/GL/%{ld_so_conf_file} ]; then |
655 |
%{_sbindir}/update-alternatives --remove gl_conf %{_sysconfdir}/ld.so.conf.d/GL/%{ld_so_conf_file} |
656 |
fi |
657 |
# Call /sbin/ldconfig explicitely due to alternatives |
658 |
/sbin/ldconfig |
659 |
%if "%{ldetect_cards_name}" != "" |
660 |
[ -x %{_sbindir}/update-ldetect-lst ] && %{_sbindir}/update-ldetect-lst || : |
661 |
%endif |
662 |
|
663 |
%pre -n %{drivername}-control-center |
664 |
# Handle alternatives-era directory, |
665 |
# it may confuse rpm. |
666 |
if [ -L %{_datadir}/ati ]; then |
667 |
rm %{_datadir}/ati |
668 |
fi |
669 |
|
670 |
%post -n %{drivername}-control-center |
671 |
[ -d %{_datadir}/fglrx ] && rm -r %{_datadir}/fglrx |
672 |
[ -d %{_datadir}/fglrx-hd2000 ] && rm -r %{_datadir}/fglrx-hd2000 |
673 |
true |
674 |
|
675 |
%post -n dkms-%{drivername} |
676 |
/usr/sbin/dkms --rpm_safe_upgrade add -m %{drivername} -v %{version}-%{release} && |
677 |
/usr/sbin/dkms --rpm_safe_upgrade build -m %{drivername} -v %{version}-%{release} && |
678 |
/usr/sbin/dkms --rpm_safe_upgrade install -m %{drivername} -v %{version}-%{release} --force |
679 |
|
680 |
# rmmod any old driver if present and not in use (e.g. by X) |
681 |
rmmod fglrx > /dev/null 2>&1 || true |
682 |
|
683 |
%preun -n dkms-%{drivername} |
684 |
/usr/sbin/dkms --rpm_safe_upgrade remove -m %{drivername} -v %{version}-%{release} --all |
685 |
|
686 |
# rmmod any old driver if present and not in use (e.g. by X) |
687 |
rmmod fglrx > /dev/null 2>&1 || true |
688 |
|
689 |
%clean |
690 |
rm -rf %{buildroot} |
691 |
|
692 |
%files -n %{driverpkgname} |
693 |
%defattr(-,root,root) |
694 |
%doc README.install.urpmi README.manual-setup |
695 |
%doc README.8.600.upgrade.urpmi |
696 |
# the documentation files are grossly out of date; the configuration options |
697 |
# described in configure.html seem to be used by the driver, though, so it is |
698 |
# packaged, while the other html files are not: |
699 |
%doc common/usr/share/doc/fglrx/configure.html |
700 |
%doc common/usr/share/doc/fglrx/ATI_LICENSE.TXT |
701 |
|
702 |
%if "%{ldetect_cards_name}" != "" |
703 |
%{_datadir}/ldetect-lst/pcitable.d/40%{drivername}.lst.gz |
704 |
%endif |
705 |
|
706 |
%ghost %{_sysconfdir}/ld.so.conf.d/GL.conf |
707 |
%dir %{_sysconfdir}/ld.so.conf.d/GL |
708 |
%{_sysconfdir}/ld.so.conf.d/GL/ati.conf |
709 |
|
710 |
%ghost %{_sysconfdir}/modprobe.d/display-driver |
711 |
%ghost %{_sysconfdir}/modprobe.preload.d/display-driver |
712 |
%dir %{_sysconfdir}/%{drivername} |
713 |
%{_sysconfdir}/%{drivername}/XvMCConfig |
714 |
%{_sysconfdir}/%{drivername}/modprobe.conf |
715 |
%{_sysconfdir}/%{drivername}/modprobe.preload |
716 |
|
717 |
%dir %{_sysconfdir}/ati |
718 |
%{_sysconfdir}/ati/control |
719 |
%{_sysconfdir}/ati/signature |
720 |
%config(noreplace) %{_sysconfdir}/ati/atiogl.xml |
721 |
%{_sysconfdir}/ati/logo.xbm.example |
722 |
%{_sysconfdir}/ati/logo_mask.xbm.example |
723 |
%config %{_sysconfdir}/ati/authatieventsd.sh |
724 |
%{_sysconfdir}/ati/amdpcsdb.default |
725 |
|
726 |
%{_initrddir}/atieventsd |
727 |
|
728 |
%{_sbindir}/atieventsd |
729 |
%{_sbindir}/amdnotifyui |
730 |
%{_sbindir}/atigetsysteminfo.sh |
731 |
|
732 |
%{_bindir}/amdupdaterandrconfig |
733 |
%{_bindir}/amdxdg-su |
734 |
%{_bindir}/aticonfig |
735 |
%{_bindir}/atiodcli |
736 |
%{_bindir}/atiode |
737 |
%{_bindir}/fgl_glxgears |
738 |
%{_bindir}/fglrxinfo |
739 |
#%{_bindir}/fglrx_xgamma |
740 |
|
741 |
%{xorg_libdir}/modules/drivers/fglrx_drv.so |
742 |
%{xorg_libdir}/modules/linux/libfglrxdrm.so |
743 |
%{xorg_libdir}/modules/amdxmm.*o |
744 |
%{xorg_libdir}/modules/glesx.*o |
745 |
|
746 |
%dir %{ati_extdir} |
747 |
%{ati_extdir}/libglx.so |
748 |
|
749 |
%{xorg_dridir}/fglrx_dri.so |
750 |
%ifarch x86_64 |
751 |
%{xorg_dridir32}/fglrx_dri.so |
752 |
%endif |
753 |
|
754 |
%dir %{_libdir}/%{drivername} |
755 |
%{_libdir}/%{drivername}/libGL.so.1 |
756 |
%{_libdir}/%{drivername}/libGL.so.1.* |
757 |
%{_libdir}/%{drivername}/libaticalcl.so |
758 |
%{_libdir}/%{drivername}/libaticaldd.so |
759 |
%{_libdir}/%{drivername}/libaticalrt.so |
760 |
%{_libdir}/%{drivername}/libatiuki.so.1* |
761 |
%ifarch x86_64 |
762 |
%dir %{_prefix}/lib/%{drivername} |
763 |
%{_prefix}/lib/%{drivername}/libGL.so.1 |
764 |
%{_prefix}/lib/%{drivername}/libGL.so.1.* |
765 |
%{_prefix}/lib/%{drivername}/libaticalcl.so |
766 |
%{_prefix}/lib/%{drivername}/libaticaldd.so |
767 |
%{_prefix}/lib/%{drivername}/libaticalrt.so |
768 |
%{_prefix}/lib/%{drivername}/libatiuki.so.1* |
769 |
%endif |
770 |
|
771 |
#%{_libdir}/%{drivername}/libfglrx_gamma.so.1* |
772 |
%{_libdir}/%{drivername}/libfglrx_dm.so.1* |
773 |
%{_libdir}/%{drivername}/libatiadlxx.so |
774 |
%{_libdir}/%{drivername}/libAMDXvBA.cap |
775 |
%{_libdir}/%{drivername}/libAMDXvBA.so.1* |
776 |
%{_libdir}/%{drivername}/libXvBAW.so.1* |
777 |
|
778 |
%if !%{atibuild} |
779 |
#%{_mandir}/man1/fglrx_xgamma.1* |
780 |
%endif |
781 |
%{_mandir}/man8/atieventsd.8* |
782 |
|
783 |
%files -n %{drivername}-control-center -f amdcccle.langs |
784 |
%defattr(-,root,root) |
785 |
%doc common/usr/share/doc/amdcccle/* |
786 |
%{_sysconfdir}/security/console.apps/amdcccle-su |
787 |
%{_sysconfdir}/pam.d/amdcccle-su |
788 |
%{_bindir}/amdcccle |
789 |
%dir %{_datadir}/ati |
790 |
%dir %{_datadir}/ati/amdcccle |
791 |
%if %{atibuild} |
792 |
%{_iconsdir}/%{drivername}-amdcccle.xpm |
793 |
%else |
794 |
%{_miconsdir}/%{drivername}-amdcccle.png |
795 |
%{_iconsdir}/%{drivername}-amdcccle.png |
796 |
%{_liconsdir}/%{drivername}-amdcccle.png |
797 |
%endif |
798 |
%{_datadir}/applications/amdcccle.desktop |
799 |
%{_datadir}/applications/amdccclesu.desktop |
800 |
%if %{bundle_qt} |
801 |
%dir %{_libdir}/%{drivername}-qt4 |
802 |
%{_libdir}/%{drivername}-qt4/libQtCore.so.4 |
803 |
%{_libdir}/%{drivername}-qt4/libQtGui.so.4 |
804 |
%{_datadir}/ati/%{_lib} |
805 |
%endif |
806 |
|
807 |
%files -n %{drivername}-devel |
808 |
%defattr(-,root,root) |
809 |
#%{_libdir}/%{drivername}/libfglrx_gamma.a |
810 |
%{_libdir}/%{drivername}/libfglrx_dm.a |
811 |
#%{_libdir}/%{drivername}/libfglrx_gamma.so |
812 |
%{_libdir}/%{drivername}/libfglrx_dm.so |
813 |
%{_libdir}/%{drivername}/libAMDXvBA.so |
814 |
%{_libdir}/%{drivername}/libXvBAW.so |
815 |
#%{_includedir}/X11/extensions/fglrx_gamma.h |
816 |
%dir %{_includedir}/GL |
817 |
%{_includedir}/GL/*ATI.h |
818 |
%dir %{_includedir}/ATI |
819 |
%dir %{_includedir}/ATI/GL |
820 |
%{_includedir}/ATI/GL/*.h |
821 |
%{_libdir}/%{drivername}/libGL.so |
822 |
%{_libdir}/%{drivername}/libatiuki.so |
823 |
%ifarch x86_64 |
824 |
%{_prefix}/lib/%{drivername}/libGL.so |
825 |
%{_prefix}/lib/%{drivername}/libatiuki.so |
826 |
%endif |
827 |
|
828 |
%files -n dkms-%{drivername} |
829 |
%defattr(-,root,root) |
830 |
%{_usrsrc}/%{drivername}-%{version}-%{release} |