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

  ViewVC Help
Powered by ViewVC 1.1.30