Index: /trunk/Makefile
===================================================================
--- /trunk/Makefile	(revision 168)
+++ /trunk/Makefile	(revision 169)
@@ -6,5 +6,5 @@
 
 PKGNAME=debbuild
-VERSION=0.9.5
+VERSION=0.9.6
 
 MANDIR=/usr/share/man
Index: /trunk/debbuild
===================================================================
--- /trunk/debbuild	(revision 168)
+++ /trunk/debbuild	(revision 169)
@@ -96,5 +96,5 @@
 my $hostarch;	# we set this later...
 my $scriptletbase =
-q(#!/bin/sh
+q(#!/bin/bash
 
   RPM_SOURCE_DIR="%{_topdir}/SOURCES"
@@ -843,4 +843,6 @@
       next LINE if /^\%docdir/;
 #      my $singleton = 0;	# don't recall what this was for
+      next LINE if /^\s*#/;
+      next LINE if /^\s*$/;
 
 # create and initialize flags
@@ -980,5 +982,5 @@
       } elsif (/^enhances:\s*(.+)/i) {
         $pkgdata{main}{enhances} .= ", $1";
-	warn "Warning:  Debian-specific 'Enahnces:' outside \%if wrapper\n" if $iflevel == 0;
+	warn "Warning:  Debian-specific 'Enhances:' outside \%if wrapper\n" if $iflevel == 0;
       } elsif (/^replaces:\s*(.+)/i) {
         $pkgdata{main}{replaces} .= ", $1";
@@ -1465,4 +1467,7 @@
 
   foreach my $req (@reqlist) {
+    # from rpmbuild error message
+    # Dependency tokens must begin with alpha-numeric, '_' or '/'
+##fixme:  check for suitable whitespace around $rel
     my ($pkg,$rel,$ver);
 
@@ -1479,14 +1484,23 @@
 
     my @pkglist = qx { dpkg-query --showformat '\${status}\t\${version}\n' -W $pkg };
-# need to check if no lines returned - means a bad buildreq
     if (!$pkglist[0]) {
       print " * Missing build-dependency $pkg!\n";
       $reqflag = 0;
     } else {
+# real package, installed
+#kdeugau:~$ dpkg-query --showformat '${status}\t${version}\n' -W libc-client2007e-dev 2>&1
+#install ok installed    8:2007f~dfsg-1
+# virtual package, provided by ???
+#kdeugau:~$ dpkg-query --showformat '${status}\t${version}\n' -W libc-client-dev 2>&1
+#unknown ok not-installed
+# real package or virtual package not installed or provided
+#kdeugau:~$ dpkg-query --showformat '${status}\t${version}\n' -W libdb4.8-dbg 2>&1
+#dpkg-query: no packages found matching libdb4.8-dbg
+
       my ($reqstat,undef,undef,$reqver) = split /\s+/, $pkglist[0];
-      if ($reqstat !~ /install/) {
-	print " * Missing build-dependency $pkg!\n";
-	$reqflag = 0;
-      } else {
+      if ($reqstat =~ /^unknown/) {
+	# this seems to be a virtual package.
+	print " * Warning: $pkg is probably installed but seems to be a virtual package.\n";
+      } elsif ($reqstat =~ /^install/) {
 	my ($resp) = qx { dpkg --compare-versions $reqver '$rel' $ver && echo "ok" };
 	if ($resp !~ /^ok/) {
@@ -1494,4 +1508,8 @@
 	  print " * Buildreq $pkg is installed, but wrong version ($reqver):  Need $ver\n"
         }
+      } else {
+	# whatever state it's in, it's not completely installed, therefore it's missing.
+	print " * Missing build-dependency $pkg!\n";
+	$reqflag = 0;
       } # end not installed/installed check
     }
@@ -1543,5 +1561,5 @@
     next if /linux-vdso.so/;		# More kernel hackery.  Whee!
 
-    my ($req) = (m|=\>\s+([a-z0-9._/-]+)|); # dig out the actual library (so)name.
+    my ($req) = (m|=\>\s+([a-zA-Z0-9._/+-]+)|); # dig out the actual library (so)name.
 	# And feh, we need the *path*, since I've discovered a new edge case where
 	# the same libnnn.1.2.3 *file*name is found across *several* lib dirs.  >:(
@@ -1709,4 +1727,5 @@
 
     $macrostring =~ s|%{_builddir}|%{_topdir}/BUILD|g;
+    $macrostring =~ s|%{buildsubdir}|$tarballdir|g;
     $macrostring =~ s|%{_topdir}|$topdir|g;
     $macrostring =~ s|%{_tmppath}|$tmpdir|g;
Index: /trunk/debbuild.spec
===================================================================
--- /trunk/debbuild.spec	(revision 168)
+++ /trunk/debbuild.spec	(revision 169)
@@ -49,7 +49,7 @@
 Source: http://www.deepnet.cx/debbuild/debbuild-%{version}.tar.gz
 Group: Development/Tools
-License: GPLv2
+License: GPLv2+
 Packager: Kris Deugau <kdeugau@deepnet.cx>
-Requires: perl, build-essential, pax, fakeroot
+Requires: perl, build-essential, pax, fakeroot, bash
 %if %{_vendor} == "debbuild"
 Recommends: patch, bzip2
