--- debhelper-7.2.24.orig/dh_fixperms
+++ debhelper-7.2.24/dh_fixperms
@@ -53,8 +53,8 @@
 	}
 
 	# General permissions fixing.
-	complex_doit("find $tmp $find_options -print0",
-		"2>/dev/null | xargs -0r chown --no-dereference 0:0");
+#	complex_doit("find $tmp $find_options -print0",
+#		"2>/dev/null | xargs -0r chown --no-dereference 0:0");
 	complex_doit("find $tmp ! -type l $find_options -print0",
 		"2>/dev/null | xargs -0r chmod go=rX,u+rw,a-s");
 	
@@ -72,8 +72,13 @@
 	# ..and so are executable shared and static libraries 
 	# (and .la files from libtool) ..
 	complex_doit("find $tmp -perm -5 -type f",
-		"\\( -name '*.so*' -or -name '*.la' -or -name '*.a' \\) $find_options -print0",
+		"\\( -name '*.la' -or -name '*.a' \\) $find_options -print0",
 		"2>/dev/null | xargs -0r chmod 644");
+
+# on interix .so files must be executable
+	complex_doit("find $tmp -type f",
+		"-name 'lib*.so*' $find_options -print0",
+		"2>/dev/null | xargs -0r chmod 755");
 	
 	# ..and header files ..
 	complex_doit("find $tmp/usr/include -type f $find_options -print0",
--- debhelper-7.2.24.orig/dh_gencontrol
+++ debhelper-7.2.24/dh_gencontrol
@@ -53,7 +53,8 @@
 	}
 
 	if ( ! -d "$tmp/DEBIAN" ) {
-		doit("install","-o",0,"-g",0,"-d","$tmp/DEBIAN");
+		#doit("install","-o",0,"-g",0,"-d","$tmp/DEBIAN");
+		doit("install","-d","$tmp/DEBIAN");
 	}
 
 	# avoid gratuitous warning
@@ -73,7 +74,7 @@
 	# something odd.
 	doit("chmod","644","$tmp/DEBIAN/control");
 	
-	doit("chown","0:0","$tmp/DEBIAN/control");
+	#doit("chown","0:0","$tmp/DEBIAN/control");
 }
 
 =head1 SEE ALSO
--- debhelper-7.2.24.orig/dh_installchangelogs
+++ debhelper-7.2.24/dh_installchangelogs
@@ -115,10 +115,12 @@
 
 		doit("install","-d","$tmp/usr/share/doc/$package");
 	}
-	doit("install","-o",0,"-g",0,"-p","-m644",$changelog,
+	#doit("install","-o",0,"-g",0,"-p","-m644",$changelog,
+	doit("install","-p","-m644",$changelog,
 		"$tmp/usr/share/doc/$package/$changelog_name");
 	if (-e $news) {
-		doit("install","-o",0,"-g",0,"-p","-m644",$news,
+		#doit("install","-o",0,"-g",0,"-p","-m644",$news,
+		doit("install","-p","-m644",$news,
 			"$tmp/usr/share/doc/$package/$news_name");
 	}
 
@@ -126,13 +128,15 @@
 		my $link_to;
 		if ($upstream=~m/\.html?$/i) {
 			# HTML changelog
-			doit("install","-o",0,"-g",0,"-p","-m644",
+			#doit("install","-o",0,"-g",0,"-p","-m644",
+			doit("install","-p","-m644",
 				$upstream,"$tmp/usr/share/doc/$package/changelog.html");
 			doit("html2text","-nobs","-o","$tmp/usr/share/doc/$package/changelog",$upstream);
 			$link_to='changelog.html';
 		}
 		else {
-			doit("install","-o",0,"-g",0,"-p","-m644",
+			#doit("install","-o",0,"-g",0,"-p","-m644",
+			doit("install","-p","-m644",
 				$upstream,"$tmp/usr/share/doc/$package/changelog");
 			$link_to='changelog';
 		}
--- debhelper-7.2.24.orig/dh_installcron
+++ debhelper-7.2.24/dh_installcron
@@ -43,7 +43,8 @@
 		my $cron=pkgfile($package,"cron.$type");
 		if ($cron) {
 			if (! -d "$tmp/etc/cron.$type") {
-				doit("install","-o",0,"-g",0,"-d","$tmp/etc/cron.$type");
+				#doit("install","-o",0,"-g",0,"-d","$tmp/etc/cron.$type");
+				doit("install","-d","$tmp/etc/cron.$type");
 			}
 			doit("install",$cron,"$tmp/etc/cron.$type/".pkgfilename($package));
 		}
@@ -52,7 +53,8 @@
 	my $cron=pkgfile($package,"cron.d");
 	if ($cron) {
 		if (! -d "$tmp/etc/cron.d") {
-			doit("install","-o",0,"-g",0,"-d","$tmp/etc/cron.d");
+			#doit("install","-o",0,"-g",0,"-d","$tmp/etc/cron.d");
+			doit("install","-d","$tmp/etc/cron.d");
 		}	
 		doit("install","-m",644,$cron,"$tmp/etc/cron.d/".pkgfilename($package));
 	}
--- debhelper-7.2.24.orig/dh_installdeb
+++ debhelper-7.2.24/dh_installdeb
@@ -49,14 +49,16 @@
 	my $tmp=tmpdir($package);
 
 	if (! -d "$tmp/DEBIAN") {
-		doit("install","-o",0,"-g",0,"-d","$tmp/DEBIAN");
+		#doit("install","-o",0,"-g",0,"-d","$tmp/DEBIAN");
+		doit("install","-d","$tmp/DEBIAN");
 	}
 
 	if (is_udeb($package)) {
 		# For udebs, only do the postinst, and no #DEBHELPER#.
 		my $f=pkgfile($package,"postinst");
 		if ($f) {
-			doit("install", "-o", 0, "-g", 0, "-m", 755, 
+			#doit("install", "-o", 0, "-g", 0, "-m", 755, 
+			doit("install", "-m", 755, 
 			     $f, "$tmp/DEBIAN/postinst");
 		}
 		next;		
@@ -72,7 +74,8 @@
 		foreach my $file (qw{shlibs conffiles triggers}) {
 			my $f=pkgfile($package,$file);
 			if ($f) {
-				doit("install","-o",0,"-g",0,"-m",644,"-p",$f,"$tmp/DEBIAN/$file");
+				#doit("install","-o",0,"-g",0,"-m",644,"-p",$f,"$tmp/DEBIAN/$file");
+				doit("install","-m",644,"-p",$f,"$tmp/DEBIAN/$file");
 			}
 		}
 	}
--- debhelper-7.2.24.orig/dh_installdebconf
+++ debhelper-7.2.24/dh_installdebconf
@@ -76,7 +76,8 @@
 	my $templates=pkgfile($package,"templates");
 
 	if (! -d "$tmp/DEBIAN") {
-		doit("install","-o",0,"-g",0,"-d","$tmp/DEBIAN");
+		#doit("install","-o",0,"-g",0,"-d","$tmp/DEBIAN");
+		doit("install","-d","$tmp/DEBIAN");
 	}
 
 	if (! is_udeb($package)) {
@@ -95,7 +96,8 @@
 			complex_doit("po2debconf @extraparams $templates > $tmp/DEBIAN/templates");
 		}
 		else {
-			doit("install", "-o", 0, "-g", 0, "-m", 644, "-p",
+			#doit("install", "-o", 0, "-g", 0, "-m", 644, "-p",
+			doit("install", "-m", 644, "-p",
 			     $templates, "$tmp/DEBIAN/templates");
 		}
 	}
--- debhelper-7.2.24.orig/dh_installdocs
+++ debhelper-7.2.24/dh_installdocs
@@ -101,7 +101,8 @@
 	# If this is a symlink, leave it alone.
 	if ( ! -d "$tmp/usr/share/doc/$package" &&
 	     ! -l "$tmp/usr/share/doc/$package") {
-		doit("install","-g",0,"-o",0,"-d","$tmp/usr/share/doc/$package");
+		#doit("install","-g",0,"-o",0,"-d","$tmp/usr/share/doc/$package");
+		doit("install","-d","$tmp/usr/share/doc/$package");
 	}
 
 	my @docs;
@@ -137,7 +138,7 @@
 				doit("cp", "-a", $doc, "$tmp/usr/share/doc/$package");
 			}
 		}
-		doit("chown","-R","0:0","$tmp/usr/share/doc");
+		#doit("chown","-R","0:0","$tmp/usr/share/doc");
 		doit("chmod","-R","go=rX","$tmp/usr/share/doc");
 		doit("chmod","-R","u+rw","$tmp/usr/share/doc");
 	}
@@ -148,18 +149,21 @@
 		$readme_debian=pkgfile($package,'README.debian');
 	}
 	if ($readme_debian && ! excludefile($readme_debian)) {
-		doit("install","-g",0,"-o",0,"-m","644","-p","$readme_debian",
+		#doit("install","-g",0,"-o",0,"-m","644","-p","$readme_debian",
+		doit("install","-m","644","-p","$readme_debian",
 			"$tmp/usr/share/doc/$package/README.Debian");
 	}
 
 	my $todo=pkgfile($package,'TODO');
 	if ($todo && ! excludefile($todo)) {
 		if (isnative($package)) {
-			doit("install","-g",0,"-o",0,"-m","644","-p",$todo,
+			#doit("install","-g",0,"-o",0,"-m","644","-p",$todo,
+			doit("install","-m","644","-p",$todo,
 				"$tmp/usr/share/doc/$package/TODO");
 		}
 		else {
-			doit("install","-g",0,"-o",0,"-m","644","-p",$todo,
+			#doit("install","-g",0,"-o",0,"-m","644","-p",$todo,
+			doit("install","-m","644","-p",$todo,
 				"$tmp/usr/share/doc/$package/TODO.Debian");
 		}
 	}
@@ -176,7 +180,8 @@
 			$copyright="debian/copyright";
 		}
 		if ($copyright && ! excludefile($copyright)) {
-				doit("install","-g",0,"-o",0,"-m","644","-p",$copyright,
+				#doit("install","-g",0,"-o",0,"-m","644","-p",$copyright,
+				doit("install","-m","644","-p",$copyright,
 					"$tmp/usr/share/doc/$package/copyright");
 		}
 	}
@@ -211,11 +216,13 @@
 	
 	if (%doc_ids) {
 		if (! -d "$tmp/usr/share/doc-base/") {
-			doit("install","-g",0,"-o",0,"-d","$tmp/usr/share/doc-base/");
+			#doit("install","-g",0,"-o",0,"-d","$tmp/usr/share/doc-base/");
+			doit("install","-d","$tmp/usr/share/doc-base/");
 		}
 	}
 	foreach my $fn (keys %doc_ids) {
-		doit("install","-g",0,"-o",0,"-m644","-p","debian/$fn",
+		#doit("install","-g",0,"-o",0,"-m644","-p","debian/$fn",
+		doit("install","-m644","-p","debian/$fn",
 		     "$tmp/usr/share/doc-base/$doc_ids{$fn}");
 	}
 }
--- debhelper-7.2.24.orig/dh_installlogcheck
+++ debhelper-7.2.24/dh_installlogcheck
@@ -39,7 +39,8 @@
 		my $logcheck=pkgfile($package,"logcheck.$typenod");
 		if ($logcheck) {
 			if (! -d "$tmp/etc/logcheck/$type") {
-				doit("install","-o",0,"-g",0,"-d","$tmp/etc/logcheck/$type");
+				#doit("install","-o",0,"-g",0,"-d","$tmp/etc/logcheck/$type");
+				doit("install","-d","$tmp/etc/logcheck/$type");
 			}
 			my $packagenodot=$package; # run-parts..
 			$packagenodot=~s/\./_/g;
--- debhelper-7.2.24.orig/dh_installlogrotate
+++ debhelper-7.2.24/dh_installlogrotate
@@ -41,7 +41,8 @@
 
 	if ($file) {
 		if (! -d "$tmp/etc/logrotate.d") {
-			doit("install","-o",0,"-g",0,"-d","$tmp/etc/logrotate.d");
+			#doit("install","-o",0,"-g",0,"-d","$tmp/etc/logrotate.d");
+			doit("install","-d","$tmp/etc/logrotate.d");
 		}
 		doit("install","-m",644,$file,"$tmp/etc/logrotate.d/".pkgfilename($package));
 	}
--- debhelper-7.2.24.orig/dh_installman
+++ debhelper-7.2.24/dh_installman
@@ -195,19 +195,19 @@
 	}
 
 	# Now utf-8 conversion.
-	foreach my $dir (qw{usr/share/man usr/X11R6/man}) {
-		if (-e "$tmp/$dir") {
-			find(sub {
-				return if ! -f $_ || -l $_;
-				my ($tmp, $orig)=($_.".new", $_);
-				complex_doit "man --recode UTF-8 ./\Q$orig\E > \Q$tmp\E";
-				# recode uncompresses compressed pages
-				doit "rm", "-f", $orig if s/\.(gz|Z)$//;
-				doit "chmod", 644, $tmp;
-				doit "mv", "-f", $tmp, $_;
-			}, "$tmp/$dir");
-		}
-	}
+#	foreach my $dir (qw{usr/share/man usr/X11R6/man}) {
+#		if (-e "$tmp/$dir") {
+#			find(sub {
+#				return if ! -f $_ || -l $_;
+#				my ($tmp, $orig)=($_.".new", $_);
+#				complex_doit "man --recode UTF-8 ./\Q$orig\E > \Q$tmp\E";
+#				# recode uncompresses compressed pages
+#				doit "rm", "-f", $orig if s/\.(gz|Z)$//;
+#				doit "chmod", 644, $tmp;
+#				doit "mv", "-f", $tmp, $_;
+#			}, "$tmp/$dir");
+#		}
+#	}
 }
 
 # Check if a file is a .so man page, for use by File::Find.
--- debhelper-7.2.24.orig/dh_makeshlibs
+++ debhelper-7.2.24/dh_makeshlibs
@@ -206,7 +206,7 @@
 
 	if (-e "$tmp/DEBIAN/shlibs") {
 		doit("chmod",644,"$tmp/DEBIAN/shlibs");
-		doit("chown","0:0","$tmp/DEBIAN/shlibs");
+		#doit("chown","0:0","$tmp/DEBIAN/shlibs");
 	}
 
 	# dpkg-gensymbols files
--- debhelper-7.2.24.orig/dh_md5sums
+++ debhelper-7.2.24/dh_md5sums
@@ -82,7 +82,7 @@
 	}
 	else {
 		doit("chmod",644,"$tmp/DEBIAN/md5sums");
-		doit("chown","0:0","$tmp/DEBIAN/md5sums");
+#		doit("chown","0:0","$tmp/DEBIAN/md5sums");
 	}
 }
 
--- debhelper-7.2.24.orig/dh_shlibdeps
+++ debhelper-7.2.24/dh_shlibdeps
@@ -114,7 +114,7 @@
 
 	# dpkg-shlibdeps expects this directory to exist
 	if (! -d "$tmp/DEBIAN") {
-		doit("install","-o",0,"-g",0,"-d","$tmp/DEBIAN");
+		doit("install","-d","$tmp/DEBIAN");
 	}
 
 	my @filelist;
@@ -132,7 +132,7 @@
 		# TODO this is slow, optimize. Ie, file can run once on
 		# multiple files..
 		$ff=`file "$file"`;
-		if ($ff=~m/ELF/ && $ff!~/statically linked/) {
+		if ($ff=~m/ELF|EXE/ && $ff!~/statically linked/) {
 			push @filelist,$file;
 		}
 	}
--- debhelper-7.2.24.orig/dh_strip
+++ debhelper-7.2.24/dh_strip
@@ -119,7 +119,7 @@
 	if (m/.*\.(so.*?|cmxs$)/) {
 		# Ok, do the expensive test.
 		my $type=get_file_type($_);
-		if ($type=~m/.*ELF.*shared.*/) {
+		if ($type=~m/.*ELF.*shared.*/ or $type=~m/.*EXE.*dynamic.*/) {
 			push @shared_libs, $fn;
 			return;
 		}
@@ -130,7 +130,7 @@
 	if ($mode & 0111) {
 		# Ok, expensive test.
 		my $type=get_file_type($_);
-		if ($type=~m/.*ELF.*(executable|shared).*/) {
+		if ($type=~m/.*ELF.*(executable|shared).*/ or $type=~m/.*EXE.*executable.*/) {
 			push @executables, $fn;
 			return;
 		}
@@ -163,7 +163,8 @@
 	if (! -d $debug_dir) {
 		doit("install", "-d", $debug_dir);
 	}
-	doit("objcopy", "--only-keep-debug", $file, $debug_path);
+	#doit("objcopy", "--only-keep-debug", $file, $debug_path);
+	doit("objcopy", $file, $debug_path);
 	# No reason for this to be executable.
 	doit("chmod", 644, $debug_path);
 	return $debug_path;
@@ -172,7 +173,7 @@
 sub attach_debug {
 	my $file=shift;
 	my $debug_path=shift;
-	doit("objcopy", "--add-gnu-debuglink", $debug_path, $file);
+	#doit("objcopy", "--add-gnu-debuglink", $debug_path, $file);
 }
 
 foreach my $package (@{$dh{DOPACKAGES}}) {
--- debhelper-7.2.24.orig/dh_testroot
+++ debhelper-7.2.24/dh_testroot
@@ -20,9 +20,9 @@
 use Debian::Debhelper::Dh_Lib;
 inhibit_log();
 
-if ($< != 0) {
-	error("You must run this as root (or use fakeroot).");
-}
+#if ($< != 0) {
+#	error("You must run this as root (or use fakeroot).");
+#}
 
 =head1 SEE ALSO
 
--- debhelper-7.2.24.orig/autoscripts/postinst-suid
+++ debhelper-7.2.24/autoscripts/postinst-suid
@@ -2,7 +2,7 @@
 	if which suidregister >/dev/null 2>&1 && [ -e /etc/suid.conf ]; then
 	        suidregister -s #PACKAGE# /#FILE# #OWNER# #GROUP# #PERMS#
 	elif [ -e /#FILE# ]; then
-	        chown #OWNER#:#GROUP# /#FILE#
+#	        chown #OWNER#:#GROUP# /#FILE#
 	        chmod #PERMS# /#FILE#
 	fi
 fi
--- debhelper-7.2.24.orig/autoscripts/postinst-usrlocal
+++ debhelper-7.2.24/autoscripts/postinst-usrlocal
@@ -5,7 +5,7 @@
 		dir="$1"; mode="$2"; user="$3"; group="$4"
 		if [ ! -e "$dir" ]; then
 			if mkdir "$dir" 2>/dev/null; then
-				chown "$user":"$group" "$dir"
+#				chown "$user":"$group" "$dir"
 				chmod "$mode" "$dir"
 			fi
 		fi
--- debhelper-7.2.24.orig/Debian/Debhelper/Dh_Lib.pm
+++ debhelper-7.2.24/Debian/Debhelper/Dh_Lib.pm
@@ -765,13 +765,13 @@
 			# Just get rid of any #DEBHELPER# in the script.
 			complex_doit("sed s/#DEBHELPER#// < $file > $tmp/DEBIAN/$script");
 		}
-		doit("chown","0:0","$tmp/DEBIAN/$script");
+#		doit("chown","0:0","$tmp/DEBIAN/$script");
 		doit("chmod",755,"$tmp/DEBIAN/$script");
 	}
 	elsif ( -f "debian/$ext$script.debhelper" ) {
 		complex_doit("printf '#!/bin/sh\nset -e\n' > $tmp/DEBIAN/$script");
 		complex_doit("cat debian/$ext$script.debhelper >> $tmp/DEBIAN/$script");
-		doit("chown","0:0","$tmp/DEBIAN/$script");
+#		doit("chown","0:0","$tmp/DEBIAN/$script");
 		doit("chmod",755,"$tmp/DEBIAN/$script");
 	}
 }
--- debhelper-7.2.24.orig/debian/changelog
+++ debhelper-7.2.24/debian/changelog
@@ -1,3 +1,10 @@
+debhelper (7.2.24-0+interix.1) unstable; urgency=low
+
+  * Non-maintainer upload.
+  * patches for interix-i386
+
+ -- Martin Koeppe <mkoeppe@gmx.de>  Sun, 19 Jul 2009 14:07:35 +0200
+
 debhelper (7.2.24) unstable; urgency=low
 
   * dh_install: Add test suite covering the last 5 bugs.
--- debhelper-7.2.24.orig/debian/control
+++ debhelper-7.2.24/debian/control
@@ -2,7 +2,7 @@
 Section: devel
 Priority: optional
 Maintainer: Joey Hess <joeyh@debian.org>
-Build-Depends: po4a (>= 0.24), man-db (>= 2.5.1), file (>= 3.23)
+Build-Depends: po4a (>= 0.24), file (>= 3.23)
 Standards-Version: 3.8.1
 Vcs-Git: git://git.debian.org/git/debhelper/debhelper.git
 Vcs-Browser: http://git.debian.org/?p=debhelper/debhelper.git;a=summary
@@ -10,7 +10,7 @@
 
 Package: debhelper
 Architecture: all
-Depends: ${perl:Depends}, ${misc:Depends}, perl-base (>= 5.10), file (>= 3.23), dpkg-dev (>= 1.14.19), html2text, binutils, po-debconf, man-db (>= 2.5.1-1)
+Depends: ${perl:Depends}, ${misc:Depends}, perl-base (>= 5.10), file (>= 3.23), dpkg-dev (>= 1.14.19), html2text, binutils, po-debconf
 Suggests: dh-make
 Conflicts: dpkg-cross (<< 1.18), python-support (<< 0.5.3), python-central (<< 0.5.6)
 Description: helper programs for debian/rules
--- debhelper-7.2.24.orig/t/dh_link
+++ debhelper-7.2.24/t/dh_link
@@ -19,7 +19,7 @@
 
 # Check conversion of relative symlink to different top-level directory
 # into absolute symlink. (#244157)
-system("mkdir -p debian/debhelper/usr/lib; mkdir -p debian/debhelper/lib; touch debian/debhelper/lib/libm.so; cd debian/debhelper/usr/lib; ln -sf ../../lib/libm.so");
+system("mkdir -p debian/debhelper/usr/lib; mkdir -p debian/debhelper/lib; touch debian/debhelper/lib/libm.so; cd debian/debhelper/usr/lib; ln -sf ../../lib/libm.so libm.so");
 system("./dh_link");
 ok(readlink("debian/debhelper/usr/lib/libm.so"), "/lib/libm.so");
 
