Merge branch 'master' of mathias-kettner.de:omd
[omd.git] / packages / perl-modules / build_module.pl
blob10fe7d0897607f480296a6c18ef747b6ff5acaed
1 #!/usr/bin/env perl
2 use warnings;
3 use strict;
4 use Config;
5 use BuildHelper;
7 my $verbose = 0;
8 my $PERL = "/usr/bin/perl";
9 my $TARGET = "/tmp/thruk_p5_dist";
10 my $DISTRO = "";
11 if($ARGV[0] =~ m/perl$/) {
12 $PERL = $ARGV[0]; shift @ARGV;
14 if($ARGV[0] eq '-v') {
15 $verbose = 1; shift @ARGV;
17 if($ARGV[0] eq '-d') {
18 shift @ARGV;
19 $DISTRO = shift @ARGV;
21 if($ARGV[0] eq '-p') {
22 shift @ARGV;
23 $TARGET = shift @ARGV;
26 chomp($DISTRO = `./distro`) unless $DISTRO;
28 if(!defined $ENV{'PERL5LIB'} or $ENV{'PERL5LIB'} eq "") {
29 print "dont call $0 directly, use the 'make'\n";
30 exit 1;
33 my $x = 1;
34 my $max = scalar @ARGV;
35 for my $mod (@ARGV) {
36 next if $mod =~ m/curl/mxi and $DISTRO =~ m/^rhel5/mxi;
37 next if $mod =~ m/curl/mxi and $DISTRO =~ m/^CENTOS\ 5/mxi;
38 next if $mod =~ m/Term-ReadLine-Gnu/mxi and $DISTRO =~ m/^UBUNTU\ 10/mxi;
39 BuildHelper::install_module($mod, $TARGET, $PERL, $verbose, $x, $max, $ENV{'FORCE'}) || exit 1;
40 $x++;
42 exit;