added four pkgbuild patches originating from verious sources:
authorGuido Berhoerster <gber@openindiana.org>
Tue, 31 May 2011 23:56:58 +0200
changeset 6 25ef87909474
parent 5 50e42deb7bb2
child 7 2c25c60717b0
added four pkgbuild patches originating from verious sources: pkgbuild-04-patchdir.patch allows to put patches in subdirectories pkgbuild-05-postprocess-debug-separate.patch can optionally put debug symbols in separate files pkgbuild-06-file-ips-repo.patch enables publishing file based IPS repos pkgbuild-07-xz.patch adds xz decompression support
patches/desktop-cbe-mini-02-pkgbuild-patches.patch
--- a/patches/desktop-cbe-mini-02-pkgbuild-patches.patch	Mon May 30 20:15:01 2011 +0200
+++ b/patches/desktop-cbe-mini-02-pkgbuild-patches.patch	Tue May 31 23:56:58 2011 +0200
@@ -7,7 +7,7 @@
      logrun ln -s $tardir/pkgbuild-$PKGBUILD_VERSION.tar.bz2 $tmp_build_dir/packages/SOURCES/ || return 1
 +    logrun cp $mydir/patches/pkgbuild-*.patch $tmp_build_dir/packages/SOURCES/ || return 1
 +    logrun patch -p1 < $mydir/pkgbuild-add-patches.patch || return 1
-+    logrun bash -c 'perl_package="$(pkg search -l -H -o pkg.name "link::/usr/bin/perl OR file::/usr/bin/perl" 2>/dev/null)"; sed "s|^Requires:     SUNWperl584core|Requires: ${perl_package:-SUNWperl584core}|" pkgbuild.spec > pkgbuild.spec.$$ && mv pkgbuild.spec.$$ pkgbuild.spec' || return 1
++    logrun bash -c 'perl_package="$(pkg search -l -H -o pkg.name "link::/usr/bin/perl OR file::/usr/bin/perl" 2>/dev/null)"; sed "s/^Requires:     SUNWperl584core/Requires: ${perl_package:-SUNWperl584core}/" pkgbuild.spec > pkgbuild.spec.$$ && mv pkgbuild.spec.$$ pkgbuild.spec' || return 1
      logrun cp -pr $tmp_build_dir/src/pkgbuild-$PKGBUILD_VERSION/COPYING $tmp_build_dir/packages/SOURCES/gpl-2.0.txt || return 1
 -    logrun_quiet bash -c "$tmp_build_dir/bin/pkgtool --src $tmp_build_dir/packages/SOURCES --nonotify --define \"pkgbuild_prefix /usr\" --define \"_topdir $tmp_build_dir/packages\" build --update-if-newer $tmp_build_dir/src/pkgbuild-$PKGBUILD_VERSION/pkgbuild.spec" || return 1
 +    logrun_quiet bash -c "$tmp_build_dir/bin/pkgtool --src $tmp_build_dir/packages/SOURCES --patches $tmp_build_dir/packages/SOURCES --nonotify --define \"pkgbuild_prefix /usr\" --define \"_topdir $tmp_build_dir/packages\" build --update-if-newer $tmp_build_dir/src/pkgbuild-$PKGBUILD_VERSION/pkgbuild.spec" || return 1
@@ -16,7 +16,7 @@
      cd /tmp || return 1
 diff -urN desktop-cbe-mini-1.8.0.orig/patches/pkgbuild-01-add-unknown-dependencies.patch desktop-cbe-mini-1.8.0/patches/pkgbuild-01-add-unknown-dependencies.patch
 --- desktop-cbe-mini-1.8.0.orig/patches/pkgbuild-01-add-unknown-dependencies.patch	1970-01-01 01:00:00.000000000 +0100
-+++ desktop-cbe-mini-1.8.0/patches/pkgbuild-01-add-unknown-dependencies.patch	2011-05-06 15:15:00.000000000 +0200
++++ desktop-cbe-mini-1.8.0/patches/pkgbuild-01-add-unknown-dependencies.patch	2011-05-31 23:46:03.000000000 +0200
 @@ -0,0 +1,13 @@
 +diff -ur pkgbuild-1.3.103.orig/pkgbuild.pl.in pkgbuild-1.3.103/pkgbuild.pl.in
 +--- pkgbuild-1.3.103.orig/pkgbuild.pl.in	2010-07-12 04:56:34.000000000 +0200
@@ -33,7 +33,7 @@
 + 
 diff -urN desktop-cbe-mini-1.8.0.orig/patches/pkgbuild-02-nopkg.patch desktop-cbe-mini-1.8.0/patches/pkgbuild-02-nopkg.patch
 --- desktop-cbe-mini-1.8.0.orig/patches/pkgbuild-02-nopkg.patch	1970-01-01 01:00:00.000000000 +0100
-+++ desktop-cbe-mini-1.8.0/patches/pkgbuild-02-nopkg.patch	2011-05-06 15:15:00.000000000 +0200
++++ desktop-cbe-mini-1.8.0/patches/pkgbuild-02-nopkg.patch	2011-05-31 23:46:03.000000000 +0200
 @@ -0,0 +1,182 @@
 +diff -ur pkgbuild-1.3.103.orig/pkgtool.pl pkgbuild-1.3.103/pkgtool.pl
 +--- pkgbuild-1.3.103.orig/pkgtool.pl	2010-07-14 13:03:12.000000000 +0200
@@ -219,7 +219,7 @@
 +     if (defined($rpm_target)) {
 diff -urN desktop-cbe-mini-1.8.0.orig/patches/pkgbuild-03-forcefully-copy-docs.patch desktop-cbe-mini-1.8.0/patches/pkgbuild-03-forcefully-copy-docs.patch
 --- desktop-cbe-mini-1.8.0.orig/patches/pkgbuild-03-forcefully-copy-docs.patch	1970-01-01 01:00:00.000000000 +0100
-+++ desktop-cbe-mini-1.8.0/patches/pkgbuild-03-forcefully-copy-docs.patch	2011-05-06 15:15:00.000000000 +0200
++++ desktop-cbe-mini-1.8.0/patches/pkgbuild-03-forcefully-copy-docs.patch	2011-05-31 23:46:03.000000000 +0200
 @@ -0,0 +1,13 @@
 +diff -ur pkgbuild-1.3.103.orig/pkgbuild.pl.in pkgbuild-1.3.103/pkgbuild.pl.in
 +--- pkgbuild-1.3.103.orig/pkgbuild.pl.in	2010-11-02 13:39:24.000000000 +0100
@@ -234,30 +234,258 @@
 + 	fatal ("ERROR: failed to copy $fname to $mydir/$basedir/$docdir/$fname_basedir");
 + 	return undef;
 +Only in pkgbuild-1.3.103: pkgbuild.pl.in.orig
+diff -urN desktop-cbe-mini-1.8.0.orig/patches/pkgbuild-04-patchdir.patch desktop-cbe-mini-1.8.0/patches/pkgbuild-04-patchdir.patch
+--- desktop-cbe-mini-1.8.0.orig/patches/pkgbuild-04-patchdir.patch	1970-01-01 01:00:00.000000000 +0100
++++ desktop-cbe-mini-1.8.0/patches/pkgbuild-04-patchdir.patch	2011-05-31 23:46:03.000000000 +0200
+@@ -0,0 +1,20 @@
++diff -urN pkgbuild-1.3.103.orig/pkgtool.pl pkgbuild-1.3.103/pkgtool.pl
++--- pkgbuild-1.3.103.orig/pkgtool.pl	2011-05-31 23:40:13.000000000 +0200
+++++ pkgbuild-1.3.103/pkgtool.pl	2011-05-31 23:40:48.000000000 +0200
++@@ -2435,8 +2435,15 @@
++ 
++ 	my @the_patch_dirlist = split /[:]/, $defaults->get ('patchdirs');
++ 	foreach my $the_patch_dir (@the_patch_dirlist) {
+++	    $patch_path = "$the_patch_dir/$patch";
+++	    if (! -f "$patch_path") {
+++		msg_info (3, "   not found in $patch_path");
+++	    } else {
+++		msg_info (3, "   found in $patch_path");
+++		last;
+++	    }
+++
++ 	    $patch_path = "$the_patch_dir/$patch_base_name";
++-	    
++ 	    if (! -f "$patch_path") {
++ 		msg_info (3, "   not found in $patch_path");
++ 	    } else {
+diff -urN desktop-cbe-mini-1.8.0.orig/patches/pkgbuild-04-patchdirpatch desktop-cbe-mini-1.8.0/patches/pkgbuild-04-patchdirpatch
+--- desktop-cbe-mini-1.8.0.orig/patches/pkgbuild-04-patchdirpatch	1970-01-01 01:00:00.000000000 +0100
++++ desktop-cbe-mini-1.8.0/patches/pkgbuild-04-patchdirpatch	2011-05-31 15:32:57.000000000 +0200
+@@ -0,0 +1,19 @@
++--- pkgtool.pl.orig	2010-02-16 14:18:03.607378407 +0100
+++++ pkgtool.pl	2010-02-16 14:57:37.148604741 +0100
++@@ -2132,8 +2132,15 @@
++ 
++ 	my @the_patch_dirlist = split /[:]/, $defaults->get ('patchdirs');
++ 	foreach my $the_patch_dir (@the_patch_dirlist) {
+++	    $patch_path = "$the_patch_dir/$patch";
+++	    if (! -f "$patch_path") {
+++		msg_info (3, "   not found in $patch_path");
+++	    } else {
+++		msg_info (3, "   found in $patch_path");
+++		last;
+++	    }
+++
++ 	    $patch_path = "$the_patch_dir/$patch_base_name";
++-	    
++ 	    if (! -f "$patch_path") {
++ 		msg_info (3, "   not found in $patch_path");
++ 	    } else {
+diff -urN desktop-cbe-mini-1.8.0.orig/patches/pkgbuild-05-postprocess-debug-separate.patch desktop-cbe-mini-1.8.0/patches/pkgbuild-05-postprocess-debug-separate.patch
+--- desktop-cbe-mini-1.8.0.orig/patches/pkgbuild-05-postprocess-debug-separate.patch	1970-01-01 01:00:00.000000000 +0100
++++ desktop-cbe-mini-1.8.0/patches/pkgbuild-05-postprocess-debug-separate.patch	2011-05-31 23:46:03.000000000 +0200
+@@ -0,0 +1,53 @@
++diff -urN pkgbuild-1.3.103.orig/pkgbuild-postprocess pkgbuild-1.3.103/pkgbuild-postprocess
++--- pkgbuild-1.3.103.orig/pkgbuild-postprocess	2008-08-11 01:43:57.000000000 +0200
+++++ pkgbuild-1.3.103/pkgbuild-postprocess	2011-05-31 23:42:39.000000000 +0200
++@@ -3,6 +3,7 @@
++ SET_PERMISSIONS=yes
++ MAINTAIN_TIMESTAMP=yes
++ DO_STRIP=yes
+++DO_GOBJCOPY=no
++ COMMENTS=
++ VERBOSE=no
++ 
++@@ -23,6 +24,9 @@
++   echo "  -s, --nostrip"
++   echo "        Do not strip symbolic information from ELF binaries"
++   echo "        The default is to run \"strip -x\"."
+++  echo "  -g, --debug-info-separate-file"
+++  echo "        Copy the debug information from ELF binaries to a separate file"
+++  echo "        with a .debug suffix, before running \"strip -x\" (unless --nostrip)."
++   echo "  -m, --touch"
++   echo "        Change the file modification timestamp for the changed files"
++   echo "        The default is to maintain the original timestamp."
++@@ -60,6 +64,10 @@
++     test -c "$1" && return 1
++     test -S "$1" && return 1
++     test -f "$1" || return 1
+++    if [ "${1%.debug}.debug" = "${1}" ]
+++    then
+++        return 1
+++    fi
++     /usr/bin/file $1 2>/dev/null | /usr/bin/grep "ELF " > /dev/null 2>&1 \
++ 	&& return 0
++     return 1
++@@ -78,6 +86,10 @@
++ 	set_permissions $1
++     fi
++     
+++    if [ $DO_GOBJCOPY = yes -a $FILE_IS_ELF = yes ]; then
+++	/usr/sfw/bin/gobjcopy $1 $1.debug
+++    fi
+++
++     if [ $DO_STRIP = yes -a $FILE_IS_ELF = yes ]; then
++ 	/usr/ccs/bin/strip -x $1
++     fi
++@@ -125,6 +137,9 @@
++ 	-s|--nostrip )
++ 	    DO_STRIP=no
++ 	    ;;
+++	-g|--debug-info-separate-file )
+++	    DO_GOBJCOPY=yes
+++	    ;;
++ 	-m|--touch )
++ 	    MAINTAIN_TIMESTAMP=no
++ 	    ;;
+diff -urN desktop-cbe-mini-1.8.0.orig/patches/pkgbuild-05-postprocess-debug-separatepatch desktop-cbe-mini-1.8.0/patches/pkgbuild-05-postprocess-debug-separatepatch
+--- desktop-cbe-mini-1.8.0.orig/patches/pkgbuild-05-postprocess-debug-separatepatch	1970-01-01 01:00:00.000000000 +0100
++++ desktop-cbe-mini-1.8.0/patches/pkgbuild-05-postprocess-debug-separatepatch	2011-05-31 15:33:50.000000000 +0200
+@@ -0,0 +1,52 @@
++--- pkgbuild-1.3.101/pkgbuild-postprocess.orig	2010-01-09 06:37:05.000000000 +0000
+++++ pkgbuild-1.3.101/pkgbuild-postprocess	2010-02-19 09:45:20.021511000 +0000
++@@ -3,6 +3,7 @@
++ SET_PERMISSIONS=yes
++ MAINTAIN_TIMESTAMP=yes
++ DO_STRIP=yes
+++DO_GOBJCOPY=no
++ COMMENTS=
++ VERBOSE=no
++ 
++@@ -23,6 +24,9 @@
++   echo "  -s, --nostrip"
++   echo "        Do not strip symbolic information from ELF binaries"
++   echo "        The default is to run \"strip -x\"."
+++  echo "  -g, --debug-info-separate-file"
+++  echo "        Copy the debug information from ELF binaries to a separate file"
+++  echo "        with a .debug suffix, before running \"strip -x\" (unless --nostrip)."
++   echo "  -m, --touch"
++   echo "        Change the file modification timestamp for the changed files"
++   echo "        The default is to maintain the original timestamp."
++@@ -60,6 +64,10 @@
++     test -c "$1" && return 1
++     test -S "$1" && return 1
++     test -f "$1" || return 1
+++    if [ "${1%.debug}.debug" = "${1}" ]
+++    then
+++        return 1
+++    fi
++     /usr/bin/file $1 2>/dev/null | /usr/bin/grep "ELF " > /dev/null 2>&1 \
++ 	&& return 0
++     return 1
++@@ -78,6 +86,10 @@
++ 	set_permissions $1
++     fi
++     
+++    if [ $DO_GOBJCOPY = yes -a $FILE_IS_ELF = yes ]; then
+++	/usr/sfw/bin/gobjcopy $1 $1.debug
+++    fi
+++
++     if [ $DO_STRIP = yes -a $FILE_IS_ELF = yes ]; then
++ 	/usr/ccs/bin/strip -x $1
++     fi
++@@ -125,6 +137,9 @@
++ 	-s|--nostrip )
++ 	    DO_STRIP=no
++ 	    ;;
+++	-g|--debug-info-separate-file )
+++	    DO_GOBJCOPY=yes
+++	    ;;
++ 	-m|--touch )
++ 	    MAINTAIN_TIMESTAMP=no
++ 	    ;;
+diff -urN desktop-cbe-mini-1.8.0.orig/patches/pkgbuild-06-file-ips-repo.patch desktop-cbe-mini-1.8.0/patches/pkgbuild-06-file-ips-repo.patch
+--- desktop-cbe-mini-1.8.0.orig/patches/pkgbuild-06-file-ips-repo.patch	1970-01-01 01:00:00.000000000 +0100
++++ desktop-cbe-mini-1.8.0/patches/pkgbuild-06-file-ips-repo.patch	2011-05-31 23:46:03.000000000 +0200
+@@ -0,0 +1,28 @@
++diff -urN pkgbuild-1.3.103.orig/pkgbuild.pl.in pkgbuild-1.3.103/pkgbuild.pl.in
++--- pkgbuild-1.3.103.orig/pkgbuild.pl.in	2011-05-31 23:40:18.000000000 +0200
+++++ pkgbuild-1.3.103/pkgbuild.pl.in	2011-05-31 23:43:34.000000000 +0200
++@@ -72,6 +72,8 @@
++     $src_ips_server = $ips_server;
++ }
++ 
+++my $pkg_repo = $ENV{PKG_REPO};
+++
++ my $mydir = `pwd`;
++ chomp ($mydir);
++ my @spec_names = ();
++@@ -1862,9 +1864,13 @@
++ 	print "Warning: Open transaction isn't first line of pkgsend script!\n";
++     }
++     if (defined ($src)) {
++-	push (@$ref_lines, "export PKG_REPO=\${PKGBUILD_SRC_IPS_SERVER:-\${PKGBUILD_IPS_SERVER:-$ips_server}}");
+++        if (not defined($pkg_repo)) {
+++	   push (@$ref_lines, "export PKG_REPO=\${PKGBUILD_SRC_IPS_SERVER:-\${PKGBUILD_IPS_SERVER:-$ips_server}}");
+++        }
++     } else {
++-	push (@$ref_lines, "export PKG_REPO=\${PKGBUILD_IPS_SERVER:-$ips_server}");
+++        if (not defined($pkg_repo)) {
+++	    push (@$ref_lines, "export PKG_REPO=\${PKGBUILD_IPS_SERVER:-$ips_server}");
+++        }
++     }
++     push (@$ref_lines, "eval `pkgsend open $name\@$version` || exit 1");
++     push (@$ref_lines, "pkgsend include $manifest || exit 2");
+diff -urN desktop-cbe-mini-1.8.0.orig/patches/pkgbuild-07-xz.patch desktop-cbe-mini-1.8.0/patches/pkgbuild-07-xz.patch
+--- desktop-cbe-mini-1.8.0.orig/patches/pkgbuild-07-xz.patch	1970-01-01 01:00:00.000000000 +0100
++++ desktop-cbe-mini-1.8.0/patches/pkgbuild-07-xz.patch	2011-05-31 23:46:03.000000000 +0200
+@@ -0,0 +1,24 @@
++diff -urN pkgbuild-1.3.103.orig/pkgtool.pl pkgbuild-1.3.103/pkgtool.pl
++--- pkgbuild-1.3.103.orig/pkgtool.pl	2011-05-31 23:40:48.000000000 +0200
+++++ pkgbuild-1.3.103/pkgtool.pl	2011-05-31 23:45:05.000000000 +0200
++@@ -2166,7 +2166,7 @@
++     my $src_path;
++ 
++     my @the_tarball_dirlist = split /[:]/, $defaults->get ('tarballdirs');
++-    if ($src =~ /\.(tar\.gz|tgz|tar\.bz2|tar\.bzip2|zip|jar)$/) {
+++    if ($src =~ /\.(tar\.gz|tgz|tar\.bz2|tar\.bzip2|tar\.xz|txz|zip|jar)$/) {
++ 	$is_tarball = 1;
++ 
++ 	foreach my $srcdir (@the_tarball_dirlist) {
++diff -urN pkgbuild-1.3.103.orig/rpm_spec.pm.in pkgbuild-1.3.103/rpm_spec.pm.in
++--- pkgbuild-1.3.103.orig/rpm_spec.pm.in	2010-07-09 02:30:17.000000000 +0200
+++++ pkgbuild-1.3.103/rpm_spec.pm.in	2011-05-31 23:45:05.000000000 +0200
++@@ -1466,6 +1466,8 @@
++ 	$uncompress = "/usr/bin/bzip2 -dc";
++     } elsif ($srcname =~ /(\.tar\.gz|\.tgz)$/) {
++ 	$uncompress = "/usr/bin/gzip -dc";
+++    } elsif ($srcname =~ /(\.tar\.xz|\.txz)$/) {
+++	$uncompress = "/usr/bin/xz -dc";
++     } elsif ($srcname =~ /(\.tar\.Z)$/) {
++        $uncompress = "/usr/bin/uncompress -c";
++     } elsif ($srcname =~ /(\.tar)$/) {
 diff -urN desktop-cbe-mini-1.8.0.orig/pkgbuild-add-patches.patch desktop-cbe-mini-1.8.0/pkgbuild-add-patches.patch
 --- desktop-cbe-mini-1.8.0.orig/pkgbuild-add-patches.patch	1970-01-01 01:00:00.000000000 +0100
-+++ desktop-cbe-mini-1.8.0/pkgbuild-add-patches.patch	2011-05-06 15:15:00.000000000 +0200
-@@ -0,0 +1,23 @@
-+diff -ur pkgbuild-1.3.103.orig/pkgbuild.spec pkgbuild-1.3.103/pkgbuild.spec
++++ desktop-cbe-mini-1.8.0/pkgbuild-add-patches.patch	2011-05-31 23:51:09.000000000 +0200
+@@ -0,0 +1,31 @@
++diff -urN pkgbuild-1.3.103.orig/pkgbuild.spec pkgbuild-1.3.103/pkgbuild.spec
 +--- pkgbuild-1.3.103.orig/pkgbuild.spec	2010-07-14 12:53:27.000000000 +0200
-++++ pkgbuild-1.3.103/pkgbuild.spec	2010-11-02 13:54:32.000000000 +0100
-+@@ -16,6 +16,9 @@
+++++ pkgbuild-1.3.103/pkgbuild.spec	2011-05-31 23:50:24.000000000 +0200
++@@ -16,6 +16,13 @@
 + Vendor:	      OpenSolaris Community
 + Summary:      pkgbuild - rpmbuild-like tool for building Solaris packages
 + Source:       http://prdownloads.sourceforge.net/pkgbuild/pkgbuild-%{version}.tar.bz2
 ++Patch1:       pkgbuild-01-add-unknown-dependencies.patch
 ++Patch2:       pkgbuild-02-nopkg.patch
 ++Patch3:       pkgbuild-03-forcefully-copy-docs.patch
+++Patch4:       pkgbuild-04-patchdir.patch
+++Patch5:       pkgbuild-05-postprocess-debug-separate.patch
+++Patch6:       pkgbuild-06-file-ips-repo.patch
+++Patch7:       pkgbuild-07-xz.patch
 + BuildRoot:    %{_tmppath}/%{name}-%{version}-build
 + 
 + %if %_is_pkgbuild
-+@@ -45,6 +48,9 @@
++@@ -45,6 +52,13 @@
 + 
 + %prep
 + %setup -q -n pkgbuild-%version
 ++%patch1 -p1
 ++%patch2 -p1
 ++%patch3 -p1
+++%patch4 -p1
+++%patch5 -p1
+++%patch6 -p1
+++%patch7 -p1
 + 
 + %build
 + ./configure --prefix=%{pkgbuild_prefix}