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

  ViewVC Help
Powered by ViewVC 1.1.30