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

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

Parent Directory Parent Directory | Revision Log Revision Log


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

  ViewVC Help
Powered by ViewVC 1.1.30