diff options
-rw-r--r-- | Makefile.PL | 24 |
1 files changed, 20 insertions, 4 deletions
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 { - <<MAKECHANGELOG; -.PHONY: ChangeLog + <<"**MM**"; +.PHONY: ChangeLog rpmdist srpm rpm ChangeLog: cvs2cl -W 400 -I ChangeLog --accum -U ../common/username rm -f *.bak -MAKECHANGELOG + +rpmdist: dist + cp -f perl-URPM.spec $rpmtopdir/SPECS + mv -f URPM-*.tar.bz2 $rpmtopdir/SOURCES + +srpm: rpmdist + rpmbuild -bs --clean --rmsource $rpmtopdir/SPECS/perl-URPM.spec + +rpm: rpmdist + rpmbuild -ba --clean --rmsource $rpmtopdir/SPECS/perl-URPM.spec +**MM** } WriteMakefile( @@ -37,4 +52,5 @@ WriteMakefile( VERSION_FROM => 'URPM.pm', LIBS => [ '-lrpm -lrpmio -lrpmdb -lpopt -lz -lbz2' ], INC => '-I/usr/include/rpm', + dist => { COMPRESS => "bzip2", SUFFIX => ".bz2" }, ); |