summaryrefslogtreecommitdiffstats
path: root/RPM4/Makefile.PL
blob: 1b985173d5d865157af1065a27f7855883341e81 (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
45
# $Id$

# use 5.008;
use ExtUtils::MakeMaker;
use Getopt::Long;

#- require at least rpm 4.9
my $rpm_version = `LC_ALL=C rpm --version` =~ /version ([0-9.]+)(?:-(?:beta|rc).*)?$/ ? version->new("v$1") : ();
$rpm_version ge 4.9.0
    or die <<BARF;
Unable to build RPM4 with too old (or undetected) rpm version $rpm_version
BARF

sub MY::postamble() {
    <<MAKECHANGELOG;
.PHONY: ChangeLog copyrpmconstant

copyrpmconstant:
	make -C src copyrpmconstant

ChangeLog:
	LC_ALL=C svn update && LC_ALL=C svn log --verbose > \$@

rpm: dist
	rpm --rmsource --define "_sourcedir `pwd`" -ba perl-Hdlist.spec
MAKECHANGELOG
}

WriteMakefile(
    NAME	 => 'RPM4',
    VERSION_FROM => 'lib/RPM4.pm',
    DIR          => [ 'src' ],
    'EXE_FILES'  => [ qw(bin/rpm_produced bin/rpmresign bin/hrpmreb) ],
    depend => { dist => 'copyrpmconstant' },
    LICENSE      => 'gpl_2',
    PREREQ_PM => {
        Carp => 0,
        'Digest::SHA1' => 0,
        DynaLoader => 0,
        Exporter => 0,
        'File::Temp' => 0,
        'MDV::Packdrakeng' => 0,
    },
    dist => { COMPRESS => "xz", SUFFIX => ".xz" },
);