Sub renamed and/or GPL Licence added according to the coding guideline.
[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 or later 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' => 2.0,
37         'MARC::Charset' => 0.95,
38         'MARC::File::XML' => 0.83,
39         'Mail::Sendmail' => 1,
40         'PDF::API2' => 1,
41         'Net::LDAP' => 1,
42         'Event' => 1,
43         'Net::Z3950' => 1,
44         'XML::SAX::LibXML' => 1
45         },
46    CONFIGURE => sub {
47      # Figure out options here?
48      return { macro => { 'export TEST' => '755' } }
49      },
50    PMLIBDIRS => [ '.' ],
51    PL_FILES => { # generator => target
52      'opac/getfromintranet.PL' => ['$(INST_LIBDIR)/opac/cgi-bin/detail.pl','$(INST_LIBDIR)/opac/cgi-bin/moredetail.pl','$(INST_LIBDIR)/opac/cgi-bin/search.pl','$(INST_LIBDIR)/opac/cgi-bin/subjectsearch.pl','$(INST_LIBDIR)/opac/cgi-bin/logout.pl'],
53      'misc/koha.conf.PL' => '$(INST_LIBDIR)/../etc/koha.conf',
54      'misc/apache-koha.conf.PL' => '$(INST_LIBDIR)/../etc/apache-koha.conf',
55      'misc/koha.sql.PL' => '$(INST_LIBDIR)/intranet/scripts/koha.sql',
56      'z3950/z3950-daemon-options.PL' => '$(INST_LIBDIR)/intranet/scripts/z3950daemon/z3950-daemon-options',
57      # fake target to check permissions
58      'misc/chmod.PL' => '$(INST_LIBDIR)/fake-target'
59      }
60    # need to set ownerships
61    # need to load koha.sql
62    # need to link koha-httpd.conf
63    # need to start z3950-daemon
64 );
65
66 sub MY::libscan {
67   my ($self,$path) = @_;
68   
69   # set up the recursion
70   if (-d $path) { 1; }
71   elsif ($path !~ /\//) { $path = ''; }
72   # from here
73   # reimplementation of buildrelease and Install::installfiles
74   # ban some shell specials too
75   elsif ($path =~ /(\/CVS\/|\.(bak|orig|PL)$|\/,|\/t\/|[^\$]\(| )/) { $path = ''; }
76   elsif (
77     $path =~ s:\)/misc:\)/intranet/scripts: ||
78     $path =~ s:\)/updater:\)/intranet/scripts/updater: ||
79     $path =~ s:\)/z3950/(processz3950queue|.*sh):\)/intranet/scripts/z3950daemon/\1: ||
80     $path =~ s:\)/z3950:\)/intranet/cgi-bin/z3950: ||
81     $path =~ s:\)/koha-tmpl/intranet-tmpl:\)/intranet/htdocs/intranet-tmpl: ||
82     $path =~ s:\)/koha-tmpl/intranet.html:\)/intranet/htdocs/index.html: ||
83     $path =~ s:\)/koha-tmpl/opac-tmpl:\)/opac/htdocs/opac-tmpl: ||
84     $path =~ s:\)/koha-tmpl/opac.html:\)/opac/htdocs/index.html: ||
85     $path =~ s:\)/opac:\)/opac/cgi-bin:
86     ) { 1; }
87   elsif ($path !~ /\.p[lm]$/) { $path = ''; }
88   elsif ($path !~ /\)\/C4/) { $path =~ s!/!/intranet/cgi-bin/!; }
89
90   #print STDERR $path."\n";
91   
92   return($path);
93   
94   }