/[packages]/cauldron/fglrx/current/SPECS/fglrx.spec
ViewVC logotype

Contents of /cauldron/fglrx/current/SPECS/fglrx.spec

Parent Directory Parent Directory | Revision Log Revision Log


Revision 293920 - (show annotations) (download)
Fri Sep 14 15:38:02 2012 UTC (11 years, 6 months ago) by tmb
File size: 33552 byte(s)
update to 9.00 (Catalyst 12.9)
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 # %amdbuild is used to enable the AMD installer --buildpkg mode.
35 # The macros version, rel, amd_dir, distsuffix need to be manually defined.
36 # The macro mdkversion can also be overridden.
37 %define amdbuild 0
38 %{?_without_amd: %global amdbuild 0}
39 %{?_with_amd: %global amdbuild 1}
40
41 %if !%{amdbuild}
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 9.00
49 # Advertised version, for description:
50 %define mversion 12.9
51 # driver version from ati-packager-helper.sh:
52 %define iversion 9.00
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 AMD has made late changes (in amdbuild 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 0
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 11
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 %{amdbuild}
86 # AMD/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 without free driver (vesa/fglrx)
91 %endif
92
93 %if %{mgaversion} <= 1
94 %define ldetect_cards_name ATI Radeon HD 2000 and later (vesa/fglrx)
95 %endif
96
97 %ifarch %ix86
98 %define xverdir x%{xorg_version}
99 %define archdir arch/x86
100 %endif
101 %ifarch x86_64
102 %define xverdir x%{xorg_version}_64a
103 %define archdir arch/x86_64
104 %endif
105
106 # Other packages should not require any AMD specific proprietary libraries
107 # (if that is really necessary, we may want to split that specific lib out),
108 # and this package should not be pulled in when libGL.so.1 is required.
109 %define _provides_exceptions \\.so
110
111 %define qt_requires_exceptions %nil
112 %if %{bundle_qt}
113 # do not require Qt if it is bundled
114 %define qt_requires_exceptions \\|libQtCore\\.so\\|libQtGui\\.so
115 %endif
116
117 # do not require fglrx stuff, they are all included
118 %define common_requires_exceptions libfglrx.\\+\\.so\\|libati.\\+\\.so\\|libOpenCL\\.so%{qt_requires_exceptions}
119
120 %ifarch x86_64
121 # (anssi) Allow installing of 64-bit package if the runtime dependencies
122 # of 32-bit libraries are not satisfied. If a 32-bit package that requires
123 # libGL.so.1 is installed, the 32-bit mesa libs are pulled in and that will
124 # pull the dependencies of 32-bit fglrx libraries in as well.
125 %define _requires_exceptions %common_requires_exceptions\\|lib.*so\\.[^(]\\+\\(([^)]\\+)\\)\\?$
126 %else
127 %define _requires_exceptions %common_requires_exceptions
128 %endif
129
130 # (anssi) Do not require qt for amdnotifyui (used as event notifier, as
131 # of 04/2010 only for DisplayPort failures). installing
132 # fglrx-control-center will satisfy the dependency.
133 # It is not moved to fglrx-control-center as due to its small size it may
134 # be wanted on e.g. KDE Ones, which can't have the full fglrx-control-center,
135 # and due to it having nothing to do with fglrx-control-center.
136 %define _exclude_files_from_autoreq ^%{_sbindir}/amdnotifyui$
137
138 Summary: AMD proprietary X.org driver and libraries
139 Name: %{name}
140 Version: %{version}
141 Release: %{release}
142 %if !%{amdbuild}
143 %if !%{ubuntu_prerelease}
144 Source0: https://a248.e.akamai.net/f/674/9206/0/www2.ati.com/drivers/linux/amd-driver-installer-%{oversion}-x86.x86_64.run
145 %else
146 Source0: fglrx-installer_%{iversion}.orig.tar.gz
147 %endif
148 %endif
149 Source1: ati-packager.sh
150 Source2: atieventsd.init
151 %if !%{amdbuild}
152 # Generates fglrx.spec from Mandriva SVN for use in AMD installer
153 # archive. Requires kenobi access for fetching names for changelog.
154 # (for manual use)
155 Source10: generate-fglrx-spec-from-svn.sh
156 %endif
157 Patch3: fglrx-authfile-locations.patch
158 Patch9: fglrx-make_sh-custom-kernel-dir.patch
159 # do not probe /proc for kernel info as we may be building for a
160 # different kernel
161 Patch10: fglrx-make_sh-no-proc-probe.patch
162 # fix build with 3.5 series kernels (from ubuntu)
163 Patch15: fglrx-replace-do_mmap-and-do_munmap-with-vm_mmap-and-vm_mu.patch
164
165 License: Freeware
166 URL: http://ati.amd.com/support/driver.html
167 Group: System/Kernel and hardware
168 ExclusiveArch: %{ix86} x86_64
169 %if !%{amdbuild}
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 AMD proprietary driver. Binary packages are
183 named x11-driver-video-fglrx on %{_vendor}.
184 %if !%{amdbuild}
185 This package corresponds to AMD Catalyst version %mversion.
186 %endif
187
188 %package -n %{driverpkgname}
189 Summary: AMD 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 !%{amdbuild}
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 ### This is problematic as it can cause removal of xserver instead (Anssi 04/2011)
206 ### Conflicts: xserver-abi(videodrv-%(echo $((%{videodrv_abi} + 1))))
207 %endif
208 Provides: atieventsd = %{version}-%{release}
209 Obsoletes: atieventsd < %{version}-%{release}
210
211 %description -n %{driverpkgname}
212 AMD proprietary X.org graphics driver, related libraries and
213 configuration tools.
214
215 NOTE: You should use XFdrake to configure your AMD card. The
216 correct packages will be automatically installed and configured.
217
218 If you do not want to use XFdrake, see README.manual-setup.
219
220 The graphical configuration utility, AMD Catalyst Control Center
221 Linux Edition, is contained in the package
222 %{drivername}-control-center.
223 %if !%{amdbuild}
224 This package corresponds to AMD Catalyst version %mversion.
225 %endif
226
227 %package -n %{drivername}-control-center
228 Summary: AMD Catalyst Control Center Linux Edition
229 Group: System/Kernel and hardware
230 Requires: %{driverpkgname} = %{version}
231 Obsoletes: ati-utils < %{version}-%{release}
232 Provides: ati-utils = %{version}-%{release}
233 Provides: amdcccle = %{version}-%{release}
234 Obsoletes: ati-ccc < %{version}-%{release}
235 Obsoletes: ati-control-center < %{version}-%{release}
236 Provides: ati-control-center = %{version}-%{release}
237 %if !%{bundle_qt}
238 # 2009.0 and 2009.1 have this one in updates only
239 Requires: %{_lib}qtcore4 >= 3:4.5.2
240 %endif
241
242 %description -n %{drivername}-control-center
243 AMD Catalyst Control Center Linux Edition, a graphical configuration
244 utility for the AMD proprietary X.org driver.
245 %if !%{amdbuild}
246 This package corresponds to AMD Catalyst version %mversion.
247 %endif
248
249 %package -n dkms-%{drivername}
250 Summary: AMD proprietary kernel module
251 Group: System/Kernel and hardware
252 Requires: dkms
253 Requires(post): dkms
254 Requires(preun): dkms
255 Obsoletes: dkms-ati < %{version}-%{release}
256 Provides: dkms-ati = %{version}-%{release}
257
258 %description -n dkms-%{drivername}
259 AMD proprietary kernel module. This is to be used with the
260 %{driverpkgname} package.
261 %if !%{amdbuild}
262 This package corresponds to AMD Catalyst version %mversion.
263 %endif
264
265 %package -n %{drivername}-devel
266 Summary: AMD 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 AMD 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 %package -n %{drivername}-opencl
279 Summary: OpenCL libraries for the AMD proprietary driver
280 Group: System/Kernel and hardware
281 Requires: kmod(fglrx) = %{version}
282 Conflicts: x11-driver-video-fglrx < 8.911-2
283
284 %description -n %{drivername}-opencl
285 OpenCL libraries for the AMD proprietary driver. This package is not
286 required for normal use, it provides libraries to use AMD cards for High
287 Performance Computing (HPC).
288
289 %prep
290 %setup -T -c
291 %if %{amdbuild}
292 ln -s %{amd_dir}/%{xverdir} %{amd_dir}/arch .
293 # patches affects common, so we cannot symlink it:
294 cp -a %{amd_dir}/common .
295 %else
296 %if %ubuntu_prerelease
297 %setup -q -T -D -a 0
298 ln -s . common
299 %else
300 sh %{SOURCE0} --extract .
301 %endif
302
303 mkdir fglrx_tools
304 tar -xzf common/usr/src/ati/fglrx_sample_source.tgz -C fglrx_tools
305 %if %ubuntu_prerelease
306 [ -d "%xverdir" ] || (echo This driver version does not support your X.org server. Please wait for a new release from AMD. >&2; false)
307 %else
308 [ "%iversion" = "$(./ati-packager-helper.sh --version)" ]
309 %endif
310 %endif
311
312 cd common # ensure patches do not touch outside
313 %patch3 -p2
314 %patch9 -p2
315 %patch10 -p2
316 %patch15 -p2
317 cd ..
318
319 cat > README.install.urpmi <<EOF
320 This driver is for ATI Radeon HD 5000 and newer cards.
321 Reconfiguring is not necessary when upgrading from a previous %{_vendor} AMD
322 driver package.
323
324 Use XFdrake to configure X to use the correct AMD driver. Any needed
325 packages will be automatically installed if not already present.
326 1. Run XFdrake as root.
327 2. Go to the Graphics Card list.
328 3. Select your card (it is usually already autoselected).
329 4. Answer any questions asked and then quit.
330
331 If you do not want to use XFdrake or it does not work correctly for
332 you, see README.manual-setup for manual installation instructions.
333 EOF
334
335 cat > README.manual-setup <<EOF
336 This file describes the procedure for the manual installation of this AMD
337 driver package. You can find the instructions for the recommended automatic
338 installation in the file 'README.install.urpmi' in this directory.
339
340 - Open %{_sysconfdir}/X11/xorg.conf and make the following changes:
341 o Change the Driver to "fglrx" in the Device section
342 o Make the line below the only 'glx' related line in the Module section:
343 Load "glx"
344 o Remove any 'ModulePath' lines from the Files section
345 - Run "update-alternatives --set gl_conf %{_sysconfdir}/ld.so.conf.d/GL/%{ld_so_conf_file}" as root.
346 - Run "ldconfig" as root.
347 EOF
348
349 cat > README.8.980.upgrade.urpmi <<EOF
350 REMOVED GRAPHICS DRIVER SUPPORT NOTIFICATION:
351 Versions 8.980 and later of AMD Proprietary Graphics driver (fglrx) only
352 support Radeon HD 5000 or newer cards.
353
354 If you have an older Radeon card or are unsure, please reconfigure your
355 driver:
356 1. Run XFdrake as root or select Graphical server configuration in
357 %{_vendor} Control Center.
358 2. Go to the Graphics Card list.
359 3. Select your card (it is usually already autoselected).
360 4. Answer any questions asked and then quit.
361 EOF
362
363 %build
364 %if !%{amdbuild}
365 # %amdbuild is done with minimal buildrequires
366 cd fglrx_tools/fgl_glxgears
367 xmkmf
368 %make RMAN=/bin/true CC="%__cc %optflags -I../../common/usr/include" EXTRA_LDOPTIONS="%{?ldflags}"
369 cd -
370 %endif
371
372 %install
373 rm -rf %{buildroot}
374
375 # dkms
376 install -d -m755 %{buildroot}%{_usrsrc}/%{drivername}-%{version}-%{release}
377 cp -a common/lib/modules/fglrx/build_mod/* %{buildroot}%{_usrsrc}/%{drivername}-%{version}-%{release}
378 cp -a %{archdir}/lib/modules/fglrx/build_mod/* %{buildroot}%{_usrsrc}/%{drivername}-%{version}-%{release}
379
380 #install -d -m755 %{buildroot}%{_usrsrc}/%{drivername}-%{version}-%{release}/patches
381 #install -m644 %{SOURCE3} %{buildroot}%{_usrsrc}/%{drivername}-%{version}-%{release}/patches
382
383 cat > %{buildroot}%{_usrsrc}/%{drivername}-%{version}-%{release}/dkms.conf <<EOF
384 PACKAGE_NAME="%{drivername}"
385 PACKAGE_VERSION="%{version}-%{release}"
386 BUILT_MODULE_NAME[0]="fglrx"
387 DEST_MODULE_LOCATION[0]="/kernel/drivers/char/drm"
388 # uname_v set to none so that make.sh doesn't try to use "uname -v" to see
389 # if the target kernel is SMP (we may be compiling for a different kernel)
390 MAKE[0]="sh make.sh --uname_r=\${kernelver} --uname_v=none --kernel-dir=\${kernel_source_dir} --no-proc-probe --norootcheck"
391 CLEAN="rm -rf 2.6.x/.tmp_versions; make -C2.6.x clean"
392 AUTOINSTALL="yes"
393 EOF
394
395 # headers
396 install -d -m755 %{buildroot}%{_includedir}
397 cp -a common/usr/include/* %{buildroot}%{_includedir}
398 chmod 0644 %{buildroot}%{_includedir}/*/*.h
399
400 # install binaries
401 install -d -m755 %{buildroot}%{_sbindir}
402 install -m755 %{archdir}/usr/sbin/* %{buildroot}%{_sbindir}
403 install -m755 common/usr/sbin/* %{buildroot}%{_sbindir}
404 install -d -m755 %{buildroot}%{_bindir}
405 install -m755 %{archdir}/usr/bin/* %{buildroot}%{_bindir}
406 install -m755 %{archdir}/usr/X11R6/bin/* %{buildroot}%{_bindir}
407 install -m755 common/usr/X11R6/bin/* %{buildroot}%{_bindir}
408 %if !%{amdbuild}
409 # install self-built binaries
410 install -m755 fglrx_tools/fgl_glxgears/fgl_glxgears %{buildroot}%{_bindir}
411 %endif
412 # compatibility symlink
413 ln -s aticonfig %{buildroot}%{_bindir}/amdconfig
414
415 # atieventsd initscript
416 install -d -m755 %{buildroot}%{_initrddir}
417 install -m755 %{SOURCE2} %{buildroot}%{_initrddir}/atieventsd
418
419 # amdcccle data files
420 install -d -m755 %{buildroot}%{_datadir}/ati/amdcccle
421 rm -f amdcccle.langs
422 for fullname in common/usr/share/ati/amdcccle/*.qm; do
423 file=$(basename $fullname)
424 lang=${file#*_}
425 lang=${lang%%.qm}
426 %if !%{bundle_qt}
427 # qt localization not necessary with non-bundled qt
428 [ "$file" = "${file#qt}" ] || continue
429 %endif
430 install -m644 $fullname %{buildroot}%{_datadir}/ati/amdcccle
431 echo "%%lang($lang) %{_datadir}/ati/amdcccle/$file" >> amdcccle.langs
432 done
433
434 # amdcccle super-user mode
435 install -d -m755 %{buildroot}%{_sysconfdir}/security/console.apps
436 install -d -m755 %{buildroot}%{_sysconfdir}/pam.d
437 install -m644 common/etc/security/console.apps/* %{buildroot}%{_sysconfdir}/security/console.apps
438 ln -s su %{buildroot}%{_sysconfdir}/pam.d/amdcccle-su
439
440 # man pages
441 install -d -m755 %{buildroot}%{_mandir}/man1 %{buildroot}%{_mandir}/man8
442 install -m644 common/usr/share/man/man8/* %{buildroot}%{_mandir}/man8
443
444 # menu entry
445 install -d -m755 %{buildroot}%{_datadir}/applications
446 install -m644 common/usr/share/applications/* %{buildroot}%{_datadir}/applications
447 sed -i 's,^Icon=.*$,Icon=%{drivername}-amdcccle,' %{buildroot}%{_datadir}/applications/*.desktop
448 # control center doesn't really use GNOME/KDE libraries:
449 sed -i 's,GNOME;KDE;,,' %{buildroot}%{_datadir}/applications/*.desktop
450
451 # icons
452 install -d -m755 %{buildroot}%{_miconsdir} %{buildroot}%{_iconsdir} %{buildroot}%{_liconsdir}
453 %if !%{amdbuild}
454 convert common/usr/share/icons/ccc_large.xpm -resize 16x16 %{buildroot}%{_miconsdir}/%{drivername}-amdcccle.png
455 convert common/usr/share/icons/ccc_large.xpm -resize 32x32 %{buildroot}%{_iconsdir}/%{drivername}-amdcccle.png
456 convert common/usr/share/icons/ccc_large.xpm -resize 48x48 %{buildroot}%{_liconsdir}/%{drivername}-amdcccle.png
457 %else
458 install -m644 common/usr/share/icons/ccc_large.xpm %{buildroot}%{_iconsdir}/%{drivername}-amdcccle.xpm
459 %endif
460
461 # install libraries
462 install -d -m755 %{buildroot}%{_libdir}/%{drivername}
463 install -m755 %{archdir}/usr/X11R6/%{_lib}/*.* %{buildroot}%{_libdir}/%{drivername}
464 install -m755 %{archdir}/usr/X11R6/%{_lib}/fglrx/* %{buildroot}%{_libdir}/%{drivername}
465 install -m755 %{archdir}/usr/%{_lib}/*.* %{buildroot}%{_libdir}/%{drivername}
466 mv %{buildroot}%{_libdir}/%{drivername}/{fglrx-,}libGL.so.1.2
467 chmod 0644 %{buildroot}%{_libdir}/%{drivername}/*.a
468 /sbin/ldconfig -n %{buildroot}%{_libdir}/%{drivername}
469 # create devel symlinks
470 for file in %{buildroot}%{_libdir}/%{drivername}/*.so.*.*; do
471 ln -s $(basename $file) ${file%%.so*}.so;
472 done
473 %ifarch x86_64
474 install -d -m755 %{buildroot}%{_prefix}/lib/%{drivername}
475 install -m755 arch/x86/usr/X11R6/lib/fglrx/* %{buildroot}%{_prefix}/lib/%{drivername}
476 install -m755 arch/x86/usr/lib/*.* %{buildroot}%{_prefix}/lib/%{drivername}
477 mv %{buildroot}%{_prefix}/lib/%{drivername}/{fglrx-,}libGL.so.1.2
478 /sbin/ldconfig -n %{buildroot}%{_prefix}/lib/%{drivername}
479 # create devel symlinks
480 for file in %{buildroot}%{_prefix}/lib/%{drivername}/*.so.*.*; do
481 ln -s $(basename $file) ${file%%.so*}.so;
482 done
483 %endif
484
485 %if %{bundle_qt}
486 # install the bundled Qt4 libs on distros with qt4 < 4.4.2
487 install -d -m755 %{buildroot}%{_libdir}/%{drivername}-qt4
488 install -m755 %{archdir}/usr/share/ati/%{_lib}/* %{buildroot}%{_libdir}/%{drivername}-qt4
489 # RPATH of amdcccle points to datadir, we create a symlink there:
490 install -d -m755 %{buildroot}/usr/share/ati
491 ln -s %{_libdir}/%{drivername}-qt4 %{buildroot}/usr/share/ati/%{_lib}
492 %endif
493
494 # install X.org files
495 install -d -m755 %{buildroot}%{xorg_libdir}/modules/drivers
496 install -m755 %{xverdir}/usr/X11R6/%{_lib}/modules/drivers/*.so* %{buildroot}%{xorg_libdir}/modules/drivers
497 install -d -m755 %{buildroot}%{xorg_libdir}/modules/linux
498 install -m755 %{xverdir}/usr/X11R6/%{_lib}/modules/linux/*.so* %{buildroot}%{xorg_libdir}/modules/linux
499 install -m644 %{xverdir}/usr/X11R6/%{_lib}/modules/*.*o %{buildroot}%{xorg_libdir}/modules
500 install -d -m755 %{buildroot}%{ati_extdir}
501 install -m755 %{xverdir}/usr/X11R6/%{_lib}/modules/extensions/fglrx/*.so* %{buildroot}%{ati_extdir}
502 mv %{buildroot}%{ati_extdir}/{fglrx-,}libglx.so
503
504 # etc files
505 install -d -m755 %{buildroot}%{_sysconfdir}/ati
506 install -m644 common/etc/ati/* %{buildroot}%{_sysconfdir}/ati
507 chmod 0755 %{buildroot}%{_sysconfdir}/ati/*.sh
508 # Ghost file created as suggested by AMD.
509 touch %{buildroot}%{_sysconfdir}/ati/atiapfuser.blb
510
511 # dri libraries
512 install -d -m755 %{buildroot}%{xorg_dridir}
513 install -m755 %{archdir}/usr/X11R6/%{_lib}/modules/dri/* %{buildroot}%{xorg_dridir}
514 %ifarch x86_64
515 install -d -m755 %{buildroot}%{xorg_dridir32}
516 install -m755 arch/x86/usr/X11R6/lib/modules/dri/* %{buildroot}%{xorg_dridir32}
517 %endif
518
519 # ld.so.conf
520 install -d -m755 %{buildroot}%{_sysconfdir}/ld.so.conf.d/GL
521 echo "%{_libdir}/%{drivername}" > %{buildroot}%{_sysconfdir}/ld.so.conf.d/GL/%{ld_so_conf_file}
522 %ifarch x86_64
523 echo "%{_prefix}/lib/%{drivername}" >> %{buildroot}%{_sysconfdir}/ld.so.conf.d/GL/%{ld_so_conf_file}
524 %endif
525 touch %{buildroot}%{_sysconfdir}/ld.so.conf.d/GL.conf
526
527 # XvMCConfig
528 install -d -m755 %{buildroot}%{_sysconfdir}/%{drivername}
529 echo "libAMDXvBA.so.1" > %{buildroot}%{_sysconfdir}/%{drivername}/XvMCConfig
530
531 # OpenCL icd
532 install -d -m755 %{buildroot}%{_sysconfdir}/OpenCL/vendors
533 install -m644 %{archdir}/etc/OpenCL/vendors/* %{buildroot}%{_sysconfdir}/OpenCL/vendors
534 %ifarch x86_64
535 install -m644 arch/x86/etc/OpenCL/vendors/* %{buildroot}%{_sysconfdir}/OpenCL/vendors
536 %endif
537
538 # PowerXpress intel - use Mesa libGL but still keep AMD specific libs in search path
539 echo "%{_libdir}/mesa" > %{buildroot}%{_sysconfdir}/%{drivername}/pxpress-free.ld.so.conf
540 %ifarch x86_64
541 echo "%{_prefix}/lib/mesa" >> %{buildroot}%{_sysconfdir}/%{drivername}/pxpress-free.ld.so.conf
542 %endif
543 cat %{buildroot}%{_sysconfdir}/ld.so.conf.d/GL/%{ld_so_conf_file} >> %{buildroot}%{_sysconfdir}/%{drivername}/pxpress-free.ld.so.conf
544
545 # install ldetect-lst pcitable files for backports
546 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
547 [ $(stat -c%s pcitable.fglrx.lst) -gt 500 ]
548 %if "%{ldetect_cards_name}" != ""
549 install -d -m755 %{buildroot}%{_datadir}/ldetect-lst/pcitable.d
550 gzip -c pcitable.fglrx.lst > %{buildroot}%{_datadir}/ldetect-lst/pcitable.d/40%{drivername}.lst.gz
551 %endif
552
553 install -d -m755 %{buildroot}%{_datadir}/ati
554 cat > %{buildroot}%{_datadir}/ati/amd-uninstall.sh <<EOF
555 #!/bin/bash
556 # parameters as per AMD: [--force | --dry-run]
557 dryrun=
558 while [ -n "\$*" ]; do
559 case "\$1" in
560 --dryrun) dryrun="--test" ;;
561 --force) ;;
562 --preserve) ;;
563 --quick) ;;
564 --getUninstallVersion) exit 2 ;;
565 *) echo "Unknown option for \$0." >&2 ;;
566 esac
567 shift
568 done
569
570 # AMD documentation suggests doing rpm -V and use --force to override it,
571 # but it doesn't make sense with the update-alternatives setup, so we just
572 # check package presence.
573 pkgs=
574 rpm -q --quiet %{driverpkgname} && pkgs="\$pkgs %{driverpkgname}"
575 rpm -q --quiet dkms-%{drivername} && pkgs="\$pkgs dkms-%{drivername}"
576 rpm -q --quiet %{drivername}-control-center && pkgs="\$pkgs %{drivername}-control-center"
577 rpm -q --quiet %{drivername}-devel && pkgs="\$pkgs %{drivername}-devel"
578 [ -n "\$pkgs" ] || { echo "The AMD proprietary driver is not installed." >&2; exit 1; }
579 urpme --auto \$dryrun \$pkgs || { echo "Failed to uninstall the AMD proprietary driver." >&2; exit 1; }
580 [ -n "\$dryrun" ] || echo "The AMD proprietary driver has been uninstalled."
581 EOF
582 chmod 0755 %{buildroot}%{_datadir}/ati/amd-uninstall.sh
583
584 # PowerXpress (switchable graphics)
585 # - path hardcoded into driver
586 install -d -m755 %{buildroot}%{_libdir}/fglrx
587 cat > %{buildroot}%{_libdir}/fglrx/switchlibGL <<EOF
588 #!/bin/sh
589
590 amd_target="%{_sysconfdir}/ld.so.conf.d/GL/%{ld_so_conf_file}"
591 intel_target="%{_sysconfdir}/%{drivername}/pxpress-free.ld.so.conf"
592
593 case \$1 in
594 amd)
595 update-alternatives --set gl_conf "\$amd_target" >/dev/null
596 ldconfig -X
597 ;;
598 intel)
599 update-alternatives --set gl_conf "\$intel_target" >/dev/null
600 ldconfig -X
601 ;;
602 query)
603 case \$(readlink -f "%{_sysconfdir}/ld.so.conf.d/GL.conf") in
604 \$amd_target)
605 echo "amd"
606 ;;
607 \$intel_target)
608 echo "intel"
609 ;;
610 *)
611 echo "unknown"
612 ;;
613 esac
614 ;;
615 esac
616 EOF
617 chmod 0755 %{buildroot}%{_libdir}/fglrx/switchlibGL
618
619 # It is not feasible to configure these separately with the alternatives
620 # system, so use the same script for both.
621 # Note: using a symlink here fails as the driver checks go+w without
622 # dereferencing the symlink.
623 cp -a %{buildroot}%{_libdir}/fglrx/switchlibGL %{buildroot}%{_libdir}/fglrx/switchlibglx
624
625 %pre -n %{driverpkgname}
626 # Handle alternatives-era /etc/ati directory
627 # It may confuse rpm due to it containing %config files
628 if [ -L %{_sysconfdir}/ati ]; then
629 rm %{_sysconfdir}/ati
630 fi
631
632 %post -n %{driverpkgname}
633 # Migrate from pre-alternatives files
634 if [ ! -L %{_datadir}/applications/mandriva-amdcccle.desktop -a -e %{_datadir}/applications/mandriva-amdcccle.desktop ]; then
635 rm -f %{_datadir}/applications/mandriva-amdcccle.desktop
636 fi
637
638 %{_sbindir}/update-alternatives \
639 --install %{_sysconfdir}/ld.so.conf.d/GL.conf gl_conf %{_sysconfdir}/ld.so.conf.d/GL/%{ld_so_conf_file} %{priority} \
640 --slave %{_sysconfdir}/X11/XvMCConfig xvmcconfig %{_sysconfdir}/%{drivername}/XvMCConfig \
641 --slave %{_libdir}/libAMDXvBA.cap %{_lib}AMDXvBA_cap %{_libdir}/%{drivername}/libAMDXvBA.cap \
642 %ifarch x86_64
643 --slave %{_prefix}/lib/libAMDXvBA.cap libAMDXvBA_cap %{_libdir}/%{drivername}/libAMDXvBA.cap \
644 %endif
645 --slave %{xorg_extra_modules} xorg_extra_modules %{ati_extdir}
646
647 # Alternative for PowerXpress intel (switchable graphics)
648 # This is a separate alternative so that this situation can be differentiated
649 # from standard intel configuration by tools (e.g. so that radeon driver won't
650 # be loaded despite fglrx not being configured anymore).
651 %{_sbindir}/update-alternatives \
652 --install %{_sysconfdir}/ld.so.conf.d/GL.conf gl_conf %{_sysconfdir}/%{drivername}/pxpress-free.ld.so.conf 50
653
654 if [ "$(readlink -e %{_sysconfdir}/ld.so.conf.d/GL.conf)" = "%{_sysconfdir}/ld.so.conf.d/GL/ati-hd2000.conf" ]; then
655 # Switch from the obsolete hd2000 branch:
656 %{_sbindir}/update-alternatives --set gl_conf %{_sysconfdir}/ld.so.conf.d/GL/%{ld_so_conf_file}
657 fi
658 # When upgrading from alternatives setup, rpm may consider /etc/ati/atiogl.xml
659 # to exist due to the symlink, even when we remove it in %pre:
660 if [ -e %{_sysconfdir}/ati/atiogl.xml.rpmnew -a ! -e %{_sysconfdir}/ati/atiogl.xml ]; then
661 mv %{_sysconfdir}/ati/atiogl.xml.rpmnew %{_sysconfdir}/ati/atiogl.xml
662 echo "Moved %{_sysconfdir}/ati/atiogl.xml.rpmnew back to %{_sysconfdir}/ati/atiogl.xml."
663 fi
664
665 # Call /sbin/ldconfig explicitely due to alternatives
666 /sbin/ldconfig -X
667 %_post_service atieventsd
668 %if "%{ldetect_cards_name}" != ""
669 [ -x %{_sbindir}/update-ldetect-lst ] && %{_sbindir}/update-ldetect-lst || :
670 %endif
671
672 # Ghost file created as suggested by AMD.
673 touch %{_sysconfdir}/ati/atiapfuser.blb
674
675 # Clear driver version numbers from amdpcsdb as suggested by AMD.
676 # (fixes version display in amdcccle after upgrade)
677 amdconfig --del-pcs-key=LDC,ReleaseVersion &>/dev/null || :
678 amdconfig --del-pcs-key=LDC,Catalyst_Version &>/dev/null || :
679
680 %posttrans -n %{driverpkgname}
681 # RPM seems to leave out the active /etc/fglrx* directory, likely due to
682 # it being confused with the /etc/ati symlink. We have to clean up ourself:
683 for dir in %{_sysconfdir}/fglrx %{_sysconfdir}/fglrx-hd2000; do
684 if [ -d $dir ]; then
685 for file in $dir/*; do
686 case "$(basename $file)" in
687 control | signature | logo_mask.xbm.example | logo.xbm.example)
688 # non-config files, rpm would normally remove
689 rm $file;;
690 authatieventsd.sh | fglrxprofiles.csv | fglrxrc | atiogl.xml)
691 # config files, check for modifications
692 case "$(stat -c%s $file)" in
693 545 | 838 | 2769 | 10224 | 11018)
694 rm $file;;
695 *)
696 echo "Saving $file as %{_sysconfdir}/ati/$(basename $file).rpmsave."
697 mv $file %{_sysconfdir}/ati/$(basename $file).rpmsave;;
698 esac
699 ;;
700 esac
701 done
702 [ $(ls -c $dir | wc -l) -eq 0 ] && rm -r $dir
703 fi
704 done
705 true
706
707 %preun -n %{driverpkgname}
708 %_preun_service atieventsd
709
710 %postun -n %{driverpkgname}
711 if [ ! -f %{_sysconfdir}/ld.so.conf.d/GL/%{ld_so_conf_file} ]; then
712 %{_sbindir}/update-alternatives --remove gl_conf %{_sysconfdir}/ld.so.conf.d/GL/%{ld_so_conf_file}
713 fi
714 if [ ! -f %{_sysconfdir}/%{drivername}/pxpress-free.ld.so.conf ]; then
715 %{_sbindir}/update-alternatives --remove gl_conf %{_sysconfdir}/%{drivername}/pxpress-free.ld.so.conf
716 fi
717 # Call /sbin/ldconfig explicitely due to alternatives
718 /sbin/ldconfig -X
719 %if "%{ldetect_cards_name}" != ""
720 [ -x %{_sbindir}/update-ldetect-lst ] && %{_sbindir}/update-ldetect-lst || :
721 %endif
722
723 %pre -n %{drivername}-control-center
724 # Handle alternatives-era directory,
725 # it may confuse rpm.
726 if [ -L %{_datadir}/ati ]; then
727 rm %{_datadir}/ati
728 fi
729
730 %post -n %{drivername}-control-center
731 [ -d %{_datadir}/fglrx ] && rm -r %{_datadir}/fglrx
732 [ -d %{_datadir}/fglrx-hd2000 ] && rm -r %{_datadir}/fglrx-hd2000
733 true
734
735 %post -n %{drivername}-opencl
736 # explicit /sbin/ldconfig due to a non-standard library directory
737 /sbin/ldconfig -X
738
739 %post -n dkms-%{drivername}
740 /usr/sbin/dkms --rpm_safe_upgrade add -m %{drivername} -v %{version}-%{release} &&
741 /usr/sbin/dkms --rpm_safe_upgrade build -m %{drivername} -v %{version}-%{release} &&
742 /usr/sbin/dkms --rpm_safe_upgrade install -m %{drivername} -v %{version}-%{release} --force
743
744 # rmmod any old driver if present and not in use (e.g. by X)
745 rmmod fglrx > /dev/null 2>&1 || true
746
747 %preun -n dkms-%{drivername}
748 /usr/sbin/dkms --rpm_safe_upgrade remove -m %{drivername} -v %{version}-%{release} --all
749
750 # rmmod any old driver if present and not in use (e.g. by X)
751 rmmod fglrx > /dev/null 2>&1 || true
752
753 %clean
754 rm -rf %{buildroot}
755
756 %files -n %{driverpkgname}
757 %defattr(-,root,root)
758 %doc README.install.urpmi README.manual-setup
759 %doc README.8.980.upgrade.urpmi
760 # the documentation files are grossly out of date; the configuration options
761 # described in configure.html seem to be used by the driver, though, so it is
762 # packaged, while the other html files are not:
763 %doc common/usr/share/doc/fglrx/configure.html
764 %doc common/usr/share/doc/fglrx/LICENSE.TXT
765
766 %if "%{ldetect_cards_name}" != ""
767 %{_datadir}/ldetect-lst/pcitable.d/40%{drivername}.lst.gz
768 %endif
769
770 %ghost %{_sysconfdir}/ld.so.conf.d/GL.conf
771 %dir %{_sysconfdir}/ld.so.conf.d/GL
772 %{_sysconfdir}/ld.so.conf.d/GL/ati.conf
773
774 %dir %{_sysconfdir}/%{drivername}
775 %{_sysconfdir}/%{drivername}/XvMCConfig
776 %{_sysconfdir}/%{drivername}/pxpress-free.ld.so.conf
777
778 %dir %{_sysconfdir}/ati
779 %{_sysconfdir}/ati/control
780 %{_sysconfdir}/ati/signature
781 %config(noreplace) %{_sysconfdir}/ati/atiogl.xml
782 %{_sysconfdir}/ati/atiapfxx.blb
783 %{_sysconfdir}/ati/logo.xbm.example
784 %{_sysconfdir}/ati/logo_mask.xbm.example
785 %config %{_sysconfdir}/ati/authatieventsd.sh
786 %{_sysconfdir}/ati/amdpcsdb.default
787 %ghost %{_sysconfdir}/ati/atiapfuser.blb
788
789 %{_initrddir}/atieventsd
790
791 %{_sbindir}/atieventsd
792 %{_sbindir}/amdnotifyui
793 %{_sbindir}/atigetsysteminfo.sh
794
795 %{_bindir}/amdconfig
796 %{_bindir}/amdupdaterandrconfig
797 %{_bindir}/amdxdg-su
798 %{_bindir}/aticonfig
799 %{_bindir}/atiodcli
800 %{_bindir}/atiode
801 %{_bindir}/fgl_glxgears
802 %{_bindir}/fglrxinfo
803
804 %{xorg_libdir}/modules/drivers/fglrx_drv.so
805 %{xorg_libdir}/modules/linux/libfglrxdrm.so
806 %{xorg_libdir}/modules/amdxmm.*o
807 %{xorg_libdir}/modules/glesx.*o
808
809 %dir %{ati_extdir}
810 %{ati_extdir}/libglx.so
811
812 %{xorg_dridir}/fglrx_dri.so
813 %ifarch x86_64
814 %{xorg_dridir32}/fglrx_dri.so
815 %endif
816
817 %dir %{_libdir}/%{drivername}
818 %{_libdir}/%{drivername}/libGL.so.1
819 %{_libdir}/%{drivername}/libGL.so.1.*
820 %{_libdir}/%{drivername}/libaticalcl.so
821 %{_libdir}/%{drivername}/libaticaldd.so
822 %{_libdir}/%{drivername}/libaticalrt.so
823 %{_libdir}/%{drivername}/libatiuki.so.1*
824 %{_libdir}/%{drivername}/libSlotMaximizer*.so
825 %ifarch x86_64
826 %dir %{_prefix}/lib/%{drivername}
827 %{_prefix}/lib/%{drivername}/libGL.so.1
828 %{_prefix}/lib/%{drivername}/libGL.so.1.*
829 %{_prefix}/lib/%{drivername}/libaticalcl.so
830 %{_prefix}/lib/%{drivername}/libaticaldd.so
831 %{_prefix}/lib/%{drivername}/libaticalrt.so
832 %{_prefix}/lib/%{drivername}/libatiuki.so.1*
833 %{_prefix}/lib/%{drivername}/libSlotMaximizer*.so
834 %endif
835
836 %{_libdir}/%{drivername}/libfglrx_dm.so.1*
837 %{_libdir}/%{drivername}/libatiadlxx.so
838 %{_libdir}/%{drivername}/libAMDXvBA.cap
839 %{_libdir}/%{drivername}/libAMDXvBA.so.1*
840 %{_libdir}/%{drivername}/libXvBAW.so.1*
841
842 # PowerXpress
843 %{_libdir}/fglrx/switchlibGL
844 %{_libdir}/fglrx/switchlibglx
845
846 %dir %{_datadir}/ati
847 %{_datadir}/ati/amd-uninstall.sh
848
849 %{_mandir}/man8/atieventsd.8*
850
851 %files -n %{drivername}-control-center -f amdcccle.langs
852 %defattr(-,root,root)
853 %doc common/usr/share/doc/amdcccle/*
854 %{_sysconfdir}/security/console.apps/amdcccle-su
855 %{_sysconfdir}/pam.d/amdcccle-su
856 %{_bindir}/amdcccle
857 %dir %{_datadir}/ati
858 %dir %{_datadir}/ati/amdcccle
859 %if %{amdbuild}
860 %{_iconsdir}/%{drivername}-amdcccle.xpm
861 %else
862 %{_miconsdir}/%{drivername}-amdcccle.png
863 %{_iconsdir}/%{drivername}-amdcccle.png
864 %{_liconsdir}/%{drivername}-amdcccle.png
865 %endif
866 %{_datadir}/applications/amdcccle.desktop
867 %{_datadir}/applications/amdccclesu.desktop
868 %if %{bundle_qt}
869 %dir %{_libdir}/%{drivername}-qt4
870 %{_libdir}/%{drivername}-qt4/libQtCore.so.4
871 %{_libdir}/%{drivername}-qt4/libQtGui.so.4
872 %{_datadir}/ati/%{_lib}
873 %endif
874
875 %files -n %{drivername}-devel
876 %defattr(-,root,root)
877 %{_libdir}/%{drivername}/libfglrx_dm.a
878 %{_libdir}/%{drivername}/libfglrx_dm.so
879 %{_libdir}/%{drivername}/libAMDXvBA.so
880 %{_libdir}/%{drivername}/libXvBAW.so
881 %dir %{_includedir}/GL
882 %{_includedir}/GL/*ATI.h
883 %dir %{_includedir}/ATI
884 %dir %{_includedir}/ATI/GL
885 %{_includedir}/ATI/GL/*.h
886 %{_libdir}/%{drivername}/libGL.so
887 %{_libdir}/%{drivername}/libatiuki.so
888 %ifarch x86_64
889 %{_prefix}/lib/%{drivername}/libGL.so
890 %{_prefix}/lib/%{drivername}/libatiuki.so
891 %endif
892
893 %files -n %{drivername}-opencl
894 %defattr(-,root,root)
895 %dir %{_sysconfdir}/OpenCL
896 %dir %{_sysconfdir}/OpenCL/vendors
897 %{_sysconfdir}/OpenCL/vendors/amdocl*.icd
898 %{_bindir}/clinfo
899 %{_libdir}/%{drivername}/libamdocl*.so
900 %{_libdir}/%{drivername}/libOpenCL.so.1
901 %ifarch x86_64
902 %{_prefix}/lib/%{drivername}/libamdocl*.so
903 %{_prefix}/lib/%{drivername}/libOpenCL.so.1
904 %endif
905
906 %files -n dkms-%{drivername}
907 %defattr(-,root,root)
908 %{_usrsrc}/%{drivername}-%{version}-%{release}

  ViewVC Help
Powered by ViewVC 1.1.30