--- apt-build-0.12.37.orig/Makefile
+++ apt-build-0.12.37/Makefile
@@ -15,14 +15,14 @@
 all: $(APT_BUILD_WRAPPER)
 	$(MAKE) -C man/
 
-$(APT_BUILD_WRAPPER): wrapper.c config.o
+$(APT_BUILD_WRAPPER): wrapper.c config.o strndup.o strnlen.o
 	$(CC) $(CFLAGS) -o $@ $^
 
 install:	$(APT_BUILD_WRAPPER) $(APT_BUILD)
-	$(INSTALL) -g 0 -o 0 -d $(BINDIR)
-	$(INSTALL) -g 0 -o 0 -m 755 $(APT_BUILD) $(BINDIR)
-	$(INSTALL) -g 0 -o 0 -d $(APT_BUILD_DIR)
-	$(INSTALL) -g 0 -o 0 -m 755 $(APT_BUILD_WRAPPER) $(APT_BUILD_DIR)
+	$(INSTALL) -d $(BINDIR)
+	$(INSTALL) -m 755 $(APT_BUILD) $(BINDIR)
+	$(INSTALL) -d $(APT_BUILD_DIR)
+	$(INSTALL) -m 755 $(APT_BUILD_WRAPPER) $(APT_BUILD_DIR)
 	for prog in $(WRAP_PROGRAMMS); do \
 		$(LN_S) $(APT_BUILD_WRAPPER) $(APT_BUILD_DIR)/$$prog; \
 	done
--- apt-build-0.12.37.orig/strndup.c
+++ apt-build-0.12.37/strndup.c
@@ -0,0 +1,35 @@
+/* A replacement function, for systems that lack strndup.
+
+   Copyright (C) 1996, 1997, 1998, 2001, 2002, 2003, 2005, 2006, 2007
+   Free Software Foundation, Inc.
+
+   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, 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
+
+#include <string.h>
+
+#include <stdlib.h>
+
+char *
+strndup (char const *s, size_t n)
+{
+  size_t len = strnlen (s, n);
+  char *new = malloc (len + 1);
+
+  if (new == NULL)
+    return NULL;
+
+  new[len] = '\0';
+  return memcpy (new, s, len);
+}
--- apt-build-0.12.37.orig/strnlen.c
+++ apt-build-0.12.37/strnlen.c
@@ -0,0 +1,29 @@
+/* Find the length of STRING, but scan at most MAXLEN characters.
+   Copyright (C) 2005, 2006, 2007 Free Software Foundation, Inc.
+   Written by Simon Josefsson.
+
+   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, 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
+
+#include <string.h>
+
+/* Find the length of STRING, but scan at most MAXLEN characters.
+   If no '\0' terminator is found in that many characters, return MAXLEN.  */
+
+size_t
+strnlen (const char *string, size_t maxlen)
+{
+  const char *end = memchr (string, '\0', maxlen);
+  return end ? (size_t) (end - string) : maxlen;
+}
--- apt-build-0.12.37.orig/debian/changelog
+++ apt-build-0.12.37/debian/changelog
@@ -1,3 +1,10 @@
+apt-build (0.12.37-0+interix.1) unstable; urgency=low
+
+  * Non-maintainer upload.
+  * patches for interix-i386
+
+ -- Martin Koeppe <mkoeppe@gmx.de>  Wed, 18 Feb 2009 23:02:40 +0100
+
 apt-build (0.12.37) unstable; urgency=low
 
   * Move tr translation to the right place.
