summaryrefslogtreecommitdiffstats
path: root/Makefile.PL
blob: f4f95cdaa3ecaf5c2b8184994db808188c7ae233 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# $Id$

use 5.008;
use strict;
use ExtUtils::MakeMaker;

# 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 {
    <<MAKE;
.PHONY: ChangeLog rpmdist srpm rpm

ChangeLog: ../common/username
	cvs2cl -W 400 -I ChangeLog --accum -U ../common/username
	rm -f *.bak

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(
    NAME	 => 'MDV::Distribconf',
    VERSION_FROM => 'lib/MDV/Distribconf.pm',
);