1
#neededforbuild kernel-source kernel-syms
3
# Change either of these definitions to define flavor. If flavor is
4
# non-nil, this defines a single-flavor driver package, otherwise
5
# this driver package will be multi-flavor. (Note that commenting out
6
# one of these definitions will not work due to some very strange
9
%define XXflavor default
11
%define driver_version 1.1
12
%define kver %(rpm -q --qf '%{VERSION}-%{RELEASE}' kernel-source)
13
%define arch %(echo %_target_cpu | sed -e 's/i.86/i386/')
19
Summary: An example module package
21
Version: %(echo %driver_version-%kver | tr - _)
22
Requires: kernel = %kver
24
Version: %(echo %driver_version-%kver-%flavor | tr - _)
25
Requires: kernel-%flavor = %kver
28
Source0: novell-kmp-%driver_version.tar.bz2
31
BuildRoot: %{_tmppath}/%{name}-%{version}-build
37
# Make sure to include a %setup statement in the %prep section:
38
# without, the ``%post -f ...'' and ``%postun -f ...'' statements
39
# will silently fail and produce empty scripts.
40
%setup -n novell-kmp-%driver_version
46
export EXTRA_CFLAGS='-DVERSION=\"%driver_version\"'
48
flavors=$(ls /usr/src/linux-obj/%arch)
52
for flavor in $flavors; do
53
if [ $flavor = um ]; then
54
# User Mode Linux is an exception for many external kernel modules;
55
# we may choose to skip it here.
59
cp -r source obj/$flavor
60
make -C /usr/src/linux-obj/%arch/$flavor modules M=$PWD/obj/$flavor
64
export INSTALL_MOD_PATH=$RPM_BUILD_ROOT
65
export INSTALL_MOD_DIR=updates
66
for flavor in $(ls obj/); do
67
make -C /usr/src/linux-obj/%arch/$flavor modules_install \
71
set -- $(ls $RPM_BUILD_ROOT/lib/modules)
74
set -- $(find $RPM_BUILD_ROOT/lib/modules -type f -name '*.ko' \
75
| sed -e 's:.*/::' -e 's:\.ko$::' | sort -u)
79
# IMPORTANT: Do not change the KERNELRELEASES definition; it will be
80
# replaced during driver reuse!
81
KERNELRELEASES="$KERNELRELEASES"
84
cat %_sourcedir/depmod.sh
85
cat %_sourcedir/mkinitrd.sh
88
mkdir -p $RPM_BUILD_ROOT/var/lib/YaST2/download
89
# Insert your download location here:
90
echo "ftp://ftp.suse.com/pub/suse;SUSE/Novell" \
91
> $RPM_BUILD_ROOT/var/lib/YaST2/download/%name
93
%post -f post_postun.sh
95
%postun -f post_postun.sh
98
%defattr(-, root, root)
101
%dir /var/lib/YaST2/download
102
%config(noreplace) /var/lib/YaST2/download/%name
105
* Thu Dec 01 2005 - agruen@suse.de