From aa3b43225568d22d001050ca2345fc30907fb1f0 Mon Sep 17 00:00:00 2001 From: Rafael Garcia-Suarez Date: Mon, 3 Oct 2005 08:36:38 +0000 Subject: Add an rpm makefile target --- Makefile.PL | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) (limited to 'Makefile.PL') diff --git a/Makefile.PL b/Makefile.PL index e817f4e..d0dcbec 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -2,7 +2,8 @@ use strict; use ExtUtils::MakeMaker; # where to find the rpm utility -my $rpm_path = $ENV{RPM_PATH}; + +my $rpm_path = $ENV{RPM_PATH}; # this overrides unless (defined $rpm_path) { for (qw(/bin/rpm /usr/bin/rpm)) { @@ -20,14 +21,28 @@ $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\n"; +# directory where to build an rpm of this +my $rpmtopdir = `$rpm_path --eval '%{_topdir}'`; +chomp $rpmtopdir; + sub MY::postamble { - < 'URPM.pm', LIBS => [ '-lrpm -lrpmio -lrpmdb -lpopt -lz -lbz2' ], INC => '-I/usr/include/rpm', + dist => { COMPRESS => "bzip2", SUFFIX => ".bz2" }, ); -- cgit v1.2.1