diff options
author | Thierry Vignaud <thierry.vignaud@gmail.com> | 2017-10-29 09:01:36 +0100 |
---|---|---|
committer | Thierry Vignaud <thierry.vignaud@gmail.com> | 2017-11-06 20:53:39 +0100 |
commit | fb43f786ea2bb06a1a5e3c7629dcf5bbe1270205 (patch) | |
tree | 48c8b77f94deeecab2f07141d5339c0497ae41a0 /Makefile.PL | |
parent | 9051d2588fcaeccab68f5f74ae0e419fa21c9557 (diff) | |
download | perl-URPM-fb43f786ea2bb06a1a5e3c7629dcf5bbe1270205.tar perl-URPM-fb43f786ea2bb06a1a5e3c7629dcf5bbe1270205.tar.gz perl-URPM-fb43f786ea2bb06a1a5e3c7629dcf5bbe1270205.tar.bz2 perl-URPM-fb43f786ea2bb06a1a5e3c7629dcf5bbe1270205.tar.xz perl-URPM-fb43f786ea2bb06a1a5e3c7629dcf5bbe1270205.zip |
enable to detect rpm version
(needed for next commit)
Diffstat (limited to 'Makefile.PL')
-rwxr-xr-x | Makefile.PL | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/Makefile.PL b/Makefile.PL index 7530397..f96fa87 100755 --- a/Makefile.PL +++ b/Makefile.PL @@ -34,7 +34,23 @@ unless (eval { %cfg = ExtUtils::PkgConfig->find("rpm >= $build_reqs{rpm}"); 1 }) warn "*** Ensure that $rpmdev_pkg is installed\n" . $@; exit 0; } - +my @rpm_version = split /\./, $cfg{modversion}; +open(my $FH, "> rpmversion.h") or die "Can't open rpmversion.h"; +print $FH "/* File generated by Makefile.PL\n"; +print $FH " */\n\n"; +print $FH "#ifndef RPMVERSION_H\n#define RPMVERSION_H\n\n"; +foreach (qw( + 4.12.0 + 4.13.0 + 4.14.0 + )) { + my $v = $_; + $v =~ s/\./_/g; + print $FH "#define RPM$v\n"; + $cfg{modversion} =~ /^\Q$_/ and last; +} +print $FH "\n#endif\n"; +close($FH); my $ccflags = join(' ', '-Wall -Wextra -fno-strict-aliasing', $cfg{cflags}); |