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

  ViewVC Help
Powered by ViewVC 1.1.30