cpan2rpm

 view release on metacpan or  search on metacpan

cpan2rpm  view on Meta::CPAN

    print "ready for packaging!\n";
    }

#
#   sets up an account for signing packages
#

sub sign_setup {
    my $msg = "Incorrectly formatted argument.  ";
    $msg .=  "Do not pass a module name with this option!\nStopped";
    die $msg unless $info{"sign-setup"} =~ /(^(gpg|pgp):)|^\s*$/i;

    my $mac = "$ENV{HOME}/.rpmmacros"; local $_ = $mac;
    die "Cannot read use macros file" unless -r;

    readfile();
    die "Package signing already set up.\n"
        . "Please edit macros file manually at $mac\n"
        . "Stopped"
        if /%_signature/i;

    # make sure gpg's there
    my $gpg = getrpm_macdef("_gpg");
    $gpg = inpath("gpg") unless -e $gpg;
    $gpg = inpath("pgp") unless -e $gpg;
    die "Neither GPG nor PGP found in PATH.  Stopped"
        unless -e $gpg;
    die "$gpg is not executable!  Stopped" unless -x $gpg;

    my $gpg_path = getrpm_macdef("_gpg_path");
    $gpg_path = "$ENV{HOME}/.gnupg" if $gpg_path eq '%{_gpg_path}';
    my ($type, $usr) = split ":", $info{"sign-setup"};
    $type ||= "gpg";

    my $key = gpgkey();
    $msg = "No keypairs available on your keyring!  Run:\n";
    $msg .= "\n\t# gpg --gen-key\n";
    $msg .= "\nStopped";
    die $msg unless $key;

    $usr ||= $key;

    my @gpg = (
        "%_signature $type",
        "%_gpgbin $gpg",
        "%_gpg_path $gpg_path",
        "%_gpg_name $usr",
        );

    writefile($mac, join($/, "", @gpg, ""), ">>");
    print "Package signing macros set up.\nPlease review $mac\n";
    }

# --- miscellany --------------------------------------------------------------

sub gpgkey {
    for (qx|gpg --list-keys --with-colons 2> /dev/null|) {
        return $1 if /^pub:\w+:\d+:\w+:([A-Z0-9]+):/;
        }
    }

sub optagg {
    my $info = shift || die "optagg: no info!";
    my $nm = shift || $_;
    my @opt; push @opt, split /,/ for @{$info->{$nm}};
    my $ret = "";
    $nm .= 0 if $nm eq "source";

cpan2rpm  view on Meta::CPAN

Lists of modules to be processed can be stored in a file.  Pass this parameter the name of your file.  The file should contain the name of each module in a single line and the modules can be specified in any of their many forms (e.g. url, path to tar...

=item B<--mk-rpm-dirs=C<string-value>>

This option allows the non-root user to easily set up his account for building packages.  The option requires a directory path where the RPMS, SPECS, etc. subdirectories will be created.  These directories will contain the spec files, binaries and th...

Additionally, the script will create architecture directories F<i386>, F<i686> and F<noarch> and allows the user to pass B<--buildarch> to also create a directory for that architecture.

=item B<--sign-setup=[C<type:user>]>

This option sets up your RPM macros file to support the signing of packages.  The option may be passed a value consisting of the signature type to use (currently only B<gpg> and B<pgp> are valid but consult the RPM man pages), a colon, and the user n...

B<Note:> unless you know what you're doing, do not pass any arguments to this option!  Also,  make sure not to pass a module name as an argument.

To further tailor your macros file please refer to the I<GPG SIGNATURES> section of the RPM man page.

=item B<--upgrade>

Whenever a new version of this program becomes available, an automatic notification will be issued to the user of this fact.  The user may then choose to upgrade via this option.  The option takes no parameters.

=item B<--no-upgrade-chk|-U>



( run in 0.487 second using v1.01-cache-2.11-cpan-df04353d9ac )