To add automatic recognition and decompress for files in tar.Z format,
I added af few lines to match on "tar.Z" filenames.

I think we should look at which filenames be detected, and probably
we don't need the uncompress itself, since probably others (gzip?)
might do the same.

Thomas

PS: it's a quick hack, since the source of "dcc" downloads as tar.Z .
    expect in a few days SFEdcc.spec (Distributed Checksum Clearinghouse 1.3.80
    - detects identical mass emails - http://www.rhyolite.com/anti-spam/dcc)

apply the patch below with:
user at host /opt/jdsbld/lib # gpatch -p0 < 
$HOME/pkgbuild-patch-uncompress.diff 
patching file pkgbuild-1.2.0/macros
patching file pkgbuild-1.2.0/rpm_spec.pm

==================================== $HOME/pkgbuild-patch-uncompress.diff

--- pkgbuild-1.2.0.orig/macros  Mon Apr  2 02:46:12 2007
+++ pkgbuild-1.2.0/macros       Sat Jan 19 01:30:31 2008
@@ -22,6 +22,7 @@
 #
 %__awk                  gawk
 %__bzip2                /usr/bin/bzip2
+%__uncompress           /usr/bin/uncompress
 %__cat                  /bin/cat
 %__chgrp                /bin/chgrp
 %__chmod                /bin/chmod
@@ -76,6 +77,7 @@
 %_builddir              %{_topdir}/BUILD
 %_buildshell            /bin/bash
 %_bzip2bin              %{__bzip2}
+%_uncompressbin         %{__uncompress}
 %_defaultdocdir         %{_usr}/doc
 %_gzipbin               %{__gzip}
 %_instchangelog         5

--- pkgbuild-1.2.0.orig/rpm_spec.pm     Sat Jan 19 01:35:49 2008
+++ pkgbuild-1.2.0/rpm_spec.pm  Sat Jan 19 01:35:49 2008
@@ -1372,6 +1372,8 @@
        $uncompress = "/usr/bin/bzip2 -dc";
     } elsif ($srcname =~ /(\.tar\.gz|\.tgz)$/) {
        $uncompress = "/usr/bin/gzip -dc";
+    } elsif ($srcname =~ /(\.tar\.Z)$/) {
+       $uncompress = "/usr/bin/uncompress -c";
     } elsif ($srcname =~ /(\.tar)$/) {
        $uncompress = "/bin/cat";
     } elsif ($srcname =~ /(\.zip)$/) {


====================================

-- 

Reply via email to