On Mon, Mar 15, 2010 at 06:07:25AM +0100, maximilian attems wrote:
> On Mon, 15 Mar 2010, Jan Hauke Rahm wrote:
> 
> > On Sun, Mar 14, 2010 at 11:55:15PM +0100, maximilian attems wrote:
> > > you once worked on klibc packaging but gave up due to cdbs
> > > usage, would you consider trying to switch latest klibc to dh?
> > > (away from cdbs) latest is on 
> > > git clone git://git.debian.org/kernel/klibc.git
> > > 
> > > improved packaging should help also #478589 to shipp README.ipconfig.
> > > 
> > > I'd really appreciate this packaging help.
> > 
> > Can't promise anything but I'll have a look at it tomorrow.
> > 
> > Hauke
> 
> woow that be cool, beware that current sid compiles on amd64
> but fails on i386, relevant fixes sent upstream, expect 1.5.17 soonest
> but this is hopefully orthogonal, thanks

Well, it doesn't look as good as I hoped it would but it seems to
(almost) generate the same binaries now. I did two more or less
unrelated changes, though: switch to Source Format 3.0 (quilt), and
symlink the /ush/share/doc part to only ship it once (dependencies were
needed anyways).

The patch I attached is quite long which is due to renaming
debian/patches/* to play nicely with quilt. Apart from that it's pretty
straight forward, I hope...

Hauke
diff --git a/debian/changelog b/debian/changelog
index 63f5c90..21f948a 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,13 @@
+klibc (1.5.16-1.1) UNRELEASED; urgency=low
+
+  * Non-maintainer upload.
+  * Switch from cdbs to debhelper 7
+  * Switch to Source Format 3.0 (quilt)
+  * Make documentation of klibc-utils and libklibc-dev be a symlink to
+    libklibc
+
+ -- Jan Hauke Rahm <j...@debian.org>  Mon, 15 Mar 2010 13:07:19 +0100
+
 klibc (1.5.16-1) unstable; urgency=low
 
   [ maximilian attems ]
diff --git a/debian/compat b/debian/compat
index 7ed6ff8..7f8f011 100644
--- a/debian/compat
+++ b/debian/compat
@@ -1 +1 @@
-5
+7
diff --git a/debian/control b/debian/control
index 431d5fd..5262fb5 100644
--- a/debian/control
+++ b/debian/control
@@ -2,7 +2,7 @@ Source: klibc
 Priority: optional
 Maintainer: maximilian attems <m...@debian.org>
 Uploaders: Jeff Bailey <jbai...@raspberryginger.com>
-Build-Depends: cdbs, debhelper (>= 5.0.0), linux-libc-dev, bison, m4
+Build-Depends: debhelper (>= 7.0.50), linux-libc-dev, bison, m4
 Section: libs
 Standards-Version: 3.8.4
 Vcs-Browser: http://git.debian.org/?p=kernel/klibc.git
diff --git a/debian/libklibc.docs b/debian/libklibc.docs
new file mode 100644
index 0000000..e845566
--- /dev/null
+++ b/debian/libklibc.docs
@@ -0,0 +1 @@
+README
diff --git a/debian/patches/01-ia64-static.diff b/debian/patches/01-ia64-static.diff
deleted file mode 100644
index 84d75b8..0000000
--- a/debian/patches/01-ia64-static.diff
+++ /dev/null
@@ -1,91 +0,0 @@
-diff --git a/usr/dash/Kbuild b/usr/dash/Kbuild
-index 10e9591..b712a30 100644
---- a/usr/dash/Kbuild
-+++ b/usr/dash/Kbuild
-@@ -108,4 +108,8 @@ # side effect..
- 	$(Q):
- 
- # Targets to install
-+ifeq ($(ARCH),ia64)
-+install-y := sh
-+else
- install-y := sh.shared
-+endif
-diff --git a/usr/kinit/fstype/Kbuild b/usr/kinit/fstype/Kbuild
-index 9b20db1..cfc5dd7 100644
---- a/usr/kinit/fstype/Kbuild
-+++ b/usr/kinit/fstype/Kbuild
-@@ -22,4 +22,8 @@ shared/fstype-y := $(objs)
- clean-dirs := static shared
- 
- # install binary
-+ifeq ($(ARCH),ia64)
-+install-y := $(static-y)
-+else
- install-y := $(shared-y)
-+endif
-diff --git a/usr/kinit/ipconfig/Kbuild b/usr/kinit/ipconfig/Kbuild
-index 7f8d181..7d67802 100644
---- a/usr/kinit/ipconfig/Kbuild
-+++ b/usr/kinit/ipconfig/Kbuild
-@@ -28,4 +28,8 @@ shared/ipconfig-y := $(objs)
- clean-dirs := static shared
- 
- # install binary
-+ifeq ($(ARCH),ia64)
-+install-y := $(static-y)
-+else
- install-y := $(shared-y)
-+endif
-diff --git a/usr/kinit/nfsmount/Kbuild b/usr/kinit/nfsmount/Kbuild
-index 461e6f3..af5e78f 100644
---- a/usr/kinit/nfsmount/Kbuild
-+++ b/usr/kinit/nfsmount/Kbuild
-@@ -24,4 +24,8 @@ # TODO - do we want the static.g + share
- clean-dirs := static shared
- 
- # Install binary
-+ifeq ($(ARCH),ia64)
-+install-y := $(static-y)
-+else
- install-y := $(shared-y)
-+endif
-diff --git a/usr/kinit/resume/Kbuild b/usr/kinit/resume/Kbuild
-index ce6d0ce..d0c74a9 100644
---- a/usr/kinit/resume/Kbuild
-+++ b/usr/kinit/resume/Kbuild
-@@ -25,4 +25,8 @@ # Cleaning
- clean-dirs := static shared
- 
- # install binary
-+ifeq ($(ARCH),ia64)
-+install-y := $(static-y)
-+else
- install-y := $(shared-y)
-+endif
-diff --git a/usr/kinit/run-init/Kbuild b/usr/kinit/run-init/Kbuild
-index 61a9d0b..64d3b1c 100644
---- a/usr/kinit/run-init/Kbuild
-+++ b/usr/kinit/run-init/Kbuild
-@@ -22,4 +22,8 @@ shared/run-init-y := $(objs)
- clean-dirs := static shared
- 
- # install binary
-+ifeq ($(ARCH),ia64)
-+install-y := $(static-y)
-+else
- install-y := $(shared-y)
-+endif
-diff --git a/usr/utils/Kbuild b/usr/utils/Kbuild
-index f760a6b..e5054ef 100644
---- a/usr/utils/Kbuild
-+++ b/usr/utils/Kbuild
-@@ -61,4 +61,8 @@ shared/uname-y      := uname.o
- clean-dirs := static shared
- 
- # install only install the shared binaries
-+ifeq ($(ARCH),ia64)
-+install-y := $(static-y) static/reboot static/poweroff
-+else
- install-y := $(shared-y) shared/reboot shared/poweroff
-+endif
diff --git a/debian/patches/02-klibc_linux_libc_dev.patch b/debian/patches/02-klibc_linux_libc_dev.patch
deleted file mode 100644
index 85e9c8e..0000000
--- a/debian/patches/02-klibc_linux_libc_dev.patch
+++ /dev/null
@@ -1,41 +0,0 @@
-commit 43adf69062254fb4f8d4d11fb5fe36a60ae25d5a
-Author: Ben Hutchings <b...@decadent.org.uk>
-Date:   Sun Mar 14 18:41:56 2010 +0000
-
-    Fix klibc Debian specific build trouble
-    
-    Simply remove the headers_install invocation and rely on linux-libc-dev.
-    
-    With these changes:
-    
-    (the extra chmod was needed to allow for umask > 022) I could compile,
-    link and run this program:
-    
-    #include <unistd.h>
-    
-    int main(void)
-    {
-    	write(1, "Hello world\n", 12);
-    	return 0;
-    }
-    
-    Signed-off-by: Ben Hutchings <b...@decadent.org.uk>
-    Signed-off-by: maximilian attems <m...@stro.at>
-
-diff --git a/scripts/Kbuild.install b/scripts/Kbuild.install
-index de918f0..608759d 100644
---- a/scripts/Kbuild.install
-+++ b/scripts/Kbuild.install
-@@ -95,8 +95,11 @@ header:
- 	$(Q)mkdir -p $(INSTALLROOT)$(INSTALLDIR)/$(KCROSS)include
- 	$(Q)mkdir -p $(INSTALLROOT)$(INSTALLDIR)/$(KCROSS)lib
- 	$(Q)mkdir -p $(INSTALLROOT)$(INSTALLDIR)/$(KCROSS)bin
--	$(Q)make -C $(KLIBCKERNELSRC) ARCH=$(KLIBCARCH) INSTALL_HDR_PATH=$(INSTALLROOT)$(INSTALLDIR)/$(KCROSS) headers_install
-+	$(Q)for x in /usr/include/linux /usr/include/asm*; do \
-+		ln -s $${x} $(INSTALLROOT)$(INSTALLDIR)/$(KCROSS)include/ || exit; \
-+	done
- 	$(Q)cp -rf usr/include/. $(INSTALLROOT)$(INSTALLDIR)/$(KCROSS)include/.
-+	$(Q)chmod -R a+rX $(INSTALLROOT)$(INSTALLDIR)/$(KCROSS)include
- 	$(Q)$(install-data) $(srctree)/klcc/klcc.1 $(INSTALLROOT)$(mandir)/man1/$(KCROSS)klcc.1
- 	$(Q)$(install-bin) $(objtree)/klcc/$(KCROSS)klcc $(INSTALLROOT)$(bindir)
- 
diff --git a/debian/patches/10_insmod.patch b/debian/patches/10_insmod.patch
deleted file mode 100644
index 8d001cc..0000000
--- a/debian/patches/10_insmod.patch
+++ /dev/null
@@ -1,172 +0,0 @@
-revert upstream nuked insmod.
-utilized by d-i floppies, can be dropped once m-i-t
-packages an insmod/modprobe compiled against klibc.
-
-diff --git a/usr/utils/Kbuild b/usr/utils/Kbuild
-index 5b6dc28..09157a8 100644
---- a/usr/utils/Kbuild
-+++ b/usr/utils/Kbuild
-@@ -4,7 +4,7 @@
- 
- progs := chroot dd mkdir mkfifo mknod mount pivot_root umount
- progs += true false sleep ln nuke minips cat ls
--progs += uname halt kill readlink cpio sync dmesg
-+progs += insmod uname halt kill readlink cpio sync dmesg
- 
- static-y := $(addprefix static/, $(progs))
- shared-y := $(addprefix shared/, $(progs))
-@@ -44,6 +44,8 @@ static/minips-y     := minips.o
- shared/minips-y     := minips.o
- static/cat-y        := cat.o
- shared/cat-y        := cat.o
-+static/insmod-y     := insmod.o
-+shared/insmod-y     := insmod.o
- static/uname-y      := uname.o
- shared/uname-y      := uname.o
- static/halt-y       := halt.o
-diff --git a/usr/utils/insmod.c b/usr/utils/insmod.c
-new file mode 100644
-index 0000000..47b5880
---- /dev/null
-+++ b/usr/utils/insmod.c
-@@ -0,0 +1,140 @@
-+/* insmod.c: insert a module into the kernel.
-+    Copyright (C) 2001  Rusty Russell.
-+    Copyright (C) 2002  Rusty Russell, IBM Corporation.
-+
-+    This program is free software; you can redistribute it and/or modify
-+    it under the terms of the GNU General Public License as published by
-+    the Free Software Foundation; either version 2 of the License, or
-+    (at your option) any later version.
-+
-+    This program is distributed in the hope that it will be useful,
-+    but WITHOUT ANY WARRANTY; without even the implied warranty of
-+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-+    GNU General Public License for more details.
-+
-+    You should have received a copy of the GNU General Public License
-+    along with this program; if not, write to the Free Software
-+    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-+*/
-+#include <stdio.h>
-+#include <string.h>
-+#include <stdlib.h>
-+#include <unistd.h>
-+#include <fcntl.h>
-+#include <sys/mman.h>
-+#include <sys/types.h>
-+#include <sys/stat.h>
-+#include <unistd.h>
-+#include <errno.h>
-+
-+#define streq(a,b) (strcmp((a),(b)) == 0)
-+
-+/* This really needs to be in a header file... */
-+extern long init_module(void *, unsigned long, const char *);
-+
-+static void print_usage(const char *progname)
-+{
-+	fprintf(stderr, "Usage: %s filename [args]\n", progname);
-+	exit(1);
-+}
-+
-+/* We use error numbers in a loose translation... */
-+static const char *moderror(int err)
-+{
-+	switch (err) {
-+	case ENOEXEC:
-+		return "Invalid module format";
-+	case ENOENT:
-+		return "Unknown symbol in module";
-+	case ESRCH:
-+		return "Module has wrong symbol version";
-+	case EINVAL:
-+		return "Invalid parameters";
-+	default:
-+		return strerror(err);
-+	}
-+}
-+
-+static void *grab_file(const char *filename, unsigned long *size)
-+{
-+	unsigned int max = 16384;
-+	int ret, fd;
-+	void *buffer = malloc(max);
-+
-+	if (streq(filename, "-"))
-+		fd = dup(STDIN_FILENO);
-+	else
-+		fd = open(filename, O_RDONLY, 0);
-+
-+	if (fd < 0)
-+		return NULL;
-+
-+	*size = 0;
-+	while ((ret = read(fd, buffer + *size, max - *size)) > 0) {
-+		*size += ret;
-+		if (*size == max)
-+			buffer = realloc(buffer, max *= 2);
-+	}
-+	if (ret < 0) {
-+		free(buffer);
-+		buffer = NULL;
-+	}
-+	close(fd);
-+	return buffer;
-+}
-+
-+int main(int argc, char *argv[])
-+{
-+	int i;
-+	long int ret;
-+	unsigned long len;
-+	void *file;
-+	char *filename, *options = strdup("");
-+	char *progname = argv[0];
-+
-+	if (argv[1] && (streq(argv[1], "--version") || streq(argv[1], "-V"))) {
-+		puts("klibc insmod");
-+		exit(0);
-+	}
-+
-+	/* Ignore old options, for backwards compat. */
-+	while (argv[1] && (streq(argv[1], "-p")
-+			   || streq(argv[1], "-s")
-+			   || streq(argv[1], "-f"))) {
-+		argv++;
-+		argc--;
-+	}
-+
-+	filename = argv[1];
-+	if (!filename)
-+		print_usage(progname);
-+
-+	/* Rest is options */
-+	for (i = 2; i < argc; i++) {
-+		options = realloc(options,
-+				  strlen(options) + 2 + strlen(argv[i]) + 2);
-+		/* Spaces handled by "" pairs, but no way of escaping
-+		   quotes */
-+		if (strchr(argv[i], ' '))
-+			strcat(options, "\"");
-+		strcat(options, argv[i]);
-+		if (strchr(argv[i], ' '))
-+			strcat(options, "\"");
-+		strcat(options, " ");
-+	}
-+
-+	file = grab_file(filename, &len);
-+	if (!file) {
-+		fprintf(stderr, "insmod: can't read '%s': %s\n",
-+			filename, strerror(errno));
-+		exit(1);
-+	}
-+
-+	ret = init_module(file, len, options);
-+	if (ret != 0) {
-+		fprintf(stderr, "insmod: error inserting '%s': %li %s\n",
-+			filename, ret, moderror(errno));
-+		exit(1);
-+	}
-+	exit(0);
-+}
diff --git a/debian/patches/ia64-static b/debian/patches/ia64-static
new file mode 100644
index 0000000..3125a8d
--- /dev/null
+++ b/debian/patches/ia64-static
@@ -0,0 +1,77 @@
+--- a/usr/dash/Kbuild
++++ b/usr/dash/Kbuild
+@@ -108,4 +108,8 @@
+ 	$(Q):
+ 
+ # Targets to install
++ifeq ($(ARCH),ia64)
++install-y := sh
++else
+ install-y := sh.shared
++endif
+--- a/usr/kinit/fstype/Kbuild
++++ b/usr/kinit/fstype/Kbuild
+@@ -22,4 +22,8 @@
+ clean-dirs := static shared
+ 
+ # install binary
++ifeq ($(ARCH),ia64)
++install-y := $(static-y)
++else
+ install-y := $(shared-y)
++endif
+--- a/usr/kinit/ipconfig/Kbuild
++++ b/usr/kinit/ipconfig/Kbuild
+@@ -28,4 +28,8 @@
+ clean-dirs := static shared
+ 
+ # install binary
++ifeq ($(ARCH),ia64)
++install-y := $(static-y)
++else
+ install-y := $(shared-y)
++endif
+--- a/usr/kinit/nfsmount/Kbuild
++++ b/usr/kinit/nfsmount/Kbuild
+@@ -24,4 +24,8 @@
+ clean-dirs := static shared
+ 
+ # Install binary
++ifeq ($(ARCH),ia64)
++install-y := $(static-y)
++else
+ install-y := $(shared-y)
++endif
+--- a/usr/kinit/resume/Kbuild
++++ b/usr/kinit/resume/Kbuild
+@@ -27,4 +27,8 @@
+ clean-dirs := static shared
+ 
+ # install binary
++ifeq ($(ARCH),ia64)
++install-y := $(static-y)
++else
+ install-y := $(shared-y)
++endif
+--- a/usr/kinit/run-init/Kbuild
++++ b/usr/kinit/run-init/Kbuild
+@@ -26,4 +26,8 @@
+ clean-dirs := static shared
+ 
+ # install binary
++ifeq ($(ARCH),ia64)
++install-y := $(static-y)
++else
+ install-y := $(shared-y)
++endif
+--- a/usr/utils/Kbuild
++++ b/usr/utils/Kbuild
+@@ -69,4 +69,8 @@
+ clean-dirs := static shared
+ 
+ # install only install the shared binaries
++ifeq ($(ARCH),ia64)
++install-y := $(static-y) static/reboot static/poweroff
++else
+ install-y := $(shared-y) shared/reboot shared/poweroff
++endif
diff --git a/debian/patches/insmod b/debian/patches/insmod
new file mode 100644
index 0000000..8d001cc
--- /dev/null
+++ b/debian/patches/insmod
@@ -0,0 +1,172 @@
+revert upstream nuked insmod.
+utilized by d-i floppies, can be dropped once m-i-t
+packages an insmod/modprobe compiled against klibc.
+
+diff --git a/usr/utils/Kbuild b/usr/utils/Kbuild
+index 5b6dc28..09157a8 100644
+--- a/usr/utils/Kbuild
++++ b/usr/utils/Kbuild
+@@ -4,7 +4,7 @@
+ 
+ progs := chroot dd mkdir mkfifo mknod mount pivot_root umount
+ progs += true false sleep ln nuke minips cat ls
+-progs += uname halt kill readlink cpio sync dmesg
++progs += insmod uname halt kill readlink cpio sync dmesg
+ 
+ static-y := $(addprefix static/, $(progs))
+ shared-y := $(addprefix shared/, $(progs))
+@@ -44,6 +44,8 @@ static/minips-y     := minips.o
+ shared/minips-y     := minips.o
+ static/cat-y        := cat.o
+ shared/cat-y        := cat.o
++static/insmod-y     := insmod.o
++shared/insmod-y     := insmod.o
+ static/uname-y      := uname.o
+ shared/uname-y      := uname.o
+ static/halt-y       := halt.o
+diff --git a/usr/utils/insmod.c b/usr/utils/insmod.c
+new file mode 100644
+index 0000000..47b5880
+--- /dev/null
++++ b/usr/utils/insmod.c
+@@ -0,0 +1,140 @@
++/* insmod.c: insert a module into the kernel.
++    Copyright (C) 2001  Rusty Russell.
++    Copyright (C) 2002  Rusty Russell, IBM Corporation.
++
++    This program is free software; you can redistribute it and/or modify
++    it under the terms of the GNU General Public License as published by
++    the Free Software Foundation; either version 2 of the License, or
++    (at your option) any later version.
++
++    This program is distributed in the hope that it will be useful,
++    but WITHOUT ANY WARRANTY; without even the implied warranty of
++    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++    GNU General Public License for more details.
++
++    You should have received a copy of the GNU General Public License
++    along with this program; if not, write to the Free Software
++    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
++*/
++#include <stdio.h>
++#include <string.h>
++#include <stdlib.h>
++#include <unistd.h>
++#include <fcntl.h>
++#include <sys/mman.h>
++#include <sys/types.h>
++#include <sys/stat.h>
++#include <unistd.h>
++#include <errno.h>
++
++#define streq(a,b) (strcmp((a),(b)) == 0)
++
++/* This really needs to be in a header file... */
++extern long init_module(void *, unsigned long, const char *);
++
++static void print_usage(const char *progname)
++{
++	fprintf(stderr, "Usage: %s filename [args]\n", progname);
++	exit(1);
++}
++
++/* We use error numbers in a loose translation... */
++static const char *moderror(int err)
++{
++	switch (err) {
++	case ENOEXEC:
++		return "Invalid module format";
++	case ENOENT:
++		return "Unknown symbol in module";
++	case ESRCH:
++		return "Module has wrong symbol version";
++	case EINVAL:
++		return "Invalid parameters";
++	default:
++		return strerror(err);
++	}
++}
++
++static void *grab_file(const char *filename, unsigned long *size)
++{
++	unsigned int max = 16384;
++	int ret, fd;
++	void *buffer = malloc(max);
++
++	if (streq(filename, "-"))
++		fd = dup(STDIN_FILENO);
++	else
++		fd = open(filename, O_RDONLY, 0);
++
++	if (fd < 0)
++		return NULL;
++
++	*size = 0;
++	while ((ret = read(fd, buffer + *size, max - *size)) > 0) {
++		*size += ret;
++		if (*size == max)
++			buffer = realloc(buffer, max *= 2);
++	}
++	if (ret < 0) {
++		free(buffer);
++		buffer = NULL;
++	}
++	close(fd);
++	return buffer;
++}
++
++int main(int argc, char *argv[])
++{
++	int i;
++	long int ret;
++	unsigned long len;
++	void *file;
++	char *filename, *options = strdup("");
++	char *progname = argv[0];
++
++	if (argv[1] && (streq(argv[1], "--version") || streq(argv[1], "-V"))) {
++		puts("klibc insmod");
++		exit(0);
++	}
++
++	/* Ignore old options, for backwards compat. */
++	while (argv[1] && (streq(argv[1], "-p")
++			   || streq(argv[1], "-s")
++			   || streq(argv[1], "-f"))) {
++		argv++;
++		argc--;
++	}
++
++	filename = argv[1];
++	if (!filename)
++		print_usage(progname);
++
++	/* Rest is options */
++	for (i = 2; i < argc; i++) {
++		options = realloc(options,
++				  strlen(options) + 2 + strlen(argv[i]) + 2);
++		/* Spaces handled by "" pairs, but no way of escaping
++		   quotes */
++		if (strchr(argv[i], ' '))
++			strcat(options, "\"");
++		strcat(options, argv[i]);
++		if (strchr(argv[i], ' '))
++			strcat(options, "\"");
++		strcat(options, " ");
++	}
++
++	file = grab_file(filename, &len);
++	if (!file) {
++		fprintf(stderr, "insmod: can't read '%s': %s\n",
++			filename, strerror(errno));
++		exit(1);
++	}
++
++	ret = init_module(file, len, options);
++	if (ret != 0) {
++		fprintf(stderr, "insmod: error inserting '%s': %li %s\n",
++			filename, ret, moderror(errno));
++		exit(1);
++	}
++	exit(0);
++}
diff --git a/debian/patches/klibc-linux-libc-dev b/debian/patches/klibc-linux-libc-dev
new file mode 100644
index 0000000..85e9c8e
--- /dev/null
+++ b/debian/patches/klibc-linux-libc-dev
@@ -0,0 +1,41 @@
+commit 43adf69062254fb4f8d4d11fb5fe36a60ae25d5a
+Author: Ben Hutchings <b...@decadent.org.uk>
+Date:   Sun Mar 14 18:41:56 2010 +0000
+
+    Fix klibc Debian specific build trouble
+    
+    Simply remove the headers_install invocation and rely on linux-libc-dev.
+    
+    With these changes:
+    
+    (the extra chmod was needed to allow for umask > 022) I could compile,
+    link and run this program:
+    
+    #include <unistd.h>
+    
+    int main(void)
+    {
+    	write(1, "Hello world\n", 12);
+    	return 0;
+    }
+    
+    Signed-off-by: Ben Hutchings <b...@decadent.org.uk>
+    Signed-off-by: maximilian attems <m...@stro.at>
+
+diff --git a/scripts/Kbuild.install b/scripts/Kbuild.install
+index de918f0..608759d 100644
+--- a/scripts/Kbuild.install
++++ b/scripts/Kbuild.install
+@@ -95,8 +95,11 @@ header:
+ 	$(Q)mkdir -p $(INSTALLROOT)$(INSTALLDIR)/$(KCROSS)include
+ 	$(Q)mkdir -p $(INSTALLROOT)$(INSTALLDIR)/$(KCROSS)lib
+ 	$(Q)mkdir -p $(INSTALLROOT)$(INSTALLDIR)/$(KCROSS)bin
+-	$(Q)make -C $(KLIBCKERNELSRC) ARCH=$(KLIBCARCH) INSTALL_HDR_PATH=$(INSTALLROOT)$(INSTALLDIR)/$(KCROSS) headers_install
++	$(Q)for x in /usr/include/linux /usr/include/asm*; do \
++		ln -s $${x} $(INSTALLROOT)$(INSTALLDIR)/$(KCROSS)include/ || exit; \
++	done
+ 	$(Q)cp -rf usr/include/. $(INSTALLROOT)$(INSTALLDIR)/$(KCROSS)include/.
++	$(Q)chmod -R a+rX $(INSTALLROOT)$(INSTALLDIR)/$(KCROSS)include
+ 	$(Q)$(install-data) $(srctree)/klcc/klcc.1 $(INSTALLROOT)$(mandir)/man1/$(KCROSS)klcc.1
+ 	$(Q)$(install-bin) $(objtree)/klcc/$(KCROSS)klcc $(INSTALLROOT)$(bindir)
+ 
diff --git a/debian/patches/series b/debian/patches/series
new file mode 100644
index 0000000..903ce90
--- /dev/null
+++ b/debian/patches/series
@@ -0,0 +1,3 @@
+ia64-static
+klibc-linux-libc-dev
+insmod
diff --git a/debian/rules b/debian/rules
index f99216b..e8f4233 100755
--- a/debian/rules
+++ b/debian/rules
@@ -1,7 +1,7 @@
 #!/usr/bin/make -f
-include /usr/share/cdbs/1/class/makefile.mk
-include /usr/share/cdbs/1/rules/debhelper.mk
-include /usr/share/cdbs/1/rules/simple-patchsys.mk
+
+# let debhelper be verbose
+#export DH_VERBOSE=1
 
 ifeq ($(DEB_ARCH),armel)
 DEB_MAKE_ENVVARS := CONFIG_AEABI=y
@@ -25,22 +25,15 @@ ifeq ($(DEB_ARCH),sh4)
 DEB_MAKE_ENVVARS := ARCH=sh
 endif
 
-
-DEB_MAKE_INVOKE := make
-DEB_MAKE_CLEAN_TARGET := clean
-DEB_MAKE_BUILD_TARGET := all
 DEB_MAKE_ENVVARS := INSTALLROOT=debian/tmp $(DEB_MAKE_ENVVARS)
 
 # Enable this to get verbose build information
 DEB_MAKE_ENVVARS += KBUILD_VERBOSE=1
 
-DEB_MAKE_INVOKE = make -C $(DEB_BUILDDIR) $(DEB_MAKE_ENVVARS)
-
-DEB_MAKE_INSTALL_TARGET := install
+%:
+	dh $@ --link-doc=libklibc
 
-DEB_FIXPERMS_EXCLUDE := klibc-
-
-pre-build::
+override_dh_auto_build:
 	if [ ! -e linux ]; then \
 		rm -rf linux/include; \
 		mkdir -p linux/include; \
@@ -49,8 +42,14 @@ pre-build::
 			ln -s $${x} linux/include; \
 		done \
 	fi
+	make all $(DEB_MAKE_ENVVARS)
 
-clean::
+override_dh_auto_clean:
 	rm -rf linux
-	make $(DEB_MAKE_ENVVARS) mrproper
+	dh_auto_clean
+
+override_dh_auto_install:
+	make install $(DEB_MAKE_ENVVARS)
 
+override_dh_fixperms:
+	dh_fixperms -Xklibc-
diff --git a/debian/source/format b/debian/source/format
new file mode 100644
index 0000000..163aaf8
--- /dev/null
+++ b/debian/source/format
@@ -0,0 +1 @@
+3.0 (quilt)

Attachment: signature.asc
Description: Digital signature

Reply via email to