summaryrefslogtreecommitdiffstats
path: root/Makefile.PL
diff options
context:
space:
mode:
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(