aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRafael Garcia-Suarez <rgarciasuarez@mandriva.org>2005-10-03 08:36:38 +0000
committerRafael Garcia-Suarez <rgarciasuarez@mandriva.org>2005-10-03 08:36:38 +0000
commitaa3b43225568d22d001050ca2345fc30907fb1f0 (patch)
treeb6624472b653ff3bcb1dd52be954c91bc72cf648
parent23419e77707b4b34a2689255284535f63f4e0034 (diff)
downloadperl-URPM-aa3b43225568d22d001050ca2345fc30907fb1f0.tar
perl-URPM-aa3b43225568d22d001050ca2345fc30907fb1f0.tar.gz
perl-URPM-aa3b43225568d22d001050ca2345fc30907fb1f0.tar.bz2
perl-URPM-aa3b43225568d22d001050ca2345fc30907fb1f0.tar.xz
perl-URPM-aa3b43225568d22d001050ca2345fc30907fb1f0.zip
Add an rpm makefile target
-rw-r--r--Makefile.PL24
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" },
);