1. Prerequisites
 kernel source 
 gcc that compiled your kernel
 make
 rpmbuild
 i386 architecture (Intel 80386 not supported, available upon request)

2. Prepare the kernel source
 
= Fedora Core 4/5 =
 Install kernel-devel

yum install kernel-devel
 
= Debian/Ubuntu for kernel 2.4.x and kernel 2.6.8 =
 Install kernel-headers

yum install kernel-devel

= Debian/Ubuntu for kernel 2.6.9 or above =
 Install linux-headers

apt-get install linux-headers

 install 'linux-headers' package for the same version of your kernel.
 ie: apt-get install -linux-headers-2.6.15-1-686-smp

= Redhat 7.x 8.x 9.0 /Fedora Core 1 2 3 =
 Install the SRPM of kernel, start to build the kernel rpm and interrupt in the middle. you will find the configured kernel source to which all the patches are applied.

 Remove the 'custom' from the config name  
vi /usr/src/linux-[your kernel version]/Makefile

 Then  

make oldconfig 
make depends
make include/linux/version.h

 Now the kernel is ready for the NDAS driver to be compiled against.

= SuSE 9.0 =
 Match the config name with the version of the kernel to install the NDAS driver into.
 
  vi /usr/src/linux-[your kernel version]/.config  #(for SuSE)
 
 Then  

make oldconfig 
make depends
make include/linux/version.h

 Now the kernel is ready for the NDAS driver to be compiled against.

= Other linux = 
 Usually you can find the kernel main source on 
 
 /usr/src/linux-`uname -r`               # 2.4.x kernels
 /lib/modules/`uname -r`/build           # 2.6.x kernels

 Note: 
  
    /usr/src/linux-`uname -r`-include    # SuSE
    is not the kernel main source to compile against
 
 Go into the kernel main source directory 
 and check if you have the .config for your kernel. 
 if not, find the correct configuration file for your kernel. 
 make oldconfig
 
Then do the following to edit your Makefile.

First, you will need to find out what kernel version you are running:
 
 uname -r
 
Then make the whatever changes necessary to match the kernel version that you are running:

 Then  

make oldconfig 
make depends
make include/linux/version.h

 Now the kernel is ready for the NDAS driver to be compiled against.

3. Build the tarball for NDAS driver.

# rpmbuild -tb ndas-1.0.0-95.tar.gz

4. Install the binary RPM

Let's say, the driver is for i686, kernel version 2.6.15-1

= Redhat/Fedora Core/CentOS/Mandrake/Mandriva =
rpm -ivh /usr/src/redhat/RPMS/i686/ndas-kernel-1.0.0-2.6.15_1.95.i686.rpm       
rpm -ivh /usr/src/redhat/RPMS/i686/ndas-admin-1.0.0-95.i686.rpm       

= SuSE =
rpm -ivh /usr/src/packages/RPMS/i686/ndas-kernel-1.0.0-2.6.15_1.95.32.i686.rpm  
rpm -ivh /usr/src/redhat/RPMS/i686/ndas-admin-1.0.0-95.i686.rpm       

= Debian/Ubuntu =
alien -c -d /usr/src/rpm/RPMS/i686/ndas-kernel-1.0.0-2.6.15_1.95.i686.rpm
dpkg -i ndas-kernel_1.0.0-2.6.15_1.95.32.i686.deb
alien -c -d /usr/src/rpm/RPMS/i686/ndas-admin-1.0.0-95.i686.rpm  
dpkg -i ndas-admin_1.0.0-95.i686.deb

