aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile.PL
diff options
context:
space:
mode:
authorFrancois Pons <fpons@mandriva.com>2001-07-25 14:59:35 +0000
committerFrancois Pons <fpons@mandriva.com>2001-07-25 14:59:35 +0000
commit5070f3f86e1897c43fb47007d9aebd55c68f5c9e (patch)
tree702f309c30991bd8fa91f17edae627f7258cd6b0 /Makefile.PL
parentc019f7e04986a404b6a556624d06585f5b3fe744 (diff)
downloadrpmtools-5070f3f86e1897c43fb47007d9aebd55c68f5c9e.tar
rpmtools-5070f3f86e1897c43fb47007d9aebd55c68f5c9e.tar.gz
rpmtools-5070f3f86e1897c43fb47007d9aebd55c68f5c9e.tar.bz2
rpmtools-5070f3f86e1897c43fb47007d9aebd55c68f5c9e.tar.xz
rpmtools-5070f3f86e1897c43fb47007d9aebd55c68f5c9e.zip
use rpmlib version comparison function, force destiny.3.1.2
Diffstat (limited to 'Makefile.PL')
-rw-r--r--Makefile.PL16
1 files changed, 13 insertions, 3 deletions
diff --git a/Makefile.PL b/Makefile.PL
index 2052fd1..308216a 100644
--- a/Makefile.PL
+++ b/Makefile.PL
@@ -2,10 +2,20 @@ use ExtUtils::MakeMaker;
# See lib/ExtUtils/MakeMaker.pm for details of how to influence
# the contents of the Makefile that is written.
-# needed as it bootstrap itself...
-eval { require "./rpmtools.pm" };
+# old version that works actually somewhat well...
+sub version_compare {
+ my ($a, $b) = @_;
+ local $_;
-my $libs = ' -lrpm -lrpmio ' . (rpmtools::version_compare(qx(rpm -q --qf %{VERSION} rpm), "4.0.3") >= 0 && "-lrpmdb ") . '-lpopt -lz -lbz2';
+ while ($a || $b) {
+ my ($sb, $sa) = map { $1 if $a =~ /^\W*\d/ ? s/^\W*0*(\d+)// : s/^\W*(\D*)// } ($b, $a);
+ $_ = ($sa =~ /^\d/ || $sb =~ /^\d/) && length($sa) <=> length($sb) || $sa cmp $sb and return $_ || 0;
+ $sa eq '' && $sb eq '' and return $a cmp $b || 0;
+ }
+ 0;
+}
+
+my $libs = ' -lrpm -lrpmio ' . (version_compare(qx(rpm -q --qf %{VERSION} rpm), "4.0.3") >= 0 && "-lrpmdb ") . '-lpopt -lz -lbz2';
WriteMakefile(
'NAME' => 'rpmtools',