/[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 174610 - (show annotations) (download)
Wed Nov 30 22:13:29 2011 UTC (12 years, 4 months ago) by anssi
File size: 32959 byte(s)
add fglrx-opencl package for the new OpenCL libraries

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

  ViewVC Help
Powered by ViewVC 1.1.30