summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--RPM4/Makefile.PL2
-rw-r--r--RPM4/NEWS1
-rw-r--r--RPM4/src/Makefile.PL19
3 files changed, 12 insertions, 10 deletions
diff --git a/RPM4/Makefile.PL b/RPM4/Makefile.PL
index ae25c32..0aad8cb 100644
--- a/RPM4/Makefile.PL
+++ b/RPM4/Makefile.PL
@@ -11,7 +11,7 @@ $rpm_version ge 4.8.0
Unable to build RPM4 with too old (or undetected) rpm version $rpm_version
BARF
-sub MY::postamble {
+sub MY::postamble() {
<<MAKECHANGELOG;
.PHONY: ChangeLog copyrpmconstant
diff --git a/RPM4/NEWS b/RPM4/NEWS
index a17503f..2c2fdbd 100644
--- a/RPM4/NEWS
+++ b/RPM4/NEWS
@@ -1,4 +1,5 @@
- fix srcrpm()
+- fix --rpmversion (broken for 6+ years...)
Version 0.31 - 25 June 2012
diff --git a/RPM4/src/Makefile.PL b/RPM4/src/Makefile.PL
index bbf7240..5b28941 100644
--- a/RPM4/src/Makefile.PL
+++ b/RPM4/src/Makefile.PL
@@ -4,6 +4,7 @@
use ExtUtils::MakeMaker;
use Getopt::Long;
+my $rpmv;
GetOptions(
'rpmversion=s' => \$rpmv,
'rebuildh' => \my $rebh,
@@ -23,10 +24,10 @@ foreach (qw(
$rpmheaderlocation or die "Can't find rpmheader location";
-my $rpmv ||= (`rpm --version` =~ /([\d\.]+)/)[0];
-open($FH, "> rpmversion.h") or die "Can't open rpmversion.h";
+$rpmv ||= (`rpm --version` =~ /([\d\.]+)/)[0];
+open(my $FH, "> rpmversion.h") or die "Can't open rpmversion.h";
print $FH "/* File generated by Mafile.PL\n";
-print $FH ' * $Id$' ."\n";
+print $FH ' * $Id$' . "\n";
print $FH " */\n\n";
print $FH "#ifndef RPMVERSION_H\n#define RPMVERSION_H\n\n";
foreach (qw(
@@ -37,14 +38,14 @@ foreach (qw(
4.9.1.1
4.9.1.2
)) {
- $v = $_;
+ my $v = $_;
$v =~ s/\./_/g;
print $FH "#define RPM$v\n";
$rpmv =~ /^\Q$_/ and last;
}
print $FH "\n#endif\n";
close($FH);
-if ($rebh) { exit 0 };
+exit 0 if $rebh;
my @rpmconstantfiles = qw(
rpmconstant.c
@@ -58,7 +59,7 @@ my ($obj, $ldd, $fl) =
('', '-lrpmconstant', '-DHAVE_RPMCONSTANT') :
('rpmconstant.o rpmconstant_internal.o rpmconstanttbl.o', '', '');
-sub MY::postamble {
+sub MY::postamble() {
my $first = <<RPMCONSTTBL;
rpmversion.h:
\$(PERL) Makefile.PL --rebuildh
@@ -71,14 +72,14 @@ RPMCONSTTBL
# in fact it is only usefull for the maintainers of this module
# if you get the module from CPAN, those files are already here
# if you're building from svn, you need rpmconstant directory
- my $second = "copyrpmconstant: " . join(" ", @rpmconstantfiles) ."\n\n";
- if(-d '../../rpmconstant') {
+ my $second = "copyrpmconstant: " . join(" ", @rpmconstantfiles) . "\n\n";
+ if (-d '../../rpmconstant') {
foreach (@rpmconstantfiles) {
$second .= "$_: ../../rpmconstant/$_\n\tcp -a \$< \$@\n\n";
}
}
- $first . $second
+ $first . $second;
}
WriteMakefile(