View | Details | Raw Unified | Return to bug 7636
Collapse All | Expand All

(-)/usr/bin/cpan2rpm (-7 / +9 lines)
Lines 86-91 Link Here
86
        buildroot         => "%{_tmppath}/%{name}-%{version}-%(id -u -n)",
86
        buildroot         => "%{_tmppath}/%{name}-%{version}-%(id -u -n)",
87
        defattr           => "-,root,root",
87
        defattr           => "-,root,root",
88
        description       => "None.",
88
        description       => "None.",
89
        "rpm-args"        => "",
89
        );
90
        );
90
91
91
    my %desc = (
92
    my %desc = (
Lines 122-127 Link Here
122
        # -- build options
123
        # -- build options
123
        "spec-only"       => "only generates spec file",
124
        "spec-only"       => "only generates spec file",
124
        "spec=s"          => "specifies the name of a spec file",
125
        "spec=s"          => "specifies the name of a spec file",
126
        "rpm-args=s"      => "additional rpm arguments",
125
        "make-maker=s"    => "arguments for makefile creation",
127
        "make-maker=s"    => "arguments for makefile creation",
126
        "make=s"          => "arguments passed to make",
128
        "make=s"          => "arguments passed to make",
127
        "make-no-test"    => "suppress running test suite",
129
        "make-no-test"    => "suppress running test suite",
Lines 914-920 Link Here
914
    writefile($info->{spec}, $spec);
916
    writefile($info->{spec}, $spec);
915
    print("SPEC: $info->{spec}\n");
917
    print("SPEC: $info->{spec}\n");
916
    system("cleanup_spec $info->{spec}");
918
    system("cleanup_spec $info->{spec}");
917
    system("buildreq $info->{spec}");
919
    system("buildreq --args=\"$info{'rpm-args'}\" $info->{spec}");
918
    exit if $info->{"spec-only"};
920
    exit if $info->{"spec-only"};
919
    }
921
    }
920
922
Lines 953-971 Link Here
953
    if (! -r $info->{rpm} || $info->{force}) {
955
    if (! -r $info->{rpm} || $info->{force}) {
954
        print "Generating package\n";
956
        print "Generating package\n";
955
957
956
        my $bp = qx/$RPM -bp $info->{spec} 2>&1/;
958
        my $bp = qx/$RPM $info{"rpm-args"} -bp $info->{spec} 2>&1/;
957
        warn("RPM test unpacking failed! [$RPM -bp $info->{spec}]\n$bp")
959
        warn("RPM test unpacking failed! [$RPM $info{'rpm-args'} -bp $info->{spec}]\n$bp")
958
            if $ret = $? >> 8;
960
            if $ret = $? >> 8;
959
961
960
        if ($ret == 0) {
962
        if ($ret == 0) {
961
            my @cmd = ($RPM, '-ba');
963
            my @cmd = ($RPM, $info{"rpm-args"}, '-ba');
962
            push @cmd, "--clean" unless $info->{"no-clean"};
964
            push @cmd, "--clean" unless $info->{"no-clean"};
963
            push @cmd, $info->{sign} if $info->{sign};
965
            push @cmd, $info->{sign} if $info->{sign};
964
            push @cmd, $info->{spec};
966
            push @cmd, $info->{spec};
965
            debug(join " ", @cmd);
967
            debug(join " ", @cmd);
966
            print "Signing package (pass phrase required)\n"
968
            print "Signing package (pass phrase required)\n"
967
                if $info->{sign};
969
                if $info->{sign};
968
            system(@cmd);
970
            system(join(" ", @cmd));
969
            die "RPM build failed [$ret]" if $ret = $? >> 8;
971
            die "RPM build failed [$ret]" if $ret = $? >> 8;
970
            }
972
            }
971
        }
973
        }
Lines 1490-1496 Link Here
1490
1492
1491
sub getrpm_macdef($) {
1493
sub getrpm_macdef($) {
1492
    my $key = shift;
1494
    my $key = shift;
1493
    chomp(local $_ = qx/rpm --eval \%{$key}/);
1495
    chomp(local $_ = qx/rpm $info{"rpm-args"} --eval \%{$key}/);
1494
    s/^\s+//; s/\s*\n+/ /gs; s/\s+$//;
1496
    s/^\s+//; s/\s*\n+/ /gs; s/\s+$//;
1495
    $_;
1497
    $_;
1496
    }
1498
    }
Lines 1550-1556 Link Here
1550
        }
1552
        }
1551
1553
1552
    my ($f) = $url =~ m|.*/(.*)|;
1554
    my ($f) = $url =~ m|.*/(.*)|;
1553
    my @ret = qx|$RPM -ta $TMPDIR/$f 2>&1|;
1555
    my @ret = qx|$RPM $info{"rpm-args"} -ta $TMPDIR/$f 2>&1|;
1554
    die "upgrade(): $!" if $?;
1556
    die "upgrade(): $!" if $?;
1555
    /Wrote:\s+(.*)$/ && ($info{rpm} = $1) && last for reverse @ret;
1557
    /Wrote:\s+(.*)$/ && ($info{rpm} = $1) && last for reverse @ret;
1556
    inst_rpm(\%info);
1558
    inst_rpm(\%info);

Return to bug 7636