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

  ViewVC Help
Powered by ViewVC 1.1.30