Remove overlong PM mapping, use libscan() instead, ignore some troublemaker files...
[koha.git] / Makefile.PL
1 # Copyright 2005 MJ Ray and koha development team
2 #
3 # This file is part of Koha.
4 #
5 # Koha is free software; you can redistribute it and/or modify it under the
6 # terms of the GNU General Public License as published by the Free Software
7 # Foundation; either version 2 of the License, or (at your option) any later
8 # version.
9 #
10 # Koha is distributed in the hope that it will be useful, but WITHOUT ANY
11 # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
12 # A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
13 #
14 # You should have received a copy of the GNU General Public License along with
15 # Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
16 # Suite 330, Boston, MA  02111-1307 USA
17 #
18 # Current maintainer MJR slef at users.sourceforge.net
19 # See http://www.koha.org/wiki/?page=KohaInstaller
20
21 use ExtUtils::MakeMaker;
22
23 die "perl >= 5.6.1 required" unless ($] >= 5.006001);
24
25 WriteMakefile(
26     NAME => 'Koha',
27     DISTNAME => 'koha',
28     VERSION => '2.3.0',
29     NO_META => 1,
30     PREREQ_PM => {
31         'DBI' => 1,
32         'Date::Manip' => 1,
33         'DBD::MySQL' => 1,
34         'HTML::Template' => 1,
35         'Digest::MD5' => 1,
36         'MARC::Record' => 1,
37         'Mail::Sendmail' => 1,
38         'PDF::API2' => 1,
39         'Net::LDAP' => 1,
40         'Event' => 1,
41         'Net::Z3950' => 1
42         },
43    CONFIGURE => sub {
44      # Figure out options here?
45      return {}
46      },
47    PMLIBDIRS => [ '.' ],
48    PL_FILES => { # generator => target
49      # need to copy detail, moredetail, search, subjectsearch and logout from intranet to opac
50      # need to write koha.conf
51      # need to write koha-httpd.conf
52      # need to write koha.sql
53      }
54    # need to check permissions somehow
55 );
56
57 sub MY::libscan {
58   my ($self,$path) = @_;
59   
60   # set up the recursion
61   if (-d $path) { 1; }
62   elsif ($path !~ /\//) { $path = ''; }
63   # from here
64   # reimplementation of buildrelease and Install::installfiles
65   # ban some shell specials too
66   elsif ($path =~ /(\/CVS\/|\.bak$|\.orig$|\/,|\/t\/|[^\$]\(| )/) { $path = ''; }
67   elsif (
68     $path =~ s:\)/misc:\)/intranet/scripts: ||
69     $path =~ s:\)/updater:\)/intranet/scripts/updater: ||
70     $path =~ s:\)/z3950/(processz3950queue|.*sh):\)/intranet/scripts/z3950daemon/\1: ||
71     $path =~ s:\)/z3950:\)/intranet/cgi-bin/z3950: ||
72     $path =~ s:\)/koha-tmpl/intranet-tmpl:\)/intranet/htdocs/intranet-tmpl: ||
73     $path =~ s:\)/koha-tmpl/intranet.html:\)/intranet/htdocs/index.html: ||
74     $path =~ s:\)/koha-tmpl/opac-tmpl:\)/opac/htdocs/opac-tmpl: ||
75     $path =~ s:\)/koha-tmpl/opac.html:\)/opac/htdocs/index.html: ||
76     $path =~ s:\)/opac:\)/opac/cgi-bin:
77     ) { 1; }
78   elsif ($path !~ /\.p[lm]$/) { $path = ''; }
79   elsif ($path !~ /\)\/C4/) { $path =~ s!/!/intranet/cgi-bin/!; }
80
81   #print STDERR $path."\n";
82   
83   return($path);
84   
85   }