PPA build error (caused by uname)

Asked by Lasse Luttermann

I have just finished a package containing some kernel modules (madwifi 0.10.5.6) but they will not build in PPA due to the build environment uses a different kernel release than the build destination. I have the build-dependency linux-headers-generic but the Makefile figures out the location of the headers by using uname -r (KERNELPATH = /lib/modules/$(shell uname -r)/build).

So what i really need is a method of getting the version/release-number of the linux-headers-generic that the package depends on into my Makefile.

P.S. this is my first PPA package, so i'm a little green :-/

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu Edit question
Assignee:
No assignee Edit question
Solved by:
Lasse Luttermann
Solved:
Last query:
Last reply:
Revision history for this message
Bhavani Shankar (bhavi) said :
#1

okay please paste the contents of makefile and debian/control here also paste the build log at

http://www.pastebin.com

Regards

Revision history for this message
Lasse Luttermann (lasse-luttermann) said :
#2

Makefile: http://pastebin.com/m4e620173

Makefile.inc: http://pastebin.com/d73b085ad

Makefile.kernel: http://pastebin.com/m558540b9

debian/control: http://pastebin.com/m572cfc32

buildlog_ubuntu-hardy-i386.madwifi-hal-0.10.5.6_20080907-0ubuntu1_FAILEDTOBUILD.txt: http://pastebin.com/m6627f3f5

It builds ok on my own computer, but i run the same kernel as i compile the package for.

Revision history for this message
Lasse Luttermann (lasse-luttermann) said :
#3

NOTE: the problem as i see it is in Makefile.inc - but this would be fixed if i could set the KERNELPATH variable in debian/rules

debian/rules: http://pastebin.com/m110f955c (this file is generated by dh_make and i don't see any problems in there - but then again, a second hand opinion might be good).

Revision history for this message
Lasse Luttermann (lasse-luttermann) said :
#4

I ended up finding a solution my self!
it might not be the best hack, but it works.

$(MAKE) KERNELPATH=/lib/modules/$(shell dpkg -s linux-headers-generic | grep ^Version: | sed -e 's/.*:\ //' -e 's/\.[0-9]*$$//' -e 's/\.\([0-9]*\)$$/-\1/')-generic/build/

this way i always get the right KERNELPATH, but since i'm not so good at regexp and the kernel-headers-generic version numbers scheme might change there should be a better way.