/[packages]/backports/4/fglrx/current/SPECS/fglrx.spec
ViewVC logotype

Contents of /backports/4/fglrx/current/SPECS/fglrx.spec

Parent Directory Parent Directory | Revision Log Revision Log


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

  ViewVC Help
Powered by ViewVC 1.1.30