%define module_name	vmware-server
%define module_version	1.0
%define module_release	alt1

%define kversion	2.6.12
%define krelease	alt10
%define flavour		std26-up

%define base_arch %(echo %_target_cpu | sed 's/i.86/i386/;s/athlon/i386/')

%define module_dir /lib/modules/%kversion-%flavour-%krelease/misc

Summary: VMware-server modules
Name: kernel-modules-%module_name-%module_version-%flavour
Version: %module_version
Release: %module_release
License: GPL
Group: System/Kernel and hardware

Packager: Kernel Maintainer Team <kernel@packages.altlinux.org>
BuildArch: i586
ExclusiveOS: Linux
Url: http://ftp.cvut.cz/vmware/
BuildPreReq: kernel-build-tools >= 0.7
BuildRequires: modutils
BuildRequires: perl
BuildRequires: rpm >= 4.0.2-75
BuildRequires: kernel-headers-modules-%flavour = %kversion-%krelease
#BuildRequires: kernel-source-%module_name-%module_version = %module_version

Provides: kernel-modules-%module_name-%kversion-%flavour-%krelease = %version-%release
Conflicts: kernel-modules-%module_name-%kversion-%flavour-%krelease < %version-%release
Conflicts: kernel-modules-%module_name-%kversion-%flavour-%krelease > %version-%release

PreReq: coreutils
PreReq: modutils
PreReq: kernel-image-%flavour = %kversion-%krelease
Requires(postun): kernel-image-%flavour = %kversion-%krelease
ExclusiveArch: %ix86

%description
This package contains VMware modules (vmmon and vmnet) that are needed
for VMware to run. Note that you have to compile these modules on the
system with your VMware version installed or you will have to specify
your VMware version as `vmversion' parameter when loading these modules
or in your /etc/modules.conf file.

%prep
%__rm -rf kernel-source-%module_name-%module_version
%__tar jxvf %kernel_src/kernel-source-%module_name-%module_version.tar.bz2
%setup -D -T -n kernel-source-%module_name-%module_version

%build
. %_usrsrc/linux-%kversion-%flavour/gcc_version.inc
for m in vmmon vmnet; do
    %make_build -C $m-only HEADER_DIR=%_usrsrc/linux-%kversion-%flavour/include BUILD_DIR=%_usrsrc/linux-%kversion-%flavour/
done

%install
for m in vmmon vmnet; do
%if "%kversion" <= "2.6.0"
    %__install -pD -m644 $m-only/$m.o %buildroot%module_dir/$m.o
%else
    %__install -pD -m644 $m-only/$m.ko %buildroot%module_dir/$m.ko
%endif
done

%post
%post_kernel_modules %kversion-%flavour-%krelease

%postun
%postun_kernel_modules %kversion-%flavour-%krelease
%files
%defattr(644,root,root,755)
%module_dir

%changelog
* Mon Aug 15 2005 Andrey Rahmatullin <wrar@altlinux.ru> update93-alt1.@kreleasebuild@
- initial commit to ALT kernel CVS

