File ati-fglrxG02.spec of Package ati-fglrxG02

#
# spec file for package ati-fglrxG02 (Version 8.921)
#
# Copyright (c) 2010 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via http://support.novell.com
#

# norootforbuild
# nodebuginfo
# usedforbuild    aaa_base acl attr audit-libs autoconf automake bash binutils brp-check-suse build bzip2 coreutils cpio cpp cpp43 cracklib cvs diffutils file filesystem fillup findutils gawk gcc gcc43 gdbm gettext-runtime gettext-tools glibc glibc-devel glibc-locale gmp grep groff gzip info insserv kernel-default-devel kernel-pae-devel kernel-source kernel-syms kernel-xen-devel less libacl libattr libblkid1 libbz2-1 libbz2-devel libdb-4_5 libgcc43 libgomp43 libltdl7 libmpfr1 libncurses5 libreadline5 libselinux1 libsepol1 libstdc++43 libtool libuuid1 libvolume_id1 libxcrypt libzio linux-kernel-headers login m4 make man module-init-tools net-tools netcfg pam pam-modules patch perl perl-TimeDate perl-base permissions popt post-build-checks psmisc rpm rpmlint-Factory rpmlint-mini sed sysvinit tar terminfo-base texinfo timezone util-linux zlib


Name:           ati-fglrxG02
BuildRequires:  kernel-source kernel-syms module-init-tools
License:        PERMISSIVE-OSI-COMPLIANT
Group:          System/Kernel
Summary:        ATI "fglrx" driver kernel module
Version:        8.921
Release:        0
%define catalystversion 8.921
Source0:        https://a248.e.akamai.net/f/674/9206/0/www2.ati.com/drivers/linux/amd-driver-installer-%{catalystversion}-x86.x86_64.run
Source2:        Makefile
Source4:        preamble
Source6:        pci_ids-%{version}.new
Source7:        fetch.sh
Source8:        README
Source9:        my-find-supplements
Source10:       my-find-supplements.ksyms
NoSource:       0
NoSource:       7
NoSource:       8
Patch5:         ati-CONFIG_SMP.diff
Patch6:         ati-2.6.27-build-fix-1.diff
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
ExclusiveArch:  %ix86 x86_64
%suse_kernel_module_package -p %_sourcedir/preamble kdump uml um xen xenpae ec2 vmi vmipae lockdep
# supplements no longer depend on the driver
%define __find_supplements %_sourcedir/my-find-supplements

%description
ATI "fglrx" driver kernel module for ATI Radeon HD 2000 and later.



%package KMP
License:        PERMISSIVE-OSI-COMPLIANT
Summary:        ATI "fglrx" driver kernel module
Group:          System/Kernel

%description KMP
ATI "fglrx" driver kernel module for ATI Radeon HD 2000 and later.



%prep
%define kver %(rpm -q --qf '%%{VERSION}' kernel-source|perl -ne '/(\\d+)\\.(\\d+)\\.(\\d+)?/&&printf "%%d%%02d%%02d\\n",$1,$2,$3')
echo "kver = %kver"
%setup -T -c %{name}-%{version}
sh %{SOURCE0} --extract
rm -rf fglrx-install*/common/lib/modules/fglrx/build_mod/2.6.x/
mkdir source
cp -r fglrx-install*/common/lib/modules/fglrx/build_mod/* \
%ifarch x86_64
      fglrx-install*/arch/x86_64/lib/modules/fglrx/build_mod/libfglrx_ip.a \
%else
      fglrx-install*/arch/x86/lib/modules/fglrx/build_mod/libfglrx_ip.a \
%endif
   %_sourcedir/Makefile source/ || :
pushd source
  # mark support as external
  echo "fglrx.ko external" > Module.supported
  # apply patches here
%if %suse_version > 1030
patch -p0 -s < %{P:5}
%endif
%if %kver >= 20627
patch -p1 -s < %{P:6}
%endif
# required for SLE11-SP2
if find -L /usr/src/linux -name compat.h | \
   xargs grep -q arch_compat_alloc_user_space; then
  sed -i 's/compat_alloc_user_space/arch_compat_alloc_user_space/' \
    Makefile
fi
sed -i 's+PCI_ID_FILE=.*+PCI_ID_FILE=/usr/src/packages/SOURCES/pci_ids-%{version}+' \
  %_sourcedir/my-find-supplements.ksyms
chmod 755 %_sourcedir/my-find-supplements*
popd
mkdir obj

%build
export EXTRA_CFLAGS='-DVERSION=\"%version\"'
for flavor in %flavors_to_build; do
    rm -rf obj/$flavor
    cp -r source obj/$flavor
    make -C /usr/src/linux-obj/%_target_cpu/$flavor modules \
        M=$PWD/obj/$flavor
done

%install
export INSTALL_MOD_PATH=$RPM_BUILD_ROOT
export INSTALL_MOD_DIR=updates
for flavor in %flavors_to_build; do
    make -C /usr/src/linux-obj/%_target_cpu/$flavor modules_install \
	M=$PWD/obj/$flavor
done

%changelog
openSUSE Build Service is sponsored by