Package: ddrmat-source
Severity: important

Build fails when KSRC/.. is read-only - which is commonly the case when
building against headers of official kernels.


 - Jonas

-- System Information:
Debian Release: testing/unstable
  APT prefers unstable
  APT policy: (500, 'unstable'), (500, 'stable')
Architecture: powerpc (ppc)
Shell:  /bin/sh linked to /bin/bash
Kernel: Linux 2.6.14-2-powerpc
Locale: LANG=da_DK, LC_CTYPE=da_DK (charmap=ISO-8859-1)
--- rules.orig  2004-07-07 05:55:37.000000000 +0200
+++ rules       2005-12-03 13:48:15.000000000 +0100
@@ -20,7 +20,14 @@
 
 VERSION=$(shell dpkg-parsechangelog | grep ^Version: | cut -d ' ' -f 2)
 
-CHFILE=$(KSRC)/../ddrmat-source-$(KVERS)_$(PKG_VERSION)_$(ARCH).changes
+KVERS ?= unknown
+
+# If they didn't set $(KVERS), see if we can do it for them.
+ifeq ($(KVERS),unknown)
+       ifneq "$(wildcard $(KSRC)/include/linux/version.h)" ""
+               KVERS = $(shell head -1 $(KSRC)/include/linux/version.h | sed 
's/.*"\(.*\)"$$/\1/')
+       endif
+endif
 
 # This target verifies that we've got the needed variables passed to us.
 # If the user is using make-kpkg (like he should), it won't be a problem.
@@ -92,7 +99,15 @@
        dh_compress
        dh_installdeb
        dh_md5sums
+ifeq "$(origin KPKG_DEST_DIR)" "undefined"
+ifeq "$(origin KMAINT)" "undefined"
+       dh_builddeb --destdir=$(CURDIR)/..
+else
        dh_builddeb --destdir=$(KSRC)/..
+endif
+else
+       dh_builddeb --destdir=$(KPKG_DEST_DIR)
+endif
 
 # No architecture-independent files to build.
 binary-indep:
@@ -100,7 +115,6 @@
 kdist_image: binary clean
 
 kdist: clean binary
-       dpkg-genchanges -b -e"$(KMAINT) <$(KEMAIL)>" -u"$(KSRC)/.." > $(CHFILE)
        debian/rules clean
 
 kdist_configure:

Reply via email to