allow bin/setrlimit.c
[irspy-moved-to-github.git] / Makefile.PL
1
2 use 5.008;
3 use strict;
4 use warnings;
5 use ExtUtils::MakeMaker;
6
7 my $yazver = `yaz-config --version`;
8 if (!$yazver) {
9     die qq[
10 ERROR: Unable to call script: yaz-config
11 If you are using a YAZ installation from the Debian package "yaz", you
12 will also need to install "libyaz-dev" in order to build this module.
13 ];
14 }
15
16 chomp($yazver);
17 # 2.1.53 is the first version with ZOOM-C fixed to properly support
18 # reconnection in asynchronous mode.
19 check_version($yazver, "2.1.53");
20
21 # See lib/ExtUtils/MakeMaker.pm for details of how to influence
22 # the contents of the Makefile that is written.
23 WriteMakefile(
24     NAME              => 'ZOOM::IRSpy',
25     VERSION_FROM      => 'lib/ZOOM/IRSpy.pm', # finds $VERSION
26     PREREQ_PM         => {
27         "Net::Z3950::ZOOM" => 1.19,
28         "XML::LibXML::XPathContext" => 0.07, # For Web UI
29         "XML::LibXML" => 1.58,
30         "XML::LibXSLT" => 1.57,
31         "URI::Escape" => 3.28, # For Web UI
32     },
33     ($] >= 5.005 ?     ## Add these new keywords supported since 5.005
34       (ABSTRACT_FROM  => 'lib/ZOOM/IRSpy.pm', # retrieve abstract from module
35        AUTHOR         => 'Mike Taylor <mike@indexdata.com>') : ()),
36     EXE_FILES    => [ 'bin/irspy.pl', 'bin/irspy-dump.pl' ],
37 );
38
39
40 sub check_version {
41     my($got, $want) = @_;
42
43     my($gmajor, $gminor, $gtrivial) = ($got =~ /(\d+)\.(\d+)\.(\d+)/);
44     my($wmajor, $wminor, $wtrivial) = ($want =~ /(\d+)\.(\d+)\.(\d+)/);
45     if (($gmajor < $wmajor) ||
46         ($gmajor == $wmajor && $gminor < $wminor) ||
47         ($gmajor == $wmajor && $gminor == $wminor && $gtrivial < $wtrivial)) {
48         print <<__EOT__;
49 *** ERROR!
50 ZOOM-Perl requires at least version $want of YAZ,
51 but is currently you only have version $got.
52 __EOT__
53         exit 1;
54     }
55 }