aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile.PL
diff options
context:
space:
mode:
authorRafael Garcia-Suarez <rgarciasuarez@mandriva.org>2005-10-03 08:20:07 +0000
committerRafael Garcia-Suarez <rgarciasuarez@mandriva.org>2005-10-03 08:20:07 +0000
commit23419e77707b4b34a2689255284535f63f4e0034 (patch)
treef4681971f5a03ad903b5ed5a80f8848edc523a7d /Makefile.PL
parent19e8c38e9346b4573b09b1b47287e29557d2f086 (diff)
downloadperl-URPM-23419e77707b4b34a2689255284535f63f4e0034.tar
perl-URPM-23419e77707b4b34a2689255284535f63f4e0034.tar.gz
perl-URPM-23419e77707b4b34a2689255284535f63f4e0034.tar.bz2
perl-URPM-23419e77707b4b34a2689255284535f63f4e0034.tar.xz
perl-URPM-23419e77707b4b34a2689255284535f63f4e0034.zip
Makefile.PL cleanup
Diffstat (limited to 'Makefile.PL')
-rw-r--r--Makefile.PL36
1 files changed, 23 insertions, 13 deletions
diff --git a/Makefile.PL b/Makefile.PL
index 76d9307..e817f4e 100644
--- a/Makefile.PL
+++ b/Makefile.PL
@@ -1,11 +1,24 @@
+use strict;
use ExtUtils::MakeMaker;
-my $version = `LC_ALL=C rpm --version`;
+# where to find the rpm utility
+my $rpm_path = $ENV{RPM_PATH};
+
+unless (defined $rpm_path) {
+ for (qw(/bin/rpm /usr/bin/rpm)) {
+ if (-x) {
+ $rpm_path = $_;
+ last;
+ }
+ }
+}
+
+defined $rpm_path or die "Can't find rpm on this system\n";
+
+my $version = `LC_ALL=C $rpm_path --version`;
$version =~ s/RPM version //;
$version =~ /^(?:4\.[2-9]|[5-9]|\d{2})/
- or die "unable to build URPM with too old (or undetected) rpm version $version";
-
-my $libs = '-lrpm -lrpmio -lrpmdb -lpopt -lz -lbz2';
+ or die "Unable to build URPM with too old (or undetected) rpm version $version\n";
sub MY::postamble {
<<MAKECHANGELOG;
@@ -18,13 +31,10 @@ MAKECHANGELOG
}
WriteMakefile(
- 'NAME' => 'URPM',
- 'CCFLAGS' => '-Wall',
- 'OPTIMIZE' => '-O3 -fomit-frame-pointer -fno-exceptions -pipe -s -ffast-math -fexpensive-optimizations',
- 'MAKEFILE' => 'Makefile',
- 'OBJECT' => 'URPM.o',
- 'VERSION_FROM' => 'URPM.pm',
- 'LIBS' => [ $libs ],
- 'INC' => '-I/usr/include/rpm',
- INSTALLDIRS => 'vendor',
+ NAME => 'URPM',
+ CCFLAGS => '-Wall',
+ OPTIMIZE => '-O3 -fomit-frame-pointer -fno-exceptions -pipe -s -ffast-math -fexpensive-optimizations',
+ VERSION_FROM => 'URPM.pm',
+ LIBS => [ '-lrpm -lrpmio -lrpmdb -lpopt -lz -lbz2' ],
+ INC => '-I/usr/include/rpm',
);