linux-headers-$(uname -r) is simple if the pkg is available. Not all kernel packs are in lenny, unless you're running squeeze. I'm using the latest kernel 2.6.34.1 which got released a few days ago at plugapps but the headers for 34.1 are not avail in lenny. So, I manually installed the kernel modules needed to compile asterisk. Follow instructions below if you dont have the std kernel pkgs :
NOTE : wherever it says 2.6.34.1, replace with your own kernel version which you can get from "uname -r"
>> cd /usr/src
DOWNLOAD kernel -
>> wget
http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.34.1.tar.gz>> tar -zxvf linux-2.6.34.1.tar.gz
Once you have downloaded and unpacked the kernel source code, executing the command:
>> ls -ld /usr/src/linux*
should give you something like:
lrwxrwxrwx 1 root root 12 Feb 10 2003 /usr/src/linux -> linux-2.6.34.1
drwxr-xr-x 17 root root 4096 Jan 27 2003 /usr/src/linux-2.6.34.1
DOWNLOAD config and kernel headers -
>> wget
http://sheeva.with-linux.com/sheeva/2.6.34.1/sheeva-2.6.34.1.configcopy to /usr/src/linux-2.6.34.1/ and Rename file to ".config"
>> cp sheeva-2.6.34.1.config /usr/src/linux-2.6.34.1/.config
>> cd /
>> wget
http://sheeva.with-linux.com/sheeva/2.6.34.1/sheeva-2.6.34.1-KernelHeaders.tar.gz>> tar -zxvf sheeva-2.6.34.1-KernelHeaders.tar.gz
Now make sure your config file is fully conformant with your kernel source. Do this:
>> cd /usr/src/linux-2.6.34.1
>> make menuconfig
When the menuconfig program starts up, it reads the .config file automatically. Simply tell the menuconfig program to quit, and have it save the .config file when you are asked.
Check Makefile - If needed, modify the EXTRAVERSION statement in Makefile so it matches what you see in "uname -r". It should look like :
VERSION = 2
PATCHLEVEL = 6
SUBLEVEL = 34
EXTRAVERSION = .1
>> rm /lib/modules/`uname -r`/build
>> rm /lib/modules/`uname -r`/source
>> ln -s /usr/src/linux-2.6.34.1 /lib/modules/`uname -r`/build
>> ln -s /usr/src/linux-2.6.34.1 /lib/modules/`uname -r`/source
>> make modules_prepare