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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 327677 - (show annotations) (download)
Fri Dec 7 00:27:36 2012 UTC (8 years, 9 months ago) by tmb
File size: 33572 byte(s)
fix kernel 3.7 version check (P11)
1
2 ##############################################################################
3 # This .spec file is dual licensed. It can be distributed either with the #
4 # terms of GPL version 2 or newer, or with the MIT license included below. #
5 # Removing either GPL or MIT license when distributing this file is allowed. #
6 ##############################################################################
7 # - start of MIT license -
8 # Copyright (c) 2007-2009 Anssi Hannula, Luiz Fernando Capitulino, Colin Guthrie, Thomas Backlund
9 #
10 # Permission is hereby granted, free of charge, to any person
11 # obtaining a copy of this software and associated documentation
12 # files (the "Software"), to deal in the Software without
13 # restriction, including without limitation the rights to use,
14 # copy, modify, merge, publish, distribute, sublicense, and/or sell
15 # copies of the Software, and to permit persons to whom the
16 # Software is furnished to do so, subject to the following
17 # conditions:
18 #
19 # The above copyright notice and this permission notice shall be
20 # included in all copies or substantial portions of the Software.
21 #
22 # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
23 # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
24 # OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
25 # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
26 # HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
27 # WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
28 # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
29 # OTHER DEALINGS IN THE SOFTWARE.
30 # - end of MIT license -
31
32 %define name fglrx
33
34 # %amdbuild is used to enable the AMD installer --buildpkg mode.
35 # The macros version, rel, amd_dir, distsuffix need to be manually defined.
36 # The macro mdkversion can also be overridden.
37 %define amdbuild 0
38 %{?_without_amd: %global amdbuild 0}
39 %{?_with_amd: %global amdbuild 1}
40
41 %if !%{amdbuild}
42 # NOTE: These version definitions are overridden by ati-packager.sh when
43 # building with the --buildpkg method of the installer.
44
45 # When updating, please add new ids to ldetect-lst (merge2pcitable.pl).
46
47 # version in installer filename:
48 %define oversion 12.11-beta11
49 # Advertised version, for description:
50 %define mversion 12.11
51 # driver version from ati-packager-helper.sh:
52 %define iversion 9.01.8
53 # release:
54 %define rel 3
55 # rpm version (adds 0 in order to not go backwards if iversion is two-decimal)
56 #define version %{iversion}%([ $(echo %iversion | wc -c) -le 5 ] && echo 0)
57 # (tmb) harcode version for beta11
58 %define version 9.010.8
59 %else
60 # Best-effort if AMD has made late changes (in amdbuild mode)
61 %define _default_patch_fuzz 2
62 %endif
63
64 %define priority 1000
65 %define release %mkrel %{rel}
66
67 # set to 1 for a prerelease driver with an ubuntu tarball as source
68 %define ubuntu_prerelease 0
69
70 %define driverpkgname x11-driver-video-fglrx
71 %define drivername fglrx
72 %define xorg_version pic
73 # highest supported videodrv abi
74 %define videodrv_abi 11
75 %define xorg_libdir %{_libdir}/xorg
76 %define xorg_dridir %{_libdir}/dri
77 %define xorg_dridir32 %{_prefix}/lib/dri
78 %define ld_so_conf_file ati.conf
79 %define ati_extdir %{_libdir}/%{drivername}/xorg
80 %define xorg_extra_modules %{_libdir}/xorg/extra-modules
81 %define bundle_qt 0
82 # The entry in Cards+ this driver should be associated with, if there is
83 # no entry in ldetect-lst default pcitable:
84 # cooker ldetect-lst should be up-to-date
85 %define ldetect_cards_name %nil
86
87 %if %{amdbuild}
88 # AMD/ATI cards not listed in main ldetect-lst pcitable are not likely
89 # to be supported by radeon which is from the same time period.
90 # radeonhd has greater chance of working due to it not using ID lists.
91 # (main pcitable entries override our entries)
92 %define ldetect_cards_name ATI Radeon HD 5000 and later without free driver (vesa/fglrx)
93 %endif
94
95 %if %{mgaversion} <= 1
96 %define ldetect_cards_name ATI Radeon HD 2000 and later (vesa/fglrx)
97 %endif
98
99 %ifarch %ix86
100 %define xverdir x%{xorg_version}
101 %define archdir arch/x86
102 %endif
103 %ifarch x86_64
104 %define xverdir x%{xorg_version}_64a
105 %define archdir arch/x86_64
106 %endif
107
108 # Other packages should not require any AMD specific proprietary libraries
109 # (if that is really necessary, we may want to split that specific lib out),
110 # and this package should not be pulled in when libGL.so.1 is required.
111 %define _provides_exceptions \\.so
112
113 %define qt_requires_exceptions %nil
114 %if %{bundle_qt}
115 # do not require Qt if it is bundled
116 %define qt_requires_exceptions \\|libQtCore\\.so\\|libQtGui\\.so
117 %endif
118
119 # do not require fglrx stuff, they are all included
120 %define common_requires_exceptions libfglrx.\\+\\.so\\|libati.\\+\\.so\\|libOpenCL\\.so%{qt_requires_exceptions}
121
122 %ifarch x86_64
123 # (anssi) Allow installing of 64-bit package if the runtime dependencies
124 # of 32-bit libraries are not satisfied. If a 32-bit package that requires
125 # libGL.so.1 is installed, the 32-bit mesa libs are pulled in and that will
126 # pull the dependencies of 32-bit fglrx libraries in as well.
127 %define _requires_exceptions %common_requires_exceptions\\|lib.*so\\.[^(]\\+\\(([^)]\\+)\\)\\?$
128 %else
129 %define _requires_exceptions %common_requires_exceptions
130 %endif
131
132 # (anssi) Do not require qt for amdnotifyui (used as event notifier, as
133 # of 04/2010 only for DisplayPort failures). installing
134 # fglrx-control-center will satisfy the dependency.
135 # It is not moved to fglrx-control-center as due to its small size it may
136 # be wanted on e.g. KDE Ones, which can't have the full fglrx-control-center,
137 # and due to it having nothing to do with fglrx-control-center.
138 %define _exclude_files_from_autoreq ^%{_sbindir}/amdnotifyui$
139
140 Summary: AMD proprietary X.org driver and libraries
141 Name: %{name}
142 Version: %{version}
143 Release: %{release}
144 %if !%{amdbuild}
145 %if !%{ubuntu_prerelease}
146 Source0: https://a248.e.akamai.net/f/674/9206/0/www2.ati.com/drivers/linux/amd-driver-installer-catalyst-%{oversion}-x86.x86_64.run
147 %else
148 Source0: fglrx-installer_%{iversion}.orig.tar.gz
149 %endif
150 %endif
151 Source1: ati-packager.sh
152 Source2: atieventsd.init
153 %if !%{amdbuild}
154 # Generates fglrx.spec from Mandriva SVN for use in AMD installer
155 # archive. Requires kenobi access for fetching names for changelog.
156 # (for manual use)
157 Source10: generate-fglrx-spec-from-svn.sh
158 %endif
159 Patch3: fglrx-authfile-locations.patch
160 Patch9: fglrx-make_sh-custom-kernel-dir.patch
161 # do not probe /proc for kernel info as we may be building for a
162 # different kernel
163 Patch10: fglrx-make_sh-no-proc-probe.patch
164 # (tmb) hack to fix 3.7 build
165 Patch11: fglrx-3.7-buildfix.patch
166
167 License: Freeware
168 URL: http://ati.amd.com/support/driver.html
169 Group: System/Kernel and hardware
170 ExclusiveArch: %{ix86} x86_64
171 %if !%{amdbuild}
172 BuildRequires: mesagl-devel
173 BuildRequires: libxmu-devel
174 BuildRequires: libxaw-devel
175 BuildRequires: libxp-devel
176 BuildRequires: libxtst-devel
177 BuildRequires: imake
178 # Used by atieventsd:
179 Suggests: acpid
180 BuildRequires: ImageMagick
181 %endif
182
183 %description
184 Source package of the AMD proprietary driver. Binary packages are
185 named x11-driver-video-fglrx on %{_vendor}.
186 %if !%{amdbuild}
187 This package corresponds to AMD Catalyst version %mversion.
188 %endif
189
190 %package -n %{driverpkgname}
191 Summary: AMD proprietary X.org driver and libraries
192 Group: System/Kernel and hardware
193 Requires(post): update-alternatives >= 1.9.0
194 Requires(postun): update-alternatives
195 Obsoletes: ati_igp
196 Suggests: %{drivername}-control-center = %{version}
197 Obsoletes: ati < %{version}-%{release}
198 Provides: ati = %{version}-%{release}
199 Requires: kmod(fglrx) = %{version}
200 Requires: x11-server-common >= 1.9
201 %if !%{amdbuild}
202 # Conflict with the next videodrv ABI break.
203 # The driver may support multiple ABI versions and therefore
204 # a strict version-specific requirement would not be enough.
205 # (ahmad) since X Server 1.10 ABI is now 10 (upstream jumped from 8 to 10)
206 # make it +2 for now
207 ### This is problematic as it can cause removal of xserver instead (Anssi 04/2011)
208 ### Conflicts: xserver-abi(videodrv-%(echo $((%{videodrv_abi} + 1))))
209 %endif
210 Provides: atieventsd = %{version}-%{release}
211 Obsoletes: atieventsd < %{version}-%{release}
212
213 %description -n %{driverpkgname}
214 AMD proprietary X.org graphics driver, related libraries and
215 configuration tools.
216
217 NOTE: You should use XFdrake to configure your AMD card. The
218 correct packages will be automatically installed and configured.
219
220 If you do not want to use XFdrake, see README.manual-setup.
221
222 The graphical configuration utility, AMD Catalyst Control Center
223 Linux Edition, is contained in the package
224 %{drivername}-control-center.
225 %if !%{amdbuild}
226 This package corresponds to AMD Catalyst version %mversion.
227 %endif
228
229 %package -n %{drivername}-control-center
230 Summary: AMD Catalyst Control Center Linux Edition
231 Group: System/Kernel and hardware
232 Requires: %{driverpkgname} = %{version}
233 Obsoletes: ati-utils < %{version}-%{release}
234 Provides: ati-utils = %{version}-%{release}
235 Provides: amdcccle = %{version}-%{release}
236 Obsoletes: ati-ccc < %{version}-%{release}
237 Obsoletes: ati-control-center < %{version}-%{release}
238 Provides: ati-control-center = %{version}-%{release}
239 %if !%{bundle_qt}
240 # 2009.0 and 2009.1 have this one in updates only
241 Requires: %{_lib}qtcore4 >= 3:4.5.2
242 %endif
243
244 %description -n %{drivername}-control-center
245 AMD Catalyst Control Center Linux Edition, a graphical configuration
246 utility for the AMD proprietary X.org driver.
247 %if !%{amdbuild}
248 This package corresponds to AMD Catalyst version %mversion.
249 %endif
250
251 %package -n dkms-%{drivername}
252 Summary: AMD proprietary kernel module
253 Group: System/Kernel and hardware
254 Requires: dkms
255 Requires(post): dkms
256 Requires(preun): dkms
257 Obsoletes: dkms-ati < %{version}-%{release}
258 Provides: dkms-ati = %{version}-%{release}
259
260 %description -n dkms-%{drivername}
261 AMD proprietary kernel module. This is to be used with the
262 %{driverpkgname} package.
263 %if !%{amdbuild}
264 This package corresponds to AMD Catalyst version %mversion.
265 %endif
266
267 %package -n %{drivername}-devel
268 Summary: AMD proprietary development libraries and headers
269 Group: Development/C
270 Requires: %{driverpkgname} = %{version}-%{release}
271 Obsoletes: ati-devel < %{version}-%{release}
272 Provides: ati-devel = %{version}-%{release}
273
274 %description -n %{drivername}-devel
275 AMD proprietary development libraries and headers. This package is
276 not required for normal use.
277
278 The main driver package name is %{driverpkgname}.
279
280 %package -n %{drivername}-opencl
281 Summary: OpenCL libraries for the AMD proprietary driver
282 Group: System/Kernel and hardware
283 Requires: kmod(fglrx) = %{version}
284 Conflicts: x11-driver-video-fglrx < 8.911-2
285
286 %description -n %{drivername}-opencl
287 OpenCL libraries for the AMD proprietary driver. This package is not
288 required for normal use, it provides libraries to use AMD cards for High
289 Performance Computing (HPC).
290
291 %prep
292 %setup -T -c
293 %if %{amdbuild}
294 ln -s %{amd_dir}/%{xverdir} %{amd_dir}/arch .
295 # patches affects common, so we cannot symlink it:
296 cp -a %{amd_dir}/common .
297 %else
298 %if %ubuntu_prerelease
299 %setup -q -T -D -a 0
300 ln -s . common
301 %else
302 sh %{SOURCE0} --extract .
303 %endif
304
305 mkdir fglrx_tools
306 tar -xzf common/usr/src/ati/fglrx_sample_source.tgz -C fglrx_tools
307 %if %ubuntu_prerelease
308 [ -d "%xverdir" ] || (echo This driver version does not support your X.org server. Please wait for a new release from AMD. >&2; false)
309 %else
310 [ "%iversion" = "$(./ati-packager-helper.sh --version)" ]
311 %endif
312 %endif
313
314 cd common # ensure patches do not touch outside
315 %patch3 -p2
316 %patch9 -p2
317 %patch10 -p2
318 %patch11 -p2
319 cd ..
320
321 cat > README.install.urpmi <<EOF
322 This driver is for ATI Radeon HD 5000 and newer cards.
323 Reconfiguring is not necessary when upgrading from a previous %{_vendor} AMD
324 driver package.
325
326 Use XFdrake to configure X to use the correct AMD driver. Any needed
327 packages will be automatically installed if not already present.
328 1. Run XFdrake as root.
329 2. Go to the Graphics Card list.
330 3. Select your card (it is usually already autoselected).
331 4. Answer any questions asked and then quit.
332
333 If you do not want to use XFdrake or it does not work correctly for
334 you, see README.manual-setup for manual installation instructions.
335 EOF
336
337 cat > README.manual-setup <<EOF
338 This file describes the procedure for the manual installation of this AMD
339 driver package. You can find the instructions for the recommended automatic
340 installation in the file 'README.install.urpmi' in this directory.
341
342 - Open %{_sysconfdir}/X11/xorg.conf and make the following changes:
343 o Change the Driver to "fglrx" in the Device section
344 o Make the line below the only 'glx' related line in the Module section:
345 Load "glx"
346 o Remove any 'ModulePath' lines from the Files section
347 - Run "update-alternatives --set gl_conf %{_sysconfdir}/ld.so.conf.d/GL/%{ld_so_conf_file}" as root.
348 - Run "ldconfig" as root.
349 EOF
350
351 cat > README.8.980.upgrade.urpmi <<EOF
352 REMOVED GRAPHICS DRIVER SUPPORT NOTIFICATION:
353 Versions 8.980 and later of AMD Proprietary Graphics driver (fglrx) only
354 support Radeon HD 5000 or newer cards.
355
356 If you have an older Radeon card or are unsure, please reconfigure your
357 driver:
358 1. Run XFdrake as root or select Graphical server configuration in
359 %{_vendor} Control Center.
360 2. Go to the Graphics Card list.
361 3. Select your card (it is usually already autoselected).
362 4. Answer any questions asked and then quit.
363 EOF
364
365 %build
366 %if !%{amdbuild}
367 # %amdbuild is done with minimal buildrequires
368 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 %endif
373
374 %install
375 rm -rf %{buildroot}
376
377 # dkms
378 install -d -m755 %{buildroot}%{_usrsrc}/%{drivername}-%{version}-%{release}
379 cp -a common/lib/modules/fglrx/build_mod/* %{buildroot}%{_usrsrc}/%{drivername}-%{version}-%{release}
380 cp -a %{archdir}/lib/modules/fglrx/build_mod/* %{buildroot}%{_usrsrc}/%{drivername}-%{version}-%{release}
381
382 #install -d -m755 %{buildroot}%{_usrsrc}/%{drivername}-%{version}-%{release}/patches
383 #install -m644 %{SOURCE3} %{buildroot}%{_usrsrc}/%{drivername}-%{version}-%{release}/patches
384
385 cat > %{buildroot}%{_usrsrc}/%{drivername}-%{version}-%{release}/dkms.conf <<EOF
386 PACKAGE_NAME="%{drivername}"
387 PACKAGE_VERSION="%{version}-%{release}"
388 BUILT_MODULE_NAME[0]="fglrx"
389 DEST_MODULE_LOCATION[0]="/kernel/drivers/char/drm"
390 # uname_v set to none so that make.sh doesn't try to use "uname -v" to see
391 # if the target kernel is SMP (we may be compiling for a different kernel)
392 MAKE[0]="sh make.sh --uname_r=\${kernelver} --uname_v=none --kernel-dir=\${kernel_source_dir} --no-proc-probe --norootcheck"
393 CLEAN="rm -rf 2.6.x/.tmp_versions; make -C2.6.x clean"
394 AUTOINSTALL="yes"
395 EOF
396
397 # headers
398 install -d -m755 %{buildroot}%{_includedir}
399 cp -a common/usr/include/* %{buildroot}%{_includedir}
400 chmod 0644 %{buildroot}%{_includedir}/*/*.h
401
402 # install binaries
403 install -d -m755 %{buildroot}%{_sbindir}
404 install -m755 %{archdir}/usr/sbin/* %{buildroot}%{_sbindir}
405 install -m755 common/usr/sbin/* %{buildroot}%{_sbindir}
406 install -d -m755 %{buildroot}%{_bindir}
407 install -m755 %{archdir}/usr/bin/* %{buildroot}%{_bindir}
408 install -m755 %{archdir}/usr/X11R6/bin/* %{buildroot}%{_bindir}
409 install -m755 common/usr/X11R6/bin/* %{buildroot}%{_bindir}
410 %if !%{amdbuild}
411 # install self-built binaries
412 install -m755 fglrx_tools/fgl_glxgears/fgl_glxgears %{buildroot}%{_bindir}
413 %endif
414 # compatibility symlink
415 ln -s aticonfig %{buildroot}%{_bindir}/amdconfig
416
417 # atieventsd initscript
418 install -d -m755 %{buildroot}%{_initrddir}
419 install -m755 %{SOURCE2} %{buildroot}%{_initrddir}/atieventsd
420
421 # amdcccle data files
422 install -d -m755 %{buildroot}%{_datadir}/ati/amdcccle
423 rm -f amdcccle.langs
424 for fullname in common/usr/share/ati/amdcccle/*.qm; do
425 file=$(basename $fullname)
426 lang=${file#*_}
427 lang=${lang%%.qm}
428 %if !%{bundle_qt}
429 # qt localization not necessary with non-bundled qt
430 [ "$file" = "${file#qt}" ] || continue
431 %endif
432 install -m644 $fullname %{buildroot}%{_datadir}/ati/amdcccle
433 echo "%%lang($lang) %{_datadir}/ati/amdcccle/$file" >> amdcccle.langs
434 done
435
436 # amdcccle super-user mode
437 install -d -m755 %{buildroot}%{_sysconfdir}/security/console.apps
438 install -d -m755 %{buildroot}%{_sysconfdir}/pam.d
439 install -m644 common/etc/security/console.apps/* %{buildroot}%{_sysconfdir}/security/console.apps
440 ln -s su %{buildroot}%{_sysconfdir}/pam.d/amdcccle-su
441
442 # man pages
443 install -d -m755 %{buildroot}%{_mandir}/man1 %{buildroot}%{_mandir}/man8
444 install -m644 common/usr/share/man/man8/* %{buildroot}%{_mandir}/man8
445
446 # menu entry
447 install -d -m755 %{buildroot}%{_datadir}/applications
448 install -m644 common/usr/share/applications/* %{buildroot}%{_datadir}/applications
449 sed -i 's,^Icon=.*$,Icon=%{drivername}-amdcccle,' %{buildroot}%{_datadir}/applications/*.desktop
450 # control center doesn't really use GNOME/KDE libraries:
451 sed -i 's,GNOME;KDE;,,' %{buildroot}%{_datadir}/applications/*.desktop
452
453 # icons
454 install -d -m755 %{buildroot}%{_miconsdir} %{buildroot}%{_iconsdir} %{buildroot}%{_liconsdir}
455 %if !%{amdbuild}
456 convert common/usr/share/icons/ccc_large.xpm -resize 16x16 %{buildroot}%{_miconsdir}/%{drivername}-amdcccle.png
457 convert common/usr/share/icons/ccc_large.xpm -resize 32x32 %{buildroot}%{_iconsdir}/%{drivername}-amdcccle.png
458 convert common/usr/share/icons/ccc_large.xpm -resize 48x48 %{buildroot}%{_liconsdir}/%{drivername}-amdcccle.png
459 %else
460 install -m644 common/usr/share/icons/ccc_large.xpm %{buildroot}%{_iconsdir}/%{drivername}-amdcccle.xpm
461 %endif
462
463 # install libraries
464 install -d -m755 %{buildroot}%{_libdir}/%{drivername}
465 install -m755 %{archdir}/usr/X11R6/%{_lib}/*.* %{buildroot}%{_libdir}/%{drivername}
466 install -m755 %{archdir}/usr/X11R6/%{_lib}/fglrx/* %{buildroot}%{_libdir}/%{drivername}
467 install -m755 %{archdir}/usr/%{_lib}/*.* %{buildroot}%{_libdir}/%{drivername}
468 mv %{buildroot}%{_libdir}/%{drivername}/{fglrx-,}libGL.so.1.2
469 chmod 0644 %{buildroot}%{_libdir}/%{drivername}/*.a
470 /sbin/ldconfig -n %{buildroot}%{_libdir}/%{drivername}
471 # create devel symlinks
472 for file in %{buildroot}%{_libdir}/%{drivername}/*.so.*.*; do
473 ln -s $(basename $file) ${file%%.so*}.so;
474 done
475 %ifarch x86_64
476 install -d -m755 %{buildroot}%{_prefix}/lib/%{drivername}
477 install -m755 arch/x86/usr/X11R6/lib/fglrx/* %{buildroot}%{_prefix}/lib/%{drivername}
478 install -m755 arch/x86/usr/lib/*.* %{buildroot}%{_prefix}/lib/%{drivername}
479 mv %{buildroot}%{_prefix}/lib/%{drivername}/{fglrx-,}libGL.so.1.2
480 /sbin/ldconfig -n %{buildroot}%{_prefix}/lib/%{drivername}
481 # create devel symlinks
482 for file in %{buildroot}%{_prefix}/lib/%{drivername}/*.so.*.*; do
483 ln -s $(basename $file) ${file%%.so*}.so;
484 done
485 %endif
486
487 %if %{bundle_qt}
488 # install the bundled Qt4 libs on distros with qt4 < 4.4.2
489 install -d -m755 %{buildroot}%{_libdir}/%{drivername}-qt4
490 install -m755 %{archdir}/usr/share/ati/%{_lib}/* %{buildroot}%{_libdir}/%{drivername}-qt4
491 # RPATH of amdcccle points to datadir, we create a symlink there:
492 install -d -m755 %{buildroot}/usr/share/ati
493 ln -s %{_libdir}/%{drivername}-qt4 %{buildroot}/usr/share/ati/%{_lib}
494 %endif
495
496 # install X.org files
497 install -d -m755 %{buildroot}%{xorg_libdir}/modules/drivers
498 install -m755 %{xverdir}/usr/X11R6/%{_lib}/modules/drivers/*.so* %{buildroot}%{xorg_libdir}/modules/drivers
499 install -d -m755 %{buildroot}%{xorg_libdir}/modules/linux
500 install -m755 %{xverdir}/usr/X11R6/%{_lib}/modules/linux/*.so* %{buildroot}%{xorg_libdir}/modules/linux
501 install -m644 %{xverdir}/usr/X11R6/%{_lib}/modules/*.*o %{buildroot}%{xorg_libdir}/modules
502 install -d -m755 %{buildroot}%{ati_extdir}
503 install -m755 %{xverdir}/usr/X11R6/%{_lib}/modules/extensions/fglrx/*.so* %{buildroot}%{ati_extdir}
504 mv %{buildroot}%{ati_extdir}/{fglrx-,}libglx.so
505
506 # etc files
507 install -d -m755 %{buildroot}%{_sysconfdir}/ati
508 install -m644 common/etc/ati/* %{buildroot}%{_sysconfdir}/ati
509 chmod 0755 %{buildroot}%{_sysconfdir}/ati/*.sh
510 # Ghost file created as suggested by AMD.
511 touch %{buildroot}%{_sysconfdir}/ati/atiapfuser.blb
512
513 # dri libraries
514 install -d -m755 %{buildroot}%{xorg_dridir}
515 install -m755 %{archdir}/usr/X11R6/%{_lib}/modules/dri/* %{buildroot}%{xorg_dridir}
516 %ifarch x86_64
517 install -d -m755 %{buildroot}%{xorg_dridir32}
518 install -m755 arch/x86/usr/X11R6/lib/modules/dri/* %{buildroot}%{xorg_dridir32}
519 %endif
520
521 # ld.so.conf
522 install -d -m755 %{buildroot}%{_sysconfdir}/ld.so.conf.d/GL
523 echo "%{_libdir}/%{drivername}" > %{buildroot}%{_sysconfdir}/ld.so.conf.d/GL/%{ld_so_conf_file}
524 %ifarch x86_64
525 echo "%{_prefix}/lib/%{drivername}" >> %{buildroot}%{_sysconfdir}/ld.so.conf.d/GL/%{ld_so_conf_file}
526 %endif
527 touch %{buildroot}%{_sysconfdir}/ld.so.conf.d/GL.conf
528
529 # XvMCConfig
530 install -d -m755 %{buildroot}%{_sysconfdir}/%{drivername}
531 echo "libAMDXvBA.so.1" > %{buildroot}%{_sysconfdir}/%{drivername}/XvMCConfig
532
533 # OpenCL icd
534 install -d -m755 %{buildroot}%{_sysconfdir}/OpenCL/vendors
535 install -m644 %{archdir}/etc/OpenCL/vendors/* %{buildroot}%{_sysconfdir}/OpenCL/vendors
536 %ifarch x86_64
537 install -m644 arch/x86/etc/OpenCL/vendors/* %{buildroot}%{_sysconfdir}/OpenCL/vendors
538 %endif
539
540 # PowerXpress intel - use Mesa libGL but still keep AMD specific libs in search path
541 echo "%{_libdir}/mesa" > %{buildroot}%{_sysconfdir}/%{drivername}/pxpress-free.ld.so.conf
542 %ifarch x86_64
543 echo "%{_prefix}/lib/mesa" >> %{buildroot}%{_sysconfdir}/%{drivername}/pxpress-free.ld.so.conf
544 %endif
545 cat %{buildroot}%{_sysconfdir}/ld.so.conf.d/GL/%{ld_so_conf_file} >> %{buildroot}%{_sysconfdir}/%{drivername}/pxpress-free.ld.so.conf
546
547 # install ldetect-lst pcitable files for backports
548 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
549 [ $(stat -c%s pcitable.fglrx.lst) -gt 500 ]
550 %if "%{ldetect_cards_name}" != ""
551 install -d -m755 %{buildroot}%{_datadir}/ldetect-lst/pcitable.d
552 gzip -c pcitable.fglrx.lst > %{buildroot}%{_datadir}/ldetect-lst/pcitable.d/40%{drivername}.lst.gz
553 %endif
554
555 install -d -m755 %{buildroot}%{_datadir}/ati
556 cat > %{buildroot}%{_datadir}/ati/amd-uninstall.sh <<EOF
557 #!/bin/bash
558 # parameters as per AMD: [--force | --dry-run]
559 dryrun=
560 while [ -n "\$*" ]; do
561 case "\$1" in
562 --dryrun) dryrun="--test" ;;
563 --force) ;;
564 --preserve) ;;
565 --quick) ;;
566 --getUninstallVersion) exit 2 ;;
567 *) echo "Unknown option for \$0." >&2 ;;
568 esac
569 shift
570 done
571
572 # AMD documentation suggests doing rpm -V and use --force to override it,
573 # but it doesn't make sense with the update-alternatives setup, so we just
574 # check package presence.
575 pkgs=
576 rpm -q --quiet %{driverpkgname} && pkgs="\$pkgs %{driverpkgname}"
577 rpm -q --quiet dkms-%{drivername} && pkgs="\$pkgs dkms-%{drivername}"
578 rpm -q --quiet %{drivername}-control-center && pkgs="\$pkgs %{drivername}-control-center"
579 rpm -q --quiet %{drivername}-devel && pkgs="\$pkgs %{drivername}-devel"
580 [ -n "\$pkgs" ] || { echo "The AMD proprietary driver is not installed." >&2; exit 1; }
581 urpme --auto \$dryrun \$pkgs || { echo "Failed to uninstall the AMD proprietary driver." >&2; exit 1; }
582 [ -n "\$dryrun" ] || echo "The AMD proprietary driver has been uninstalled."
583 EOF
584 chmod 0755 %{buildroot}%{_datadir}/ati/amd-uninstall.sh
585
586 # PowerXpress (switchable graphics)
587 # - path hardcoded into driver
588 install -d -m755 %{buildroot}%{_libdir}/fglrx
589 cat > %{buildroot}%{_libdir}/fglrx/switchlibGL <<EOF
590 #!/bin/sh
591
592 amd_target="%{_sysconfdir}/ld.so.conf.d/GL/%{ld_so_conf_file}"
593 intel_target="%{_sysconfdir}/%{drivername}/pxpress-free.ld.so.conf"
594
595 case \$1 in
596 amd)
597 update-alternatives --set gl_conf "\$amd_target" >/dev/null
598 ldconfig -X
599 ;;
600 intel)
601 update-alternatives --set gl_conf "\$intel_target" >/dev/null
602 ldconfig -X
603 ;;
604 query)
605 case \$(readlink -f "%{_sysconfdir}/ld.so.conf.d/GL.conf") in
606 \$amd_target)
607 echo "amd"
608 ;;
609 \$intel_target)
610 echo "intel"
611 ;;
612 *)
613 echo "unknown"
614 ;;
615 esac
616 ;;
617 esac
618 EOF
619 chmod 0755 %{buildroot}%{_libdir}/fglrx/switchlibGL
620
621 # It is not feasible to configure these separately with the alternatives
622 # system, so use the same script for both.
623 # Note: using a symlink here fails as the driver checks go+w without
624 # dereferencing the symlink.
625 cp -a %{buildroot}%{_libdir}/fglrx/switchlibGL %{buildroot}%{_libdir}/fglrx/switchlibglx
626
627 %pre -n %{driverpkgname}
628 # Handle alternatives-era /etc/ati directory
629 # It may confuse rpm due to it containing %config files
630 if [ -L %{_sysconfdir}/ati ]; then
631 rm %{_sysconfdir}/ati
632 fi
633
634 %post -n %{driverpkgname}
635 # Migrate from pre-alternatives files
636 if [ ! -L %{_datadir}/applications/mandriva-amdcccle.desktop -a -e %{_datadir}/applications/mandriva-amdcccle.desktop ]; then
637 rm -f %{_datadir}/applications/mandriva-amdcccle.desktop
638 fi
639
640 %{_sbindir}/update-alternatives \
641 --install %{_sysconfdir}/ld.so.conf.d/GL.conf gl_conf %{_sysconfdir}/ld.so.conf.d/GL/%{ld_so_conf_file} %{priority} \
642 --slave %{_sysconfdir}/X11/XvMCConfig xvmcconfig %{_sysconfdir}/%{drivername}/XvMCConfig \
643 --slave %{_libdir}/libAMDXvBA.cap %{_lib}AMDXvBA_cap %{_libdir}/%{drivername}/libAMDXvBA.cap \
644 %ifarch x86_64
645 --slave %{_prefix}/lib/libAMDXvBA.cap libAMDXvBA_cap %{_libdir}/%{drivername}/libAMDXvBA.cap \
646 %endif
647 --slave %{xorg_extra_modules} xorg_extra_modules %{ati_extdir}
648
649 # Alternative for PowerXpress intel (switchable graphics)
650 # This is a separate alternative so that this situation can be differentiated
651 # from standard intel configuration by tools (e.g. so that radeon driver won't
652 # be loaded despite fglrx not being configured anymore).
653 %{_sbindir}/update-alternatives \
654 --install %{_sysconfdir}/ld.so.conf.d/GL.conf gl_conf %{_sysconfdir}/%{drivername}/pxpress-free.ld.so.conf 50
655
656 if [ "$(readlink -e %{_sysconfdir}/ld.so.conf.d/GL.conf)" = "%{_sysconfdir}/ld.so.conf.d/GL/ati-hd2000.conf" ]; then
657 # Switch from the obsolete hd2000 branch:
658 %{_sbindir}/update-alternatives --set gl_conf %{_sysconfdir}/ld.so.conf.d/GL/%{ld_so_conf_file}
659 fi
660 # When upgrading from alternatives setup, rpm may consider /etc/ati/atiogl.xml
661 # to exist due to the symlink, even when we remove it in %pre:
662 if [ -e %{_sysconfdir}/ati/atiogl.xml.rpmnew -a ! -e %{_sysconfdir}/ati/atiogl.xml ]; then
663 mv %{_sysconfdir}/ati/atiogl.xml.rpmnew %{_sysconfdir}/ati/atiogl.xml
664 echo "Moved %{_sysconfdir}/ati/atiogl.xml.rpmnew back to %{_sysconfdir}/ati/atiogl.xml."
665 fi
666
667 # Call /sbin/ldconfig explicitely due to alternatives
668 /sbin/ldconfig -X
669 %_post_service atieventsd
670 %if "%{ldetect_cards_name}" != ""
671 [ -x %{_sbindir}/update-ldetect-lst ] && %{_sbindir}/update-ldetect-lst || :
672 %endif
673
674 # Ghost file created as suggested by AMD.
675 touch %{_sysconfdir}/ati/atiapfuser.blb
676
677 # Clear driver version numbers from amdpcsdb as suggested by AMD.
678 # (fixes version display in amdcccle after upgrade)
679 amdconfig --del-pcs-key=LDC,ReleaseVersion &>/dev/null || :
680 amdconfig --del-pcs-key=LDC,Catalyst_Version &>/dev/null || :
681
682 %posttrans -n %{driverpkgname}
683 # RPM seems to leave out the active /etc/fglrx* directory, likely due to
684 # it being confused with the /etc/ati symlink. We have to clean up ourself:
685 for dir in %{_sysconfdir}/fglrx %{_sysconfdir}/fglrx-hd2000; do
686 if [ -d $dir ]; then
687 for file in $dir/*; do
688 case "$(basename $file)" in
689 control | signature | logo_mask.xbm.example | logo.xbm.example)
690 # non-config files, rpm would normally remove
691 rm $file;;
692 authatieventsd.sh | fglrxprofiles.csv | fglrxrc | atiogl.xml)
693 # config files, check for modifications
694 case "$(stat -c%s $file)" in
695 545 | 838 | 2769 | 10224 | 11018)
696 rm $file;;
697 *)
698 echo "Saving $file as %{_sysconfdir}/ati/$(basename $file).rpmsave."
699 mv $file %{_sysconfdir}/ati/$(basename $file).rpmsave;;
700 esac
701 ;;
702 esac
703 done
704 [ $(ls -c $dir | wc -l) -eq 0 ] && rm -r $dir
705 fi
706 done
707 true
708
709 %preun -n %{driverpkgname}
710 %_preun_service atieventsd
711
712 %postun -n %{driverpkgname}
713 if [ ! -f %{_sysconfdir}/ld.so.conf.d/GL/%{ld_so_conf_file} ]; then
714 %{_sbindir}/update-alternatives --remove gl_conf %{_sysconfdir}/ld.so.conf.d/GL/%{ld_so_conf_file}
715 fi
716 if [ ! -f %{_sysconfdir}/%{drivername}/pxpress-free.ld.so.conf ]; then
717 %{_sbindir}/update-alternatives --remove gl_conf %{_sysconfdir}/%{drivername}/pxpress-free.ld.so.conf
718 fi
719 # Call /sbin/ldconfig explicitely due to alternatives
720 /sbin/ldconfig -X
721 %if "%{ldetect_cards_name}" != ""
722 [ -x %{_sbindir}/update-ldetect-lst ] && %{_sbindir}/update-ldetect-lst || :
723 %endif
724
725 %pre -n %{drivername}-control-center
726 # Handle alternatives-era directory,
727 # it may confuse rpm.
728 if [ -L %{_datadir}/ati ]; then
729 rm %{_datadir}/ati
730 fi
731
732 %post -n %{drivername}-control-center
733 [ -d %{_datadir}/fglrx ] && rm -r %{_datadir}/fglrx
734 [ -d %{_datadir}/fglrx-hd2000 ] && rm -r %{_datadir}/fglrx-hd2000
735 true
736
737 %post -n %{drivername}-opencl
738 # explicit /sbin/ldconfig due to a non-standard library directory
739 /sbin/ldconfig -X
740
741 %post -n dkms-%{drivername}
742 /usr/sbin/dkms --rpm_safe_upgrade add -m %{drivername} -v %{version}-%{release} &&
743 /usr/sbin/dkms --rpm_safe_upgrade build -m %{drivername} -v %{version}-%{release} &&
744 /usr/sbin/dkms --rpm_safe_upgrade install -m %{drivername} -v %{version}-%{release} --force
745
746 # rmmod any old driver if present and not in use (e.g. by X)
747 rmmod fglrx > /dev/null 2>&1 || true
748
749 %preun -n dkms-%{drivername}
750 /usr/sbin/dkms --rpm_safe_upgrade remove -m %{drivername} -v %{version}-%{release} --all
751
752 # rmmod any old driver if present and not in use (e.g. by X)
753 rmmod fglrx > /dev/null 2>&1 || true
754
755 %clean
756 rm -rf %{buildroot}
757
758 %files -n %{driverpkgname}
759 %defattr(-,root,root)
760 %doc README.install.urpmi README.manual-setup
761 %doc README.8.980.upgrade.urpmi
762 # the documentation files are grossly out of date; the configuration options
763 # described in configure.html seem to be used by the driver, though, so it is
764 # packaged, while the other html files are not:
765 %doc common/usr/share/doc/fglrx/configure.html
766 %doc common/usr/share/doc/fglrx/LICENSE.TXT
767
768 %if "%{ldetect_cards_name}" != ""
769 %{_datadir}/ldetect-lst/pcitable.d/40%{drivername}.lst.gz
770 %endif
771
772 %ghost %{_sysconfdir}/ld.so.conf.d/GL.conf
773 %dir %{_sysconfdir}/ld.so.conf.d/GL
774 %{_sysconfdir}/ld.so.conf.d/GL/ati.conf
775
776 %dir %{_sysconfdir}/%{drivername}
777 %{_sysconfdir}/%{drivername}/XvMCConfig
778 %{_sysconfdir}/%{drivername}/pxpress-free.ld.so.conf
779
780 %dir %{_sysconfdir}/ati
781 %{_sysconfdir}/ati/control
782 %{_sysconfdir}/ati/signature
783 %config(noreplace) %{_sysconfdir}/ati/atiogl.xml
784 %{_sysconfdir}/ati/atiapfxx.blb
785 %{_sysconfdir}/ati/logo.xbm.example
786 %{_sysconfdir}/ati/logo_mask.xbm.example
787 %config %{_sysconfdir}/ati/authatieventsd.sh
788 %{_sysconfdir}/ati/amdpcsdb.default
789 %ghost %{_sysconfdir}/ati/atiapfuser.blb
790
791 %{_initrddir}/atieventsd
792
793 %{_sbindir}/atieventsd
794 %{_sbindir}/amdnotifyui
795 %{_sbindir}/atigetsysteminfo.sh
796
797 %{_bindir}/amdconfig
798 %{_bindir}/amdupdaterandrconfig
799 %{_bindir}/amdxdg-su
800 %{_bindir}/aticonfig
801 %{_bindir}/atiodcli
802 %{_bindir}/atiode
803 %{_bindir}/fgl_glxgears
804 %{_bindir}/fglrxinfo
805
806 %{xorg_libdir}/modules/drivers/fglrx_drv.so
807 %{xorg_libdir}/modules/linux/libfglrxdrm.so
808 %{xorg_libdir}/modules/amdxmm.*o
809 %{xorg_libdir}/modules/glesx.*o
810
811 %dir %{ati_extdir}
812 %{ati_extdir}/libglx.so
813
814 %{xorg_dridir}/fglrx_dri.so
815 %ifarch x86_64
816 %{xorg_dridir32}/fglrx_dri.so
817 %endif
818
819 %dir %{_libdir}/%{drivername}
820 %{_libdir}/%{drivername}/libGL.so.1
821 %{_libdir}/%{drivername}/libGL.so.1.*
822 %{_libdir}/%{drivername}/libaticalcl.so
823 %{_libdir}/%{drivername}/libaticaldd.so
824 %{_libdir}/%{drivername}/libaticalrt.so
825 %{_libdir}/%{drivername}/libatiuki.so.1*
826 %{_libdir}/%{drivername}/libSlotMaximizer*.so
827 %ifarch x86_64
828 %dir %{_prefix}/lib/%{drivername}
829 %{_prefix}/lib/%{drivername}/libGL.so.1
830 %{_prefix}/lib/%{drivername}/libGL.so.1.*
831 %{_prefix}/lib/%{drivername}/libaticalcl.so
832 %{_prefix}/lib/%{drivername}/libaticaldd.so
833 %{_prefix}/lib/%{drivername}/libaticalrt.so
834 %{_prefix}/lib/%{drivername}/libatiuki.so.1*
835 %{_prefix}/lib/%{drivername}/libSlotMaximizer*.so
836 %endif
837
838 %{_libdir}/%{drivername}/libfglrx_dm.so.1*
839 %{_libdir}/%{drivername}/libatiadlxx.so
840 %{_libdir}/%{drivername}/libAMDXvBA.cap
841 %{_libdir}/%{drivername}/libAMDXvBA.so.1*
842 %{_libdir}/%{drivername}/libXvBAW.so.1*
843
844 # PowerXpress
845 %{_libdir}/fglrx/switchlibGL
846 %{_libdir}/fglrx/switchlibglx
847
848 %dir %{_datadir}/ati
849 %{_datadir}/ati/amd-uninstall.sh
850
851 %{_mandir}/man8/atieventsd.8*
852
853 %files -n %{drivername}-control-center -f amdcccle.langs
854 %defattr(-,root,root)
855 %doc common/usr/share/doc/amdcccle/*
856 %{_sysconfdir}/security/console.apps/amdcccle-su
857 %{_sysconfdir}/pam.d/amdcccle-su
858 %{_bindir}/amdcccle
859 %dir %{_datadir}/ati
860 %dir %{_datadir}/ati/amdcccle
861 %if %{amdbuild}
862 %{_iconsdir}/%{drivername}-amdcccle.xpm
863 %else
864 %{_miconsdir}/%{drivername}-amdcccle.png
865 %{_iconsdir}/%{drivername}-amdcccle.png
866 %{_liconsdir}/%{drivername}-amdcccle.png
867 %endif
868 %{_datadir}/applications/amdcccle.desktop
869 %{_datadir}/applications/amdccclesu.desktop
870 %if %{bundle_qt}
871 %dir %{_libdir}/%{drivername}-qt4
872 %{_libdir}/%{drivername}-qt4/libQtCore.so.4
873 %{_libdir}/%{drivername}-qt4/libQtGui.so.4
874 %{_datadir}/ati/%{_lib}
875 %endif
876
877 %files -n %{drivername}-devel
878 %defattr(-,root,root)
879 %{_libdir}/%{drivername}/libfglrx_dm.a
880 %{_libdir}/%{drivername}/libfglrx_dm.so
881 %{_libdir}/%{drivername}/libAMDXvBA.so
882 %{_libdir}/%{drivername}/libXvBAW.so
883 %dir %{_includedir}/GL
884 %{_includedir}/GL/*ATI.h
885 %dir %{_includedir}/ATI
886 %dir %{_includedir}/ATI/GL
887 %{_includedir}/ATI/GL/*.h
888 %{_libdir}/%{drivername}/libGL.so
889 %{_libdir}/%{drivername}/libatiuki.so
890 %ifarch x86_64
891 %{_prefix}/lib/%{drivername}/libGL.so
892 %{_prefix}/lib/%{drivername}/libatiuki.so
893 %endif
894
895 %files -n %{drivername}-opencl
896 %defattr(-,root,root)
897 %dir %{_sysconfdir}/OpenCL
898 %dir %{_sysconfdir}/OpenCL/vendors
899 %{_sysconfdir}/OpenCL/vendors/amdocl*.icd
900 %{_bindir}/clinfo
901 %{_libdir}/%{drivername}/libamdocl*.so
902 %{_libdir}/%{drivername}/libOpenCL.so.1
903 %ifarch x86_64
904 %{_prefix}/lib/%{drivername}/libamdocl*.so
905 %{_prefix}/lib/%{drivername}/libOpenCL.so.1
906 %endif
907
908 %files -n dkms-%{drivername}
909 %defattr(-,root,root)
910 %{_usrsrc}/%{drivername}-%{version}-%{release}

  ViewVC Help
Powered by ViewVC 1.1.28