summaryrefslogtreecommitdiffstats
path: root/Makefile.PL
diff options
context:
space:
mode:
authorRafael Garcia-Suarez <rgarciasuarez@mandriva.org>2005-10-28 09:46:07 +0000
committerRafael Garcia-Suarez <rgarciasuarez@mandriva.org>2005-10-28 09:46:07 +0000
commit22acab0e689a84346e7d1374325ce3c479ea853e (patch)
tree471c7fa76570d06dfb82dfe0598a942296b68ff4 /Makefile.PL
parent2f0ad7212cb62c079658cf0a8bacaf3579824679 (diff)
downloadperl-MDV-Distribconf-22acab0e689a84346e7d1374325ce3c479ea853e.tar
perl-MDV-Distribconf-22acab0e689a84346e7d1374325ce3c479ea853e.tar.gz
perl-MDV-Distribconf-22acab0e689a84346e7d1374325ce3c479ea853e.tar.bz2
perl-MDV-Distribconf-22acab0e689a84346e7d1374325ce3c479ea853e.tar.xz
perl-MDV-Distribconf-22acab0e689a84346e7d1374325ce3c479ea853e.zip
Add spec file and target to make rpms for Mandriva
Diffstat (limited to 'Makefile.PL')
-rw-r--r--Makefile.PL33
1 files changed, 28 insertions, 5 deletions
diff --git a/Makefile.PL b/Makefile.PL
index c065851..f4f95cd 100644
--- a/Makefile.PL
+++ b/Makefile.PL
@@ -1,18 +1,41 @@
# $Id$
-# use 5.008;
+use 5.008;
+use strict;
use ExtUtils::MakeMaker;
-use Getopt::Long;
+
+# where to find the rpm utility
+my $rpm_path = $ENV{RPM_PATH}; # this overrides
+unless (defined $rpm_path) {
+ for (qw(/bin/rpm /usr/bin/rpm)) {
+ if (-x) {
+ $rpm_path = $_;
+ last;
+ }
+ }
+}
+my $rpmtopdir = $rpm_path ? `$rpm_path --eval '%{_topdir}'` : '';
+chomp $rpmtopdir;
sub MY::postamble {
- <<MAKECHANGELOG;
-.PHONY: ChangeLog
+ <<MAKE;
+.PHONY: ChangeLog rpmdist srpm rpm
ChangeLog: ../common/username
cvs2cl -W 400 -I ChangeLog --accum -U ../common/username
rm -f *.bak
-MAKECHANGELOG
+rpmdist: dist
+ cp -f perl-MDV-Distribconf.spec $rpmtopdir/SPECS
+ bzme MDV-Distribconf-*.tar.gz
+ mv -f MDV-Distribconf-*.tar.bz2 $rpmtopdir/SOURCES
+
+srpm: rpmdist
+ rpmbuild -bs --clean --rmsource $rpmtopdir/SPECS/perl-MDV-Distribconf.spec
+
+rpm: rpmdist
+ rpmbuild -ba --clean --rmsource $rpmtopdir/SPECS/perl-MDV-Distribconf.spec
+MAKE
}
WriteMakefile(