Mercurial > oi > oi-build
changeset 486:93595131bfc0 oi-extras
Add pkgbuild patches from spec-files-extra
author | Andrzej Szeszo <aszeszo@gmail.com> |
---|---|
date | Thu, 05 May 2011 18:08:22 +0100 |
parents | eca835a57f73 |
children | 5da774e3857f |
files | oi-extras/pkgbuild/patches/pkgbuild-01-add-unknown-dependencies.patch oi-extras/pkgbuild/patches/pkgbuild-02-nopkg.patch oi-extras/pkgbuild/patches/pkgbuild-03-forcefully-copy-docs.patch oi-extras/pkgbuild/patches/pkgbuild-04-patchdir.diff oi-extras/pkgbuild/patches/pkgbuild-05-xz.diff oi-extras/pkgbuild/patches/pkgbuild-local.diff oi-extras/pkgbuild/patches/pkgbuild-postprocess-debug-separate.diff oi-extras/pkgbuild/pkgbuild.p5m |
diffstat | 8 files changed, 328 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/oi-extras/pkgbuild/patches/pkgbuild-01-add-unknown-dependencies.patch Thu May 05 18:08:22 2011 +0100 @@ -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 ++++ pkgbuild-1.3.103/pkgbuild.pl.in 2010-10-24 11:47:20.000000000 +0200 +@@ -995,7 +995,8 @@ + if (defined ($pkg) and defined($pkgname)) { + print $fhandle "P $pkg $pkgname\n"; + } else { +- print "WARNING: omitting $dep from the SVr4 depend file\n"; ++ print "WARNING: unknown dependency $dep\n"; ++ print $fhandle "P $dep\n"; + } + } +
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/oi-extras/pkgbuild/patches/pkgbuild-02-nopkg.patch Thu May 05 18:08:22 2011 +0100 @@ -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 ++++ pkgbuild-1.3.103/pkgtool.pl 2010-11-02 13:44:16.000000000 +0100 +@@ -98,6 +98,7 @@ + # Which package mechanism are we going to install by default? + my $ips; + my $svr4; ++my $nopkg; + + sub process_defaults () { + my $default_spec_dir = "$topdir/SPECS"; +@@ -363,9 +364,11 @@ + (defined ($ips_utils) and $ips_utils->is_depotd_enabled())) { + $ips = 1; + $svr4 = undef; ++ $nopkg = undef; + } else { + $ips = undef; + $svr4 = 1; ++ $nopkg = undef; + } + } + +@@ -764,12 +767,22 @@ + } + $ips = shift; + $svr4 = undef; ++ $nopkg = undef; + } + + sub set_svr4($) { + msg_info (0,"SVr4 packages will be installed by default"); + $svr4 = shift; + $ips = undef; ++ $nopkg = undef; ++} ++ ++sub set_nopkg($) { ++ msg_info (0,"Packages will be copied into the filesystem without using a package system"); ++ msg_warning (0,"This may break your system!"); ++ $ips = undef; ++ $svr4 = undef; ++ $nopkg = shift; + } + + sub process_options { +@@ -868,6 +881,7 @@ + }, + 'ips' => sub { set_ips(1); }, + 'svr4' => sub { set_svr4(1); }, ++ 'nopkg' => sub { set_nopkg(1); }, + 'rmlog' => sub { shift; $defaults->set ('rmlog', shift); }, + '<>' => \&process_args); + +@@ -945,6 +959,11 @@ + + Install SVr4 packages by default. + ++ --nopkg ++ ++ Don't install any packages, simply copy the files. ++ WARNING: This may break your system! ++ + --rmlog + + Automatically remove the log file with each build +@@ -1511,6 +1530,95 @@ + return 1; + } + ++sub install_pkgs_nopkg ($) { ++ my $spec_id = shift; ++ my $spec = $specs_to_build[$spec_id]; ++ ++ my @pkgs = $spec->get_package_names ($ds); ++ my $verbose = $defaults->get ('verbose'); ++ if ($verbose > 0) { ++ map msg_info (0, "Installing $_\n"), @pkgs; ++ } ++ ++ my $pkgsdir = $spec->get_value_of ("_topdir") . "/PKGS"; ++ ++ my $adminfile = "/tmp/pkg.admin.$$"; ++ make_admin_file ($adminfile); ++ ++# FIXME: should install in dependency order ++ foreach my $pkg (@pkgs) { ++ my $msg; ++ ++ # Only install SVr4 package if --svr4 is defined ++ if (defined $nopkg) { ++ my $nopkgdir = "/tmp/.pkgtool-pkg.tmp.$$"; ++ if (-e $nopkgdir) { ++ `rm -rf $nopkgdir`; ++ } ++ `mkdir $nopkgdir`; ++ ++ if (defined ($ds)) { ++ $msg=`/usr/bin/pkgtrans $pkgsdir/$pkg $nopkgdir all 2>&1`; ++ } else { ++ $msg=`/usr/bin/pkgtrans $pkgsdir $nopkgdir $pkg 2>&1`; ++ } ++ ++ if ($? > 0) { ++ unlink ($adminfile); ++ msg_error "failed to install package: $msg"; ++ $build_status[$spec_id] = 'FAILED'; ++ $status_details[$spec_id] = $msg; ++ return 0; ++ } ++ ++ my $basedir = `grep '^BASEDIR=' $nopkgdir/$pkg/pkginfo |cut -d = -f 2`; ++ chomp $basedir; ++ ++ my $pkgmap = `cat $nopkgdir/$pkg/pkgmap`; ++ ++ # Install directories first. ++ while ($pkgmap =~ /^\S+ [dx] \S+ (\S+) (\S+)/mg) { ++ my ($path, $mode) = ($1, $2); ++ ++ if (! -d "$basedir/$path") { ++ `pfexec mkdir -m $mode -p $basedir/$path`; ++ } ++ } ++ ++ # Install files. Skip editable/volatile files that already exist. ++ while ($pkgmap =~ /^\S+ ([fev]) \S+ (\S+) (\S+)/mg) { ++ my ($type, $path, $mode) = ($1, $2, $3); ++ ++ if ($type !~ /^[ev]$/ || ! -e "$basedir/$path") { ++ `pfexec cp -Ppf $nopkgdir/$pkg/reloc/$path $basedir/$path`; ++ `pfexec chmod $mode $basedir/$path`; ++ } ++ } ++ ++ # Install links. ++ while ($pkgmap =~ /^\S+ ([sl]) \S+ (\S+)=(\S+)/mg) { ++ my ($type, $path, $dest) = ($1, $2, $3); ++ ++ # Make sure the last argument to ln won't be interpreted as a ++ # directory name by removing existing directories and symlinks ++ # to directories first. ++ if (-e "$basedir/$path") { ++ `pfexec rm -rf $basedir/$path`; ++ } ++ ++ if ($type eq 'l') { ++ `pfexec ln -f $dest $basedir/$path`; ++ } else { ++ `pfexec ln -sf $dest $basedir/$path`; ++ } ++ } ++ } ++ } ++ ++ unlink ($adminfile); ++ return 1; ++} ++ + my %all_incorporations; + my %incorporated; + +@@ -2594,6 +2702,8 @@ + install_pkgs_ips ($spec_id) || return 0; + } elsif (defined ($svr4)) { + install_pkgs_svr4 ($spec_id) || return 0; ++ } elsif (defined ($nopkg)) { ++ install_pkgs_nopkg ($spec_id) || return 0; + } else { + msg_error ("Internal error: either IPS or SVr4 should be selected"); + return 0; +@@ -2673,6 +2783,10 @@ + $the_command = "$the_command --nodeps"; + } + ++ if ($nopkg) { ++ $the_command = "$the_command --nodeps"; ++ } ++ + # FIXME: ExclusiveArch? + my $rpm_target = $defaults->get ('target'); + if (defined($rpm_target)) {
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/oi-extras/pkgbuild/patches/pkgbuild-03-forcefully-copy-docs.patch Thu May 05 18:08:22 2011 +0100 @@ -0,0 +1,11 @@ +--- pkgbuild/pkgbuild.pl.in.orig 2011-05-05 17:45:25.226718017 +0100 ++++ pkgbuild/pkgbuild.pl.in 2011-05-05 17:45:28.667034236 +0100 +@@ -1196,7 +1196,7 @@ + my $fname_basedir = dirname ($fname); + mkdir_p ("./$basedir/$docdir/$fname_basedir") or fatal ("Failed to create directory $mydir/$docdir/$fname_basedir"); + system ("rm -f './$basedir/$docdir/$fname_basedir/$fname'"); +- system ("cp -p '$blddir/$bsdirname/$doc_subdir$fname' './$basedir/$docdir/$fname_basedir'"); ++ system ("cp -fp '$blddir/$bsdirname/$doc_subdir$fname' './$basedir/$docdir/$fname_basedir'"); + if ($? != 0) { + fatal ("ERROR: failed to copy $fname to $mydir/$basedir/$docdir/$fname_basedir"); + return undef;
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/oi-extras/pkgbuild/patches/pkgbuild-04-patchdir.diff Thu May 05 18:08:22 2011 +0100 @@ -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 {
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/oi-extras/pkgbuild/patches/pkgbuild-05-xz.diff Thu May 05 18:08:22 2011 +0100 @@ -0,0 +1,22 @@ +--- pkgtool.pl.orig Sat Mar 19 01:26:03 2011 ++++ pkgtool.pl Sat Mar 19 01:35:07 2011 +@@ -2058,7 +2058,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) { +--- rpm_spec.pm.in.orig Thu Jul 8 20:30:17 2010 ++++ rpm_spec.pm.in Sat Mar 19 00:04:59 2011 +@@ -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)$/) {
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/oi-extras/pkgbuild/patches/pkgbuild-local.diff Thu May 05 18:08:22 2011 +0100 @@ -0,0 +1,27 @@ +--- pkgbuild.pl.in.orig 2010-03-18 00:02:52.000000000 +0100 ++++ pkgbuild.pl.in 2010-03-18 00:07:14.000000000 +0100 +@@ -65,6 +65,8 @@ + $src_ips_server = $ips_server; + } + ++my $pkg_repo = $ENV{PKG_REPO}; ++ + my $mydir = `pwd`; + chomp ($mydir); + my @spec_names = (); +@@ -1822,9 +1824,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");
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/oi-extras/pkgbuild/patches/pkgbuild-postprocess-debug-separate.diff Thu May 05 18:08:22 2011 +0100 @@ -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 + ;;
--- a/oi-extras/pkgbuild/pkgbuild.p5m Thu May 05 18:02:56 2011 +0100 +++ b/oi-extras/pkgbuild/pkgbuild.p5m Thu May 05 18:08:22 2011 +0100 @@ -54,3 +54,5 @@ file path=usr/share/man/man1/pkgtool.1 file path=usr/share/man/man1/spectool.1 file path=usr/share/pkgbuild/spec-files.txt + +depend fmri=compress/xz type=require