Hi,
I was fighting with lirc-modules-source last weekend.

Please consider my changes to lirc source package - patch attached.

Original Makefiles modification by sed I replaced with a smarter awk
script. Two rules for making Makefile.in and Makefile are removed from
Makefile based on `Makefile' string on left side of colon and all lines
up to next rule are removed. Original sed script kills Makefile because
Makefile structure changed with new version of lirc (new autoconf or
automake or similar).

Finally I found, that gawk is optional package (tested with gawk).
I fixed regexps, that works with mawk now, witch is required package.
I hope, things are correct now.

Regards
-- 
Zito
diff -ruN lirc-0.8.2/debian/modules-source/Makefile lirc-0.8.2.zito/debian/modules-source/Makefile
--- lirc-0.8.2/debian/modules-source/Makefile	2008-01-06 22:21:02.000000000 +0100
+++ lirc-0.8.2.zito/debian/modules-source/Makefile	2008-01-06 21:43:09.000000000 +0100
@@ -13,13 +13,13 @@
 				-DLIRC_PORT=$(LIRC_SIR_PORT) \
 				-DLIRC_IRQ=$(LIRC_SIR_IRQ) )
 
-KSRC=/usr/src/linux/$(shell uname -r)/build
+KSRC=/lib/modules/$(shell uname -r)/build
 KERNEL_LOCATION = $(KSRC)
 CC = gcc -D__KERNEL__ -I $(KSRC)/include
 CFLAGS= -O2 -g -Wall
 DEFS=-DHAVE_CONFIG_H -I. -I../..
 
-KVERS=$(shell sed -n -e '/UTS_RELEASE/s/^[^"]*"\([^"]*\)".*$\/\1/p' $(KSRC)/include/linux/version.h)
+KVERS=$(shell sed -n -e '/UTS_RELEASE/s/^[^"]*"\([^"]*\)".*$\/\1/p' $(KSRC)/include/linux/utsrelease.h)
 KPATCHLEVEL=$(shell echo $(KVERS) | sed -n -e 's/^[0-9]*\.\([0-9]*\)\..*/\1/p')
 
 KEXT=o
diff -ruN lirc-0.8.2/debian/modules-source/debian/control.in lirc-0.8.2.zito/debian/modules-source/debian/control.in
--- lirc-0.8.2/debian/modules-source/debian/control.in	2008-01-06 22:21:02.000000000 +0100
+++ lirc-0.8.2.zito/debian/modules-source/debian/control.in	2008-01-06 21:19:42.000000000 +0100
@@ -8,7 +8,7 @@
 Package: lirc-modules-$KVERS
 Architecture: $KARCH
 Depends: ${shlibs:Depends}, ${misc:Depends}
-Recommends: kernel-image-$KVERS (= $KDREV)
+Recommends: linux-image-$KVERS (= $KDREV)
 Description: Linux Infra-red Remote Control support (binary kernel modules)
  This package contains the LIRC binary kernel modules for linux
  version $KVERS.    
diff -ruN lirc-0.8.2/debian/modules-source/debian/rules lirc-0.8.2.zito/debian/modules-source/debian/rules
--- lirc-0.8.2/debian/modules-source/debian/rules	2008-01-06 22:21:02.000000000 +0100
+++ lirc-0.8.2.zito/debian/modules-source/debian/rules	2008-01-06 21:42:01.000000000 +0100
@@ -25,7 +25,7 @@
 KDREV_REV   = $(shell echo $(KDREV) | sed -ne '1s/\([^:]*:\)\?\(.*\)/\2/p')
 
 # Now we need to get the kernel-version somehow
-KVERS=`sed -n -e '/UTS_RELEASE/s/^[^"]*"\([^"]*\)".*$$/\1/p' $(KSRC)/include/linux/version.h`
+KVERS=`sed -n -e '/UTS_RELEASE/s/^[^"]*"\([^"]*\)".*$$/\1/p' $(KSRC)/include/linux/utsrelease.h`
 
 KARCH=$(shell dpkg-architecture -qDEB_BUILD_ARCH_CPU)
 ifeq ($(KARCH),)
diff -ruN lirc-0.8.2/debian/rules lirc-0.8.2.zito/debian/rules
--- lirc-0.8.2/debian/rules	2008-01-06 22:21:02.000000000 +0100
+++ lirc-0.8.2.zito/debian/rules	2008-01-07 09:25:49.000000000 +0100
@@ -77,9 +77,14 @@
 	find debian/tmp/usr/src/modules/lirc -name "*.o" -o -name Makefile.in \
 		-o -name Makefile.am -o -name "*.ko"| xargs rm
 	for file in `find debian/tmp/usr/src/modules/lirc -name Makefile`; \
-		do sed -e'/configure\.in/,/CONFIG_HEADERS/D' \
-			-e'/^CC *=/d' -e '/^KERNEL_LOCATION *=/d' \
-				$$file >$$file.tmp && \
+		do \
+		    awk '/^[^:]*Makefile[^:]*:/ \
+				{ beg=1; prune=1; } \
+			 ( /^[ \t]*$$/ || /^[^\t]/ ) && !beg \
+				{ prune=0; } \
+			 !prune && !/^(CC|KERNEL_LOCATION)[ \t]*=/ \
+				{ print; } \
+			 { beg = 0; }' $$file >$$file.tmp && \
 			mv $$file.tmp $$file; \
 		done
 	sed -n \

Reply via email to