Package: xtables-addons-source
Version: 1.15-3
Severity: wishlist
Tags: patch

Hello,

It would be nice if xtables-addons-source worked like most of the other
-source packages, so that you could do

  make -C /lib/modules/$(uname -r)/build M=/usr/src/modules/xtables-addons

That would make it friendlier to packages like linux-modules-extra-2.6,
that don't actually use module-assistant to build packages.

I have attached a patch that does this.  It also makes sure to install
the modules under /lib/modules/$(uname -r)/extra/ when using
module-assistant, so that we don't have file conflicts with the
linux-image package in case some of the xtables-addons modules are
accepted into the linux-2.6 tree.

Thanks,
-- 
+----------------------------------------------------------+
| John Wright <[email protected]>                         |
| HP Mission Critical OS Enablement & Solution Test (MOST) |
+----------------------------------------------------------+
--- /dev/null
+++ xtables-addons/debian/xtables-addons-source.Makefile
@@ -0,0 +1,3 @@
+export XA_TOPSRCDIR := $(dir $(lastword $(MAKEFILE_LIST)))
+
+obj-m = extensions/
--- xtables-addons/debian/rules.orig
+++ xtables-addons/debian/rules
@@ -110,19 +110,15 @@
 binary-modules:
 	dh_testroot
 	dh_clean -k
-	dh_installdirs lib/modules/$(KVERS)/kernel/net/netfilter
-	dh_installdirs lib/modules/$(KVERS)/kernel/net/netfilter/ipset
 
 	# Build the module
-	$(MAKE) -C extensions modules kbuilddir=$(KSRC)
+	$(MAKE) -C $(KSRC) M=$(CURDIR)
 
 	# Install the module
-	$(MAKE) -C extensions modules_install \
-		kbuilddir=$(KSRC) \
-		DESTDIR=$(CURDIR)/debian/$(PKGNAME)
+	$(MAKE) -C $(KSRC) modules_install M=$(CURDIR) \
+		INSTALL_MOD_PATH=$(CURDIR)/debian/$(PKGNAME) \
+		INSTALL_MOD_DIR=extra/$(sname)
 
-	rm -f debian/$(PKGNAME)/lib/modules/2.6.*/modules.*
-
 	dh_installdocs
 	dh_installchangelogs
 	dh_compress
@@ -170,6 +166,8 @@
 	# Copy only the driver source to the proper location
 	cp -r extensions debian/$(psource)/usr/src/modules/$(sname)/
 	cp mconfig debian/$(psource)/usr/src/modules/$(sname)/
+	cp debian/xtables-addons-source.Makefile \
+		debian/$(psource)/usr/src/modules/$(sname)/Makefile
 
 	# Copy the needed debian/ pieces to the proper location
 	cp debian/*modules.in* \

Reply via email to