/[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 87386 - (hide annotations) (download)
Sun Apr 17 18:41:04 2011 UTC (12 years, 11 months ago) by anssi
File size: 31028 byte(s)
- raise rel (SILENT)

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

  ViewVC Help
Powered by ViewVC 1.1.30