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