aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile.PL
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2008-03-25 13:15:22 +0000
committerPascal Rigaux <pixel@mandriva.com>2008-03-25 13:15:22 +0000
commit9de6a9a0ef175395f770b899f89fb41e71ea659f (patch)
tree9436ea44908360a22db5cd6e18be9a2e648cb219 /Makefile.PL
parentfe0d53909b70201d89223a4d2729f8c0c7911709 (diff)
downloadperl-URPM-9de6a9a0ef175395f770b899f89fb41e71ea659f.tar
perl-URPM-9de6a9a0ef175395f770b899f89fb41e71ea659f.tar.gz
perl-URPM-9de6a9a0ef175395f770b899f89fb41e71ea659f.tar.bz2
perl-URPM-9de6a9a0ef175395f770b899f89fb41e71ea659f.tar.xz
perl-URPM-9de6a9a0ef175395f770b899f89fb41e71ea659f.zip
revert unneeded commit for nowtopic/3.12
Diffstat (limited to 'Makefile.PL')
-rw-r--r--Makefile.PL26
1 files changed, 16 insertions, 10 deletions
diff --git a/Makefile.PL b/Makefile.PL
index f7271d3..f760e93 100644
--- a/Makefile.PL
+++ b/Makefile.PL
@@ -16,18 +16,13 @@ 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 $hversion = hexversion($version);
-$hversion ge hexversion("4.2") or die "Unable to build URPM with too old (or undetected) rpm version $version\n";
+my $pversion = eval "v$version";
+$pversion ge v4.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/";
@@ -50,12 +45,23 @@ ChangeLog:
}
my @rpmflags;
-if ($hversion ge hexversion("4.4.90") && $hversion lt hexversion("4.5")) {
+if ($pversion ge v4.4.90 && $pversion lt v4.5) {
# rpm.org version
- push @rpmflags, "-DRPM_ORG";
+ push @rpmflags, '-DRPM_ORG';
} else {
# rpm5.org version
- push @rpmflags, "-DRPM_VERSION_CODE=$hversion";
+ 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';
+ }
}
my $ccflags = join(' ', '-Wall -fno-strict-aliasing', @rpmflags);