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