summaryrefslogtreecommitdiffstats
path: root/RPM4/src/Makefile.PL
diff options
context:
space:
mode:
Diffstat (limited to 'RPM4/src/Makefile.PL')
-rw-r--r--RPM4/src/Makefile.PL19
1 files changed, 10 insertions, 9 deletions
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(