Parcourir la source

removed old RPM extensions (now part of "openpkg-tools")

Ralf S. Engelschall il y a 21 ans
Parent
commit
a91e5b50d3
6 fichiers modifiés avec 39 ajouts et 998 suppressions
  1. 1 0
      openpkg/HISTORY
  2. 0 510
      openpkg/mkproxyrpm.pl
  3. 34 49
      openpkg/openpkg.spec
  4. 4 11
      openpkg/rpmpopt
  5. 0 397
      openpkg/rpmx.pl
  6. 0 31
      openpkg/rpmx.sh

+ 1 - 0
openpkg/HISTORY

@@ -2,6 +2,7 @@
 2004
 ====
 
+20040409 removed old RPM extensions (now part of "openpkg-tools")
 20040409 worked-off <prefix>/bin/openpkg frontend in order to provide better tool chain processing
 20040408 fixed internal OPENPKG_TOOLS variable processing in <prefix>/bin/openpkg frontend
 20040408 added workaround to BeeCrypt build to make sure /dev/audio and /dev/dsp are not used

+ 0 - 510
openpkg/mkproxyrpm.pl

@@ -1,510 +0,0 @@
-#!@l_prefix@/lib/openpkg/bash -- # -*- perl -*-
-eval 'exec perl -S $0 ${1+"$@"}'
-    if $running_under_some_shell;
-##
-##  mkproxyrpm -- Make OpenPKG Proxy RPM Package
-##  Copyright (c) 2000-2004 The OpenPKG Project <http://www.openpkg.org/>
-##  Copyright (c) 2000-2004 Ralf S. Engelschall <rse@engelschall.com>
-##  Copyright (c) 2000-2004 Cable & Wireless <http://www.cw.com/>
-##
-##  Permission to use, copy, modify, and distribute this software for
-##  any purpose with or without fee is hereby granted, provided that
-##  the above copyright notice and this permission notice appear in all
-##  copies.
-##
-##  THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
-##  WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-##  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
-##  IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
-##  CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-##  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-##  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
-##  USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-##  ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
-##  OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
-##  OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-##  SUCH DAMAGE.
-##
-
-require 5.003;
-use strict;
-use Getopt::Long;
-use IO;
-
-my $progname = "mkproxyrpm";
-my $progvers = "0.9.3";
-
-#   parameters (defaults)
-my $version = 0;
-my $verbose = 0;
-my $debug   = 0;
-my $help    = 0;
-my $rpm     = 'rpm';
-my $tmpdir  = ($ENV{TMPDIR} || "/tmp") . "/$progname";
-my $output  = '.';
-my $input   = '-';
-my $prefix  = '';
-
-#   cleanup support
-my @cleanup = ();
-sub cleanup_remember {
-    my ($cmd) = @_;
-    push(@cleanup, $cmd);
-}
-sub cleanup_perform {
-    foreach my $cmd (@cleanup) {
-        &runcmd($cmd);
-    }
-}
-
-#   exception handling support
-$SIG{__DIE__} = sub {
-    my ($err) = @_;
-    $err =~ s|\s+at\s+.*||s if (not $verbose);
-    print STDERR "$progname:ERROR: $err ". ($! ? "($!)" : "") . "\n";
-    &cleanup_perform() if (not $verbose);
-    exit(1);
-};
-
-#   verbose message printing
-sub verbose {
-    my ($msg) = @_;
-    print STDERR "$msg\n" if ($verbose);
-}
-
-#   execution of external commands
-sub runcmd {
-    my ($cmd) = @_;
-    print STDERR "\$ $cmd\n" if ($debug);
-    $cmd = "($cmd) >/dev/null 2>&1" if (not $debug);
-    return (system($cmd) == 0);
-}
-
-#   expand into a full filesystem path
-sub fullpath {
-    my ($prog) = @_;
-    my $fullprog = '';
-    foreach my $path (split(/:/, $ENV{PATH})) {
-        if (-x "$path/$prog") {
-            $fullprog = "$path/$prog";
-            last;
-        }
-    }
-    return $fullprog;
-}
-
-#   convert a subdirectory (a/b/c/)
-#   into a corresponding reverse path (../../../)
-sub sub2rev {
-    my ($sub) = @_;
-    my $rev = '';
-    $sub =~ s|^/+||s;
-    $sub =~ s|/+$||s;
-    while ($sub =~ s|/[^/]+||) {
-        $rev .= "../";
-    }
-    if ($sub ne '') {
-        $rev .= "../";
-    }
-    $rev =~ s|/$||s;
-    return $rev;
-}
-
-#   create a directory (plus its missing parent dirs)
-sub mkdirp {
-    my ($dir) = @_;
-    my $pdir = $dir;
-    $pdir =~ s|/[^/]*$||s;
-    if (not -d $pdir) {
-        &mkdirp($pdir);
-    }
-    if (not -d $dir) {
-        &runcmd("mkdir $dir");
-    }
-}
-
-#   command line parsing
-Getopt::Long::Configure("bundling");
-my $result = GetOptions(
-    'V|version'     => \$version,
-    'h|help'        => \$help,
-    'd|debug'       => \$debug,
-    'v|verbose'     => \$verbose,
-    'r|rpm=s'       => \$rpm,
-    't|tmpdir=s'    => \$tmpdir,
-    'o|output=s'    => \$output,
-    'p|prefix=s'    => \$prefix
-) || die "option parsing failed";
-if ($help) {
-    print "Usage: $progname [options] [FILE]\n" .
-          "Available options:\n" .
-          " -h,--help          print out this usage page\n" .
-          " -v,--verbose       enable verbose run-time mode\n" .
-          " -r,--rpm=FILE      filesystem path to RPM program\n" .
-          " -t,--tmpdir=PATH   filesystem path to temporary directory\n" .
-          " -o,--output=FILE   filesystem path to output RPM file\n";
-          " -p,--prefix=PATH   filesystem path to referenced master hierarchy\n";
-    exit(0);
-}
-if ($version) {
-    print "OpenPKG $progname $progvers\n";
-    exit(0);
-}
-if ($#ARGV == 0) {
-    $input = shift(@ARGV);
-}
-if ($#ARGV != -1) {
-    die "invalid number of command line arguments";
-}
-
-#   prepare temporary location
-&verbose("++ prepare temporary directory");
-if (not -d $tmpdir) {
-    &runcmd("mkdir $tmpdir && chmod 0700 $tmpdir")
-        || die "cannot create temporary directory '$tmpdir'";
-    &cleanup_remember("rmdir $tmpdir");
-}
-&verbose("-- $tmpdir");
-
-#   determine RPM program
-if (not -x $rpm) {
-    $rpm = &fullpath($rpm);
-}
-my $rpmvers = `$rpm --version 2>/dev/null`;
-$rpmvers =~ s|^OpenPKG\s+RPM\s+([0-9.]+)\s*$|$1|s || die "program '$rpm' seems to be not RPM";
-&verbose("++ determining RPM program");
-&verbose("-- $rpm ($rpmvers)");
-
-#   determine input and output RPM
-&verbose("++ determining RPM package files");
-&verbose("-- input/original RPM: $input");
-&verbose("-- output/proxy RPM: $output");
-if ($input eq '-') {
-    $input = "$tmpdir/input.rpm";
-    &runcmd("cat >$input");
-}
-if (not -f $input) {
-    die "input RPM does not exist: '$input'";
-}
-
-#   helper function for parsing the query outputs
-sub parseresponse {
-    my ($r, $o) = @_;
-    $o =~ s|([SM])-([^:]+):<(.*?)>\n|&parseline($r, $1, $2, $3, '')|egs;
-    sub parseline {
-        my ($r, $t, $k, $v) = @_;
-        $v =~ s|^\s+||s;
-        $v =~ s|\s+$||s;
-        if ($t eq 'S') {     # single-value results
-            $r->{$k} = $v;
-        }
-        elsif ($t eq 'M') {  # multi-value results
-            $r->{$k} = [] if (not defined($r->{$k}));
-            push(@{$r->{$k}}, $v);
-        }
-    }
-    return $r;
-}
-
-#   query input RPM package
-&verbose("++ query information from input RPM");
-my $q = '';
-foreach my $t (qw(
-    NAME SUMMARY URL VENDOR PACKAGER DISTRIBUTION GROUP LICENSE VERSION RELEASE
-    DESCRIPTION
-)) {
-    $q .= "S-$t:<%{$t}>\n";
-}
-$q .= "[M-PREREQ:<%{REQUIRENAME} %|REQUIREFLAGS?{%{REQUIREFLAGS:depflags} %{REQUIREVERSION}}:{}|>\n]";
-$q .= "[M-PREFIXES:<%{PREFIXES}>\n]";
-my $o = `$rpm -qp --qf "$q" $input`;
-$o =~ s|M-PREREQ:<rpmlib\(.*?\).*?>\n||gs;
-my $r = {};
-$r = &parseresponse($r, $o);
-my $BD = '';
-my $ID = '';
-foreach my $d (@{$r->{PREREQ}}) {
-    if ($d =~ m|^OpenPKG|i) {
-        $BD .= ", " if ($BD ne '');
-        $BD .= $d;
-    }
-    $ID .= ", " if ($ID ne '');
-    $ID .= $d;
-}
-my $rprefix = ${$r->{PREFIXES}}[0];
-$rprefix =~ s|/+$||s;
-&verbose("-- remote OpenPKG prefix: $rprefix");
-&verbose("++ query information from target OpenPKG");
-$q = '';
-foreach my $t (qw(
-    l_prefix
-)) {
-    $q .= "S-$t:<%{$t}>\n";
-}
-$o = `$rpm --eval "$q"`;
-$r = &parseresponse($r, $o);
-my $lprefix = $r->{l_prefix};
-$lprefix =~ s|/+$||s;
-&verbose("-- local OpenPKG prefix: $lprefix");
-
-#   prepare build environment
-&verbose("++ establishing temporary RPM environment");
-&runcmd("rm -rf $tmpdir/src; mkdir $tmpdir/src");
-&runcmd("rm -rf $tmpdir/tmp; mkdir $tmpdir/tmp");
-&runcmd("rm -rf $tmpdir/bld; mkdir $tmpdir/bld");
-&runcmd("rm -rf $tmpdir/pkg; mkdir $tmpdir/pkg");
-&cleanup_remember("rm -rf $tmpdir/src");
-&cleanup_remember("rm -rf $tmpdir/tmp");
-&cleanup_remember("rm -rf $tmpdir/bld");
-&cleanup_remember("rm -rf $tmpdir/pkg");
-my $macro = new IO::File (">$tmpdir/.rpmmacros");
-$macro->print("%_sourcedir $tmpdir/src\n" .
-              "%_specdir   $tmpdir/src\n" .
-              "%_builddir  $tmpdir/tmp\n" .
-              "%_tmppath   $tmpdir/tmp\n" .
-              "%_rpmdir    $tmpdir/pkg\n" .
-              "%_srcrpmdir $tmpdir/pkg\n");
-$macro->close;
-$ENV{HOME} = $tmpdir;
-&verbose("-- temporary sourcedir/specdir: $tmpdir/src");
-&verbose("-- temporary builddir/tmppath:  $tmpdir/tmp");
-&verbose("-- temporary rpmdir/srcrpmdir:  $tmpdir/pkg");
-
-#   generate .spec file for proxy RPM package
-&verbose("++ generating RPM specification for proxy RPM");
-my $S = '';
-$S .= "Name:         ".$r->{NAME}."\n";
-$S .= "Summary:      ".$r->{SUMMARY}."\n";
-$S .= "URL:          ".$r->{URL}."\n";
-$S .= "Vendor:       ".$r->{VENDOR}."\n";
-$S .= "Packager:     ".$r->{PACKAGER}."\n";
-$S .= "Distribution: ".$r->{DISTRIBUTION}."\n";
-$S .= "Group:        ".$r->{GROUP}."\n";
-$S .= "License:      ".$r->{LICENSE}."\n";
-$S .= "Version:      ".$r->{VERSION}."\n";
-$S .= "Release:      ".$r->{RELEASE}."+PROXY\n";
-$S .= "\n";
-$S .= "Prefix:       %{l_prefix}\n";
-$S .= "BuildRoot:    $tmpdir/bld\n";
-$S .= "BuildPreReq:  $BD\n";
-$S .= "PreReq:       $ID\n";
-$S .= "AutoReq:      no\n";
-$S .= "AutoReqProv:  no\n";
-#$S .= "Provides:     ".$r->{NAME}.", ".$r->{NAME}."-".$r->{VERSION}."-".$r->{RELEASE}."\n";
-$S .= "\n";
-$S .= "%description\n";
-$S .= "    ".$r->{DESCRIPTION}."\n";
-$S .= "\n";
-$S .= "%install\n";
-$S .= "    %{l_rpmtool} files -v -ofiles -r\$RPM_BUILD_ROOT %{l_files_std}\n";
-$S .= "\n";
-$S .= "%files -f files\n";
-$S .= "\n";
-my $spec = new IO::File (">$tmpdir/src/".$r->{NAME}.".spec");
-$spec->print($S);
-$spec->close;
-&verbose("-- $tmpdir/src/".$r->{NAME}.".spec");
-
-#   creating shadow tree of original contents
-&verbose("++ creating shadow tree from original contents");
-my @FL = `$rpm -qp --qf '[%{FILEMODES:perms} %{FILENAMES}\n]' $input`;
-my $FD = [];
-my $FR = [];
-foreach my $fl (@FL) {
-    $fl =~ s|\n$||s;
-    if ($fl =~ m|^(d\S+)\s+$rprefix(.*)$|) {
-        &mkdirp("$tmpdir/bld$lprefix$2");
-        &verbose("-- | PHYS $1 $lprefix$2");
-    }
-    elsif ($fl =~ m|^(\S+)\s+$rprefix(.*?)([^/\s]+)$|) {
-        my ($subdir, $file) = ($2, $3);
-        my $target = sub2rev($subdir)."/.prefix-".$r->{NAME}.$subdir.$file;
-        &mkdirp("$tmpdir/bld$lprefix$subdir");
-        &runcmd("ln -s $target $tmpdir/bld$lprefix$subdir$file");
-        &verbose("-- | VIRT $1 $lprefix$subdir$file");
-    }
-}
-
-#   create master-reference symbolic link
-my $xprefix = $rprefix;
-$xprefix = $prefix if ($prefix ne '');
-&runcmd("ln -s $xprefix $tmpdir/bld$lprefix/.prefix-".$r->{NAME});
-
-#   rolling output proxy RPM package
-&verbose("++ rolling output proxy RPM package");
-&runcmd("cd $tmpdir/src && $rpm -bb --nodeps ".$r->{NAME}.".spec");
-
-#   providing output
-&verbose("++ providing output");
-if ($output eq '-') {
-    &runcmd("cat $tmpdir/pkg/*.rpm");
-}
-else {
-    &runcmd("cp $tmpdir/pkg/*.rpm $output");
-}
-
-#   die gracefully...
-&verbose("++ cleaning up environment");
-&cleanup_perform();
-exit(0);
-
-__END__
-
-=pod
-
-=head1 NAME
-
-B<mkproxyrpm> -- Make OpenPKG Proxy RPM Package
-
-=head1 SYNOPSIS
-
-B<mkproxyrpm>
-[B<--verbose>]
-[B<--debug>]
-[B<--help>]
-[B<--rpm>=I<FILE>]
-[B<--tmpdir>=I<DIR>]
-[B<--output>=I<DIR>|I<FILE>|C<->]
-[B<--prefix>=I<RPREFIX>]
-[I<FILE>|C<->]
-
-=head1 DESCRIPTION
-
-B<mkproxyrpm> creates an B<OpenPKG> proxy package by translating a
-binary RPM file into a proxy binary RPM file. A proxy package contains
-(virtually) the same contents as the original package in the form
-of a shadow tree. Such a shadow tree consists of the same physical
-directories as the original tree but with all other files replaced by
-symbolic links pointing to the original files in the remote B<OpenPKG>
-instance.
-
-A proxy package is useful if multiple B<OpenPKG> instances are installed on
-the same system. In this case lots of dependent (and this way required,
-although not explicitly wanted) packages have to be installed in every
-instance. Think about packages like B<openssl>, B<perl>, B<gcc>, etc. This can
-be both very time-consuming and can become a maintainance nightmare.
-Instead, you can select a master (or remote) B<OpenPKG> instance,
-install those packages physically there only and install a simple proxy
-packages for them in all other (local) B<OpenPKG> instances.
-
-Keep in mind that this obviously works correctly for packages which do not
-have hard-coded dependencies to their B<OpenPKG> instance (like configuration
-files, etc.). For other packages it might also work, but be at least warned
-about side-effects. Additionally, make sure you always keep (local) proxy
-packages in sync with the (remote) master package.
-
-=head1 SHADOW TREE
-
-The symbolic links in the shadow tree of the proxy package B<foo> are of
-the form:
-
-I<lprefix>[/I<dir>]/I<file> -> I<revdir>C</.prefix->B<foo>[/I<dir>]/I<file>
-
-And to make them working, there is the following additional symbolic
-link installed:
-
-I<lprefix>C</.prefix->B<foo> -> I<rprefix>
-
-Here I<lprefix> is the prefix of the local B<OpenPKG> instance and
-I<rprefix> is the prefix of the remote B<OpenPKG> instance. This allows
-one to redirect a whole package to a different B<OpenPKG> instance by
-just changing the I<lprefix>C</.prefix->B<foo> symbolic link. The idea
-is that later this link even could be automatically controlled by a
-higher-level facility. The I<rprefix> target of the symbolic link can be
-overridden at build-time with the B<--prefix>=I<RPREFIX> option.
-
-=head1 OPTIONS
-
-The following command line options and arguments are supported:
-
-=over 4
-
-=item B<--verbose>
-
-Enable verbose messages on F<stderr> summarizing the internal processing.
-
-=item B<--debug>
-
-Enable debugging messages on F<stderr> showing the executed shell commands.
-
-=item B<--help>
-
-Print the usage message and immediately exit.
-
-=item B<--rpm>=I<FILE>
-
-Set a particular B<RPM> program to use. The default is the program
-"C<rpm>" in C<$PATH>. This has to be the C<rpm> of the target B<OpenPKG>
-instance where the proxy package will be installed later.
-
-=item B<--tmpdir>=I<DIR>
-
-Set a particular temporary directory. The default is determined from
-C<$TMPDIR>, or C</tmp> (in that order).
-
-=item B<--output>=I<DIR>|I<FILE>|C<->
-
-Set the location where to write the output
-proxy RPM package. If the input RPM is named
-"I<name>C<->I<version>C<->I<release>C<.>I<arch>C<->I<os>C<->I<id1>C<.rpm
->" the output RPM is named
-"I<name>C<->I<version>C<->I<release>C<+PROXY>C<.>I<arch>C<->I<os>C<->I<i
-d2>C<.rpm>" (I<id1> is the identification of the master B<OpenPKG>
-instance, I<id2> is the identification of the B<OpenPKG> instance for
-which the proxy package is built). The special argument "C<->" indicates
-that the output RPM is written to F<stdout>. The default is "C<.>" (the
-current working directory).
-
-=item I<FILE>|C<->
-
-Set the location where to read the input RPM package. The special
-argument "C<->" indicates that the input RPM is read from F<stdin> (the
-default).
-
-=back
-
-=head1 EXAMPLE
-
-Assume you have three B<OpenPKG> instances on a system: C</usr/opkg>
-(the master instance), C</e/foo/sw> (a project instance), and C</e/bar/sw>
-(another project instance). Now let us install the C<bash> package in
-all three locations, but only once physically.
-
- # build and install binary RPM for /usr/opkg instance
- $ /usr/opkg/bin/rpm --rebuild \
-   ftp://ftp.openpkg.org/release/1.0/SRC/bash-2.05a-1.0.0.src.rpm
- $ /usr/opkg/bin/rpm -Uvh \
-   /usr/opkg/RPM/PKG/bash-2.05a-1.0.0.*.rpm
-
- # build and install proxy RPM for /e/foo/sw instance
- $ mkproxyrpm --rpm=/e/foo/sw/bin/rpm --output=/e/foo/RPM/PKG/ \
-   /usr/opkg/RPM/PKG/bash-2.05a-1.0.0.*.rpm
- $ /e/foo/sw/bin/rpm -Uvh \
-   /e/foo/RPM/PKG/bash-2.05a-1.0.0+PROXY.*.rpm
-
- # build and install proxy RPM for /e/bar/sw instance
- $ mkproxyrpm --rpm=/e/bar/sw/bin/rpm --output=/e/bar/RPM/PKG/ \
-   /usr/opkg/RPM/PKG/bash-2.05a-1.0.0.*.rpm
- $ /e/bar/sw/bin/rpm -Uvh \
-   /e/bar/RPM/PKG/bash-2.05a-1.0.0+PROXY.*.rpm
-
-=head1 SEE ALSO
-
-B<OpenPKG> http://www.openpkg.org/,
-rpm(3), ln(1).
-
-=head1 HISTORY
-
-B<mkproxyrpm> was developed in February 2002 by Ralf S.
-Engelschall E<lt>rse@engelschall.comE<gt> for the B<OpenPKG>
-project after an idea for virtual packages by Thomas Lotterer
-E<lt>thomas.lotterer@cw.comE<gt>.
-
-=head1 AUTHOR
-
- Ralf S. Engelschall
- rse@engelschall.com
- www.engelschall.com
-
-=cut
-

+ 34 - 49
openpkg/openpkg.spec

@@ -97,43 +97,40 @@ Source25:     lsync
 Source26:     lsync.8
 Source27:     lsync.pod
 Source28:     make.patch
-Source29:     mkproxyrpm.pl
-Source30:     openpkg.boot
-Source31:     openpkg.pgp
-Source32:     pod2man.sh
-Source33:     rc
-Source34:     rc.8
-Source35:     rc.conf
-Source36:     rc.func
-Source37:     rc.openpkg
-Source38:     rc.pod
-Source39:     root.README
-Source40:     rpm-config.8
-Source41:     rpm-config.pod
-Source42:     rpm-config.sh
-Source43:     rpm.patch.bugfix
-Source44:     rpm.patch.feature
-Source45:     rpm.patch.porting
-Source46:     rpm.patch.regen
-Source47:     rpmdb
-Source48:     rpmmacros
-Source49:     rpmpopt
-Source50:     rpmrc
-Source51:     rpmtool
-Source52:     rpmtool.8
-Source53:     rpmtool.pod
-Source54:     rpmx.pl
-Source55:     rpmx.sh
-Source56:     shtool
-Source57:     uuid.sh
-Source58:     openpkg.sh
-Source59:     openpkg.pod
-Source60:     openpkg.1
-Source61:     install.sh
-Source62:     man.sh
-Source63:     uuid.pod
-Source64:     uuid.8
-Source65:     tar.patch
+Source29:     install.sh
+Source30:     man.sh
+Source31:     openpkg.1
+Source32:     openpkg.boot
+Source33:     openpkg.pgp
+Source34:     openpkg.pod
+Source35:     openpkg.sh
+Source36:     pod2man.sh
+Source37:     rc
+Source38:     rc.8
+Source39:     rc.conf
+Source40:     rc.func
+Source41:     rc.openpkg
+Source42:     rc.pod
+Source43:     root.README
+Source44:     rpm-config.8
+Source45:     rpm-config.pod
+Source46:     rpm-config.sh
+Source47:     rpm.patch.bugfix
+Source48:     rpm.patch.feature
+Source49:     rpm.patch.porting
+Source50:     rpm.patch.regen
+Source51:     rpmdb
+Source52:     rpmmacros
+Source53:     rpmpopt
+Source54:     rpmrc
+Source55:     rpmtool
+Source56:     rpmtool.8
+Source57:     rpmtool.pod
+Source58:     shtool
+Source59:     tar.patch
+Source60:     uuid.8
+Source61:     uuid.pod
+Source62:     uuid.sh
 
 #   build information
 Prefix:       %{l_prefix}
@@ -959,15 +956,6 @@ Provides:     openpkg = 2.0.1-2.0.1
         -e "s;@l_mgrp@;%{l_mgrp};g" \
         <`SOURCE rpmdb` >$RPM_BUILD_ROOT%{l_prefix}/lib/openpkg/rpmdb
     chmod a+x $RPM_BUILD_ROOT%{l_prefix}/lib/openpkg/rpmdb
-    sed -e "s;@l_prefix@;%{l_prefix};g" \
-        <`SOURCE rpmx.sh` >$RPM_BUILD_ROOT%{l_prefix}/lib/openpkg/rpmx.sh
-    chmod a+x $RPM_BUILD_ROOT%{l_prefix}/lib/openpkg/rpmx.sh
-    sed -e "s;@l_prefix@;%{l_prefix};g" \
-        <`SOURCE rpmx.pl` >$RPM_BUILD_ROOT%{l_prefix}/lib/openpkg/rpmx.pl
-    chmod a+x $RPM_BUILD_ROOT%{l_prefix}/lib/openpkg/rpmx.pl
-    sed -e "s;@l_prefix@;%{l_prefix};g" \
-        <`SOURCE mkproxyrpm.pl` >$RPM_BUILD_ROOT%{l_prefix}/lib/openpkg/mkproxyrpm.pl
-    chmod a+x $RPM_BUILD_ROOT%{l_prefix}/lib/openpkg/mkproxyrpm.pl
     sed -e "s:@l_prefix@:%{l_prefix}:g" \
         <`SOURCE rpmtool` >$RPM_BUILD_ROOT%{l_prefix}/lib/openpkg/rpmtool
     chmod a+x $RPM_BUILD_ROOT%{l_prefix}/lib/openpkg/rpmtool
@@ -1160,7 +1148,6 @@ Provides:     openpkg = 2.0.1-2.0.1
     %{l_prefix}/lib/openpkg/magic.mgc
     %{l_prefix}/lib/openpkg/magic.mime
     %{l_prefix}/lib/openpkg/magic.mime.mgc
-    %{l_prefix}/lib/openpkg/mkproxyrpm.pl
     %{l_prefix}/lib/openpkg/patch
     %{l_prefix}/lib/openpkg/rc
     %{l_prefix}/lib/openpkg/rpmb
@@ -1178,8 +1165,6 @@ Provides:     openpkg = 2.0.1-2.0.1
     %{l_prefix}/lib/openpkg/rpmtool
     %{l_prefix}/lib/openpkg/rpmu
     %{l_prefix}/lib/openpkg/rpmv
-    %{l_prefix}/lib/openpkg/rpmx.pl
-    %{l_prefix}/lib/openpkg/rpmx.sh
     %{l_prefix}/lib/openpkg/shtool
     %{l_prefix}/lib/openpkg/tar
     %{l_prefix}/lib/openpkg/librpm.a

+ 4 - 11
openpkg/rpmpopt

@@ -26,17 +26,10 @@
 ##  OpenPKG specific extensions and adjustments.
 ##
 
-#   RPM extensions: "rpm --stowaway"
-rpm exec --stowaway rpmx.sh --stowaway \
-    --POPTdesc=$"show files not covered by RPM database"
-
-#   RPM extensions: "rpm --makeproxy"
-rpm exec --makeproxy rpmx.sh --makeproxy \
-    --POPTdesc=$"build proxy binary RPM from foreign binary RPM"
-
-#   RPM extensions: "rpm --stowaway"
-rpm exec --fetch rpmx.sh --fetch \
-    --POPTdesc=$"fetch all Source/Patch files of a package"
+#   backward compatibility for old RPM extensions
+rpm exec --stowaway  echo "install \"openpkg-tools\" and use \"openpkg stowaway\" now please."
+rpm exec --makeproxy echo "install \"openpkg-tools\" and use \"openpkg makeproxy\" now please."
+rpm exec --fetch     echo "install \"openpkg-tools\" and use \"openpkg fetch\" now please."
 
 #   RPM exentsion: "rpm -bs --[no]restriction"
 rpm alias --restriction   --define "restriction yes" \

+ 0 - 397
openpkg/rpmx.pl

@@ -1,397 +0,0 @@
-##
-##  rpmx -- RPM eXtension (Perl program)
-##  Copyright (c) 2000-2004 The OpenPKG Project <http://www.openpkg.org/>
-##  Copyright (c) 2000-2004 Ralf S. Engelschall <rse@engelschall.com>
-##  Copyright (c) 2000-2004 Cable & Wireless <http://www.cw.com/>
-##
-##  list all files in the hierarchy which are not listed in RPM database
-##  $ rpm --stowaway
-##
-##  update the package sources by downloading missing files
-##  $ rpm --fetch <spec-file>
-##
-##  make a proxy package
-##  $ rpm --makeproxy <binary-rpm>
-##
-
-require 5.000;
-
-use IO::File;
-use IO::Handle;
-use Data::Dumper;
-
-$|++;
-
-##  ______________________________________________________________________
-##
-##  Determine Configuration and Run-Time Information
-##  ______________________________________________________________________
-##
-
-my $CFG = {
-    'PRG' => {},
-    'RC' => {},
-    'OPT' => [],
-    'OPT_OPT' => {},
-    'OPT_ARG' => {},
-    'ARG' => [],
-};
-
-#   determine path to executables
-my $prefix = shift(@ARGV);
-$CFG->{PRG}->{"rpm"}   = $prefix."/libexec/openpkg/rpm";
-$CFG->{PRG}->{"curl"}  = $prefix."/lib/openpkg/curl";
-$CFG->{PRG}->{"bzip2"} = $prefix."/lib/openpkg/bzip2";
-$CFG->{PRG}->{"gzip"}  = $prefix."/lib/openpkg/gzip";
-
-#   determine a few RPM rc-file configuration variables
-my $var;
-my $vars = '';
-foreach $var (qw(
-    _dbpath _rpmdir _srcrpmdir _tmppath
-    _target
-    l_prefix
-    l_fetch_mirror_0 l_fetch_mirror_1 l_fetch_mirror_2 l_fetch_mirror_3 l_fetch_mirror_4
-    l_fetch_mirror_5 l_fetch_mirror_6 l_fetch_mirror_7 l_fetch_mirror_8 l_fetch_mirror_9
-    l_fetch_backup_0 l_fetch_backup_1 l_fetch_backup_2 l_fetch_backup_3 l_fetch_backup_4
-    l_fetch_backup_5 l_fetch_backup_6 l_fetch_backup_7 l_fetch_backup_8 l_fetch_backup_9
-    _httpproxy _httpport
-    _ftpproxy _ftpport
-)) {
-    $vars .= "${var}=\%{${var}};";
-}
-my @assign = split(/;/, `$CFG->{PRG}->{"rpm"} --eval '$vars'`);
-foreach $assign (@assign) {
-    if ($assign =~ m|^(\S+)=(.*)$|s) {
-	if ($2 ne '%{'.$1.'}') {
-        	$CFG->{RC}->{$1} = $2;
-	}
-    }
-}
-
-#   parse argument line
-#foreach my $arg (@ARGV) {
-#    print "<$arg>";
-#}
-#print "\n";
-my $op = 'pass';
-my $isopt = 1;
-my $isdef = 0;
-my $optname = '';
-my $arg;
-foreach $arg (@ARGV) {
-    if ($isdef) {
-	if ($arg =~ /^(\S+)\s*(.+)/) {
-		$CFG->{RC}->{$1} = $2;
-	} else {
-        	print STDERR "rpm: invalid macro definition '$arg'\n";
-	}
-	$isdef = 0;
-	next;
-    }
-    if ($arg =~ m/^--(stowaway|fetch|makeproxy)$/) {
-        $op = $1;
-        next;
-    }
-    if ($arg eq '--define') {
-	$isdef = 1;
-	next;
-    }
-    if ($arg eq '--') {
-        $isopt = 0;
-        next;
-    }
-    if ($isopt) {
-        push(@{$CFG->{OPT}}, $arg);
-        if ($arg =~ m|^-.|) {
-            $optname = $arg;
-            $CFG->{OPT_OPT}->{$optname} = 1;
-            $CFG->{OPT_ARG}->{$optname} = '--';
-        }
-        else {
-            $CFG->{OPT_ARG}->{$optname} = $arg;
-        }
-    }
-    else {
-        push(@{$CFG->{ARG}}, $arg);
-    }
-}
-#print Data::Dumper->Dump([$CFG]);
-if ($op eq 'pass') {
-    # exec $CFG->{PRG}->{"rpm"} (@{$CFG->{OPT}}, @{$CFG->{ARG}});
-}
-else {
-    my $rc;
-    #eval "\$rc = \&op_${op}(\$CFG);";
-    if ($op eq 'stowaway') {
-        $rc = &op_stowaway($CFG);
-    }
-    elsif ($op eq 'fetch') {
-        $rc = &op_fetch($CFG);
-    }
-    elsif ($op eq 'makeproxy') {
-        $rc = &op_makeproxy($CFG);
-    }
-    exit($rc);
-}
-
-##  ______________________________________________________________________
-##
-##  Fetch an URL
-##  ______________________________________________________________________
-##
-
-sub fetch_url {
-    my ($CFG, $src, $dst) = @_;
-
-    #   make sure file URLs have a fully-qualified scheme.
-    if ($src =~ m|^/.+|) {
-        $src = "file://$src"
-    }
-
-    #   make sure only schemes curl(1) supports are used.
-    if ($src !~ m;^(file|http|ftp)://.+;) {
-        return "invalid URL - only file, http and ftp schemes supported";
-    }
-
-    {
-	my($hpxy) = $CFG->{RC}->{"_httpproxy"};
-	my($hprt) = $CFG->{RC}->{"_httpport"};
-	my($fpxy) = $CFG->{RC}->{"_ftpproxy"};
-	my($fprt) = $CFG->{RC}->{"_ftpport"};
-
-	$hprt = 80 unless $hprt > 0;
-	$fprt = 21 unless $fprt > 0;
-
-	if (defined $hpxy && defined $hprt) {
-		$hpxy .= ":$hprt";
-	}
-	if (defined $fpxy && defined $fprt) {
-		$fpxy .= ":$fprt";
-	}
-
-	local($ENV{'http_proxy'}) = $hpxy;
-	local($ENV{'ftp_proxy'}) = $fpxy;
-
-	#   try to fetch the URL
-	unlink("$dst.hdr");
-	$rc = system($CFG->{PRG}->{"curl"} .
-	             " --location" .
-	             " --max-time 1800" .
-	             " --connect-timeout 20" .
-	             " --dump-header $dst.hdr" .
-	             " --output '$dst' '$src'");
-
-    }
-
-    #   check whether command failed
-    if ($rc != 0) {
-        return "cURL error";
-    }
-
-    #   check whether remote sites failed
-    if (-s "$dst.hdr") {
-        open(FP, "<$dst.hdr");
-        my $response = <FP>;
-        close(FP);
-        if ($response =~ m|^HTTP/[\d.]+\s+(\d+)|) {
-            if ($1 ne 200) {
-                $response =~ s|\n$||;
-                unlink($dst);
-                return $response;
-            }
-        }
-    }
-
-    #   cleanup
-    unlink("$dst.hdr");
-
-    return '';
-}
-
-##  ______________________________________________________________________
-##
-##  List all files which are not known to RPM
-##  ______________________________________________________________________
-##
-
-sub op_stowaway {
-    my ($CFG) = @_;
-    my $file;
-
-    my $prefix = $CFG->{RC}->{"l_prefix"};
-    my $rpm = $CFG->{PRG}->{"rpm"};
-    print "OpenPKG Hierarchy $prefix\n";
-    my @known = `$rpm -qla`;
-    my %known = ();
-    foreach $file (@known) {
-        $file =~ s|\n$||s;
-        $known{$file} = 1;
-    }
-    my @exist = `cd $prefix && find . -print 2>/dev/null`;
-    foreach $file (sort(@exist)) {
-        $file =~ s|^\./|$prefix/|s;
-        $file =~ s|\n$||s;
-        next if ($file eq '.');
-        if (not $known{$file}) {
-            next if ($file =~ m|^$prefix/RPM/?|);
-            print "$file\n";
-        }
-    }
-    return 0;
-}
-
-##  ______________________________________________________________________
-##
-##  Fetch Operation
-##  ______________________________________________________________________
-##
-
-sub op_fetch {
-    my ($CFG) = @_;
-
-    if ($#{$CFG->{ARG}} ne 0) {
-        print STDERR "rpm: option --fetch requires an argument\n";
-        return 1;
-    }
-    my $spec = $CFG->{ARG}->[0];
-    if (not -f $spec) {
-        print STDERR "rpm: spec file `$spec' not found\n";
-        return 1;
-    }
-
-    #   determine package name and source directory
-    my $name = $spec;
-    $name =~ s|\.[^.]+$||;
-    $name =~ s|^.+/([^/]+)$|$1|;
-    my $local_srcdir = `$CFG->{PRG}->{"rpm"} --define 'name $name' --eval '%_sourcedir'`;
-    $local_srcdir =~ s|\n+$||s;
-    my $local_specdir = `$CFG->{PRG}->{"rpm"} --define 'name $name' --eval '%_specdir'`;
-    $local_specdir =~ s|\n+$||s;
-
-    #   make sure source and spec directory actually exists
-    if (not -d $local_srcdir) {
-        print(STDERR "rpm: Creating directory $local_srcdir\n");
-        system("mkdir $local_srcdir");
-    }
-    if (not -d $local_specdir) {
-        print(STDERR "rpm: Creating directory $local_specdir\n");
-        system("mkdir $local_specdir");
-    }
-
-    #   parse spec file
-    my $DEF = {};
-    my $SRC = {};
-    open(SPEC, "<$spec");
-    while (<SPEC>) {
-        s|\n+$||s;
-        if (m/^([a-zA-Z_][a-zA-Z0-9_]*):\s*(.+?)\s*$/) {
-            $DEF->{lc($1)} = $2;
-        }
-        if (m/^%define\s+([a-zA-Z_][a-zA-Z0-9_]*)\s+(.+?)\s*$/) {
-            $DEF->{lc($1)} = $2;
-        }
-        if (m/^((Source|Patch)[0-9]+?):\s*(.+?)\s*$/i) {
-            my ($remote_srcid, $remote_srcurl) = ($1, $3);
-
-            #   determine expanded remote source location
-            1 while ($remote_srcurl =~ s|%{?([a-zA-Z_][a-zA-Z0-9_]*)}?|$DEF->{lc($1)}|sge);
-            my $remote_srcdir  = '';
-            my $remote_srcfile = $remote_srcurl;
-            if ($remote_srcfile =~ m|^(.+)/([^/]+)$|) {
-                $remote_srcdir  = $1;
-                $remote_srcfile = $2;
-            }
-
-            #   display remote source location
-            my $file = $remote_srcfile;
-            $file = substr($file, 0, 40) if (length($file) > 40);
-            printf(STDERR "%-9s %-40s ", "$remote_srcid:", $file);
-
-            if (-f "$local_srcdir/$remote_srcfile" or -f "$local_specdir/$remote_srcfile") {
-                #   source already on local filesystem
-                my $size;
-                if (-f "$local_srcdir/$remote_srcfile") {
-                    $size = (stat("$local_srcdir/$remote_srcfile"))[7];
-                }
-                else {
-                    $size = (stat("$local_specdir/$remote_srcfile"))[7];
-                }
-                if ($size > 1024*1024) {
-                    $size = sprintf("%.1fMB", $size / (1024*1024));
-                }
-                elsif ($size > 1024) {
-                    $size = sprintf("%.0fKB", $size / 1024);
-                }
-                else {
-                    $size = sprintf("%d", $size);
-                }
-                print STDERR "...OK [$size]\n";
-            }
-            else {
-                #   fetch source onto local filesystem
-                print STDERR "...MISSING\n";
-
-                #   determine prioritized list of possible source locations
-                my @fetch_srcdir = ();
-                for ($i = 0; $i <= 9; $i++) {
-                    my $url = $CFG->{RC}->{"l_fetch_mirror_$i"};
-                    next if (not defined($url) or $url eq '' or $url eq '-');
-                    1 while ($url =~ s|%{?([a-zA-Z_][a-zA-Z0-9_]*)}?|$DEF->{lc($1)}|sge);
-                    push(@fetch_srcdir, $url);
-                }
-                push(@fetch_srcdir, $remote_srcdir);
-                for ($i = 0; $i <= 9; $i++) {
-                    my $url = $CFG->{RC}->{"l_fetch_backup_$i"};
-                    next if (not defined($url) or $url eq '' or $url eq '-');
-                    1 while ($url =~ s|%{?([a-zA-Z_][a-zA-Z0-9_]*)}?|$DEF->{lc($1)}|sge);
-                    push(@fetch_srcdir, $url);
-                }
-
-                #   try to fetch from all possible locations
-                foreach $fetch_srcdir (@fetch_srcdir) {
-                    $fetch_srcdir =~ s|/+$||s;
-                    print STDERR "rpm: Fetching from $fetch_srcdir/\n";
-                    if (($err = &fetch_url($CFG, "$fetch_srcdir/$remote_srcfile", "$local_srcdir/$remote_srcfile"))) {
-                        $err = substr($err, 0, 37)."..." if (length($err) > 40);
-                        print STDOUT "rpm: Error: $err\n";
-                        next;
-                    }
-                    last;
-                }
-                if (not -f "$local_srcdir/$remote_srcfile") {
-                    print STDERR "rpm: Failed to fetch source file `$remote_srcfile'\n";
-                    return 1;
-                }
-            }
-        }
-    }
-    close(SPEC);
-
-    return 0;
-}
-
-##  ______________________________________________________________________
-##
-##  Make Proxy Operation
-##  ______________________________________________________________________
-##
-
-sub op_makeproxy {
-    my ($CFG) = @_;
-
-    if ($#{$CFG->{ARG}} != 0) {
-        print STDERR "rpm: option --makeproxy requires exactly one argument\n";
-        return 1;
-    }
-    my $perl    = $^X;
-    my $prefix  = $CFG->{RC}->{"l_prefix"};
-    my $rpm     = $CFG->{PRG}->{"rpm"};
-    my $tmpdir  = $CFG->{RC}->{"_tmppath"};
-    my @args = @{$CFG->{ARG}};
-    if ($CFG->{OPT_ARG}->{"--prefix"} ne '') {
-        unshift(@args, "--prefix=".$CFG->{OPT_ARG}->{"--prefix"});
-    }
-    exec $perl, "$prefix/lib/openpkg/mkproxyrpm.pl", "--rpm=$rpm", "--tmpdir=$tmpdir", @args;
-}
-

+ 0 - 31
openpkg/rpmx.sh

@@ -1,31 +0,0 @@
-#!@l_prefix@/lib/openpkg/bash
-##
-##  rpmx.sh -- RPM eXtension (Shell Wrapper)
-##  Copyright (c) 2000-2004 The OpenPKG Project <http://www.openpkg.org/>
-##  Copyright (c) 2000-2004 Ralf S. Engelschall <rse@engelschall.com>
-##  Copyright (c) 2000-2004 Cable & Wireless <http://www.cw.com/>
-##
-
-#   root directory of RPM hierarchy
-root="@l_prefix@"
-
-#   search for Perl interpreter
-perl=""
-for d in `IFS=:; echo $root/bin:$PATH`; do
-    if [ -f "$d/perl" ]; then
-        perl="$d/perl"
-        break
-    fi
-done
-
-#   we can only operate if Perl is available
-if [ ".$perl" = . ]; then
-    echo "rpm: This functionality requires the Perl interpreter." 1>&2
-    echo "rpm: Either place a vendor-supplied Perl interpreter into your" 1>&2
-    echo "rpm: \$PATH or install the OpenPKG \"perl\" package, first." 1>&2
-    exit 1
-fi
-
-#   transfer control to the real program
-exec $perl $root/lib/openpkg/rpmx.pl $root ${1+"$@"}
-