aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile.PL
diff options
context:
space:
mode:
authorPer Øyvind Karlsen <peroyvind@mandriva.org>2008-04-14 17:11:59 +0000
committerPer Øyvind Karlsen <peroyvind@mandriva.org>2008-04-14 17:11:59 +0000
commitd85e14dd7c23230623351d2c57266852c313fcce (patch)
tree8643d27d66722501d12b56f28b5044fcb3ea99ff /Makefile.PL
parent1a7646b67a3acdbf56207724de25dd9df049cabd (diff)
downloadperl-URPM-d85e14dd7c23230623351d2c57266852c313fcce.tar
perl-URPM-d85e14dd7c23230623351d2c57266852c313fcce.tar.gz
perl-URPM-d85e14dd7c23230623351d2c57266852c313fcce.tar.bz2
perl-URPM-d85e14dd7c23230623351d2c57266852c313fcce.tar.xz
perl-URPM-d85e14dd7c23230623351d2c57266852c313fcce.zip
un-revert rpm5.org cosmetics now that cooker has reopened
Diffstat (limited to 'Makefile.PL')
-rw-r--r--Makefile.PL26
1 files changed, 10 insertions, 16 deletions
diff --git a/Makefile.PL b/Makefile.PL
index f760e93..f7271d3 100644
--- a/Makefile.PL
+++ b/Makefile.PL
@@ -16,13 +16,18 @@ unless (defined $rpm_path) {
defined $rpm_path or die "Can't find rpm on this system\n";
+sub hexversion {
+ my ($major, $minor, $micro) = (@_[0] =~ /(\d+)\.(\d+)\.?(\d+)?/);
+ return int($major<<16) + int($minor<<8) + int($micro<<0)
+}
+
my $version = `LC_ALL=C $rpm_path --version`;
# fix compiling with RCs:
$version =~ s/(-.*)|(\.DEVEL)//;
chomp $version;
$version =~ s/(RPM version )|(rpm \(RPM\) )//;
-my $pversion = eval "v$version";
-$pversion ge v4.2 or die "Unable to build URPM with too old (or undetected) rpm version $version\n";
+my $hversion = hexversion($version);
+$hversion ge hexversion("4.2") or die "Unable to build URPM with too old (or undetected) rpm version $version\n";
# to generate the ChangeLog depending on the checkout layout
my $commonusername = "../common/";
@@ -45,23 +50,12 @@ ChangeLog:
}
my @rpmflags;
-if ($pversion ge v4.4.90 && $pversion lt v4.5) {
+if ($hversion ge hexversion("4.4.90") && $hversion lt hexversion("4.5")) {
# rpm.org version
- push @rpmflags, '-DRPM_ORG';
+ push @rpmflags, "-DRPM_ORG";
} else {
# rpm5.org version
- if ($pversion ge v4.4.6) {
- push @rpmflags, '-DRPM_446';
- }
- if ($pversion ge v4.4.8) {
- push @rpmflags, '-DRPM_448';
- }
- if ($pversion ge v4.5) {
- push @rpmflags, '-DRPM_450';
- }
- if ($pversion ge v5.0) {
- push @rpmflags, '-DRPM_500';
- }
+ push @rpmflags, "-DRPM_VERSION_CODE=$hversion";
}
my $ccflags = join(' ', '-Wall -fno-strict-aliasing', @rpmflags);