adding CGI::Session dependency for recent session re-write
[koha.git] / Makefile.PL
1 # Copyright 2007 MJ Ray
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 http://mjr.towers.org.uk/
19 # See http://www.koha.org/wiki/?page=KohaInstaller
20
21 use ExtUtils::MakeMaker;
22 use POSIX;
23
24 die "perl 5.6.1 or later required" unless ($] >= 5.006001);
25
26 =head1 NAME
27
28 Makefile.PL - Koha packager and installer
29
30 =head1 SYNOPSIS
31
32         perl Makefile.PL
33         make
34         sudo make install
35         make manifest tardist
36         make manifest zipdist
37
38 =head1 DESCRIPTION
39
40 This is a packager and installer that uses
41 ExtUtils::MakeMaker, which is fairly common
42 on perl systems.
43 As well as building tar or zip files
44 and installing,
45 it allows us to check pre-requisites
46 and generate configuration files.
47
48 =head1 VARIABLES
49
50 =head2 NAME, VERSION, ABSTRACT, AUTHOR
51
52 Basic metadata about this software.
53
54 =head2 NO_META
55
56 Suppress generation of META.yml file.
57
58 =head2 PREREQ_PM
59
60 Hash of perl modules and versions required.
61
62 =head2 PM
63
64 Hash of file mappings
65
66 =head2 CONFIGURE
67
68 Maybe use prompt() here in future to get configuration values at installation time.
69
70 =head2 PL_FILES
71
72 This is a hash of PL scripts to run after installation and
73 the files to ask them to generate.
74 Maybe use the values from CONFIGURE
75 to generate initial configuration files.
76
77 =cut
78
79 WriteMakefile(
80
81     NAME => 'koha',
82     VERSION => strftime('2.9.%Y%m%d%H',gmtime),
83     ABSTRACT => 'Award-winning integrated library system (ILS) and Web OPAC',
84     AUTHOR => 'Koha Developers <koha-devel@nongnu.org>',
85     NO_META => 1,
86     PREREQ_PM => {
87 'CGI' => 3.15,
88 'CGI::Carp' => 1.29,
89 'CGI::Session' => '4.10',
90 'DBI' => 1.53,
91 'Data::Dumper' => 2.121_08,
92 'Data::Random' => 0.05,
93 'Date::Calc' => 5.4,
94 'Date::Manip' => 5.44,
95 'Digest::MD5' => 2.36,
96 'File::Temp' => 0.16,
97 'GD::Barcode::UPCE' => 1.1,
98 'Getopt::Long' => 2.35,
99 'Getopt::Std' => 1.05,
100 'HTML::Template::Pro' => 0.65,
101 'HTML::Tree' => 3.1901,
102 'HTTP::Cookies' => 1.39,
103 'HTTP::Request::Common' => 1.26,
104 'LWP::Simple' => 1.41,
105 'LWP::UserAgent' => 2.033,
106 'Lingua::Stem' => 0.82,
107 'List::Util' => 1.18,
108 'Locale::Language' => 2.07,
109 'MARC::Charset' => 0.95,
110 'MARC::File::XML' => 0.86,
111 'MARC::Record' => 1.38,
112 'MIME::Base64' => 3.07,
113 'MIME::QuotedPrint' => 3.07,
114 'Mail::Sendmail' => 0.79,
115 'PDF::API2' => 2.000,
116 'PDF::API2::Page' => 2.000,
117 'PDF::API2::Util' => 2.000,
118 'PDF::Reuse' => 0.33,
119 'PDF::Reuse::Barcode' => 0.05,
120 'POSIX' => 1.09,
121 'Term::ANSIColor' => 1.10,
122 'Test' => 1.25,
123 'Test::Harness' => 2.56,
124 'Test::More' => 0.62,
125 'Text::Wrap' => 2005.082401,
126 'Time::HiRes' => 1.86,
127 'Time::localtime' => 1.02,
128 'Unicode::Normalize' => 0.32,
129 'XML::LibXML' => 1.59,
130 'XML::SAX::ParserFactory' => 1.01,
131 'XML::Simple' => 2.14,
132 'ZOOM' => 0,
133         },
134
135         # File tree mapping
136         PM => map_tree(),
137
138 #   CONFIGURE => sub {
139 #     # Ask for options with prompt($question,$default) calls here?
140 #     return { macro => { 'export TEST' => '755' } }
141 #     },
142
143 #   PL_FILES => { # generator => target
144 #     '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'],
145 #     'misc/koha.conf.PL' => '$(INST_LIBDIR)/../etc/koha.conf',
146 #     'misc/apache-koha.conf.PL' => '$(INST_LIBDIR)/../etc/apache-koha.conf',
147 #     'misc/koha.sql.PL' => '$(INST_LIBDIR)/intranet/scripts/koha.sql',
148 #     'z3950/z3950-daemon-options.PL' => '$(INST_LIBDIR)/intranet/scripts/z3950daemon/z3950-daemon-options',
149 #     # fake target to check permissions
150 #     'misc/chmod.PL' => '$(INST_LIBDIR)/fake-target'
151 #     }
152    # need to set ownerships
153    # need to load koha.sql
154    # need to link koha-httpd.conf
155    # need to start z3950-daemon
156 );
157
158 =head1 FUNCTIONS
159
160 =head2 map_tree
161
162 This function lists all files and where to install each one.
163 It returns a hash reference suitable for PM.
164
165 =cut
166
167 sub map_tree {
168         my %result => ();
169
170 =pod
171
172 C4/*.pm is copied to perl's lib namespace.
173
174 =cut
175         foreach my $src (glob("C4/*.pm")) {
176                 $result{$src} = '$(INST_LIBDIR)/'.$src;
177         }
178
179 =pod
180
181 CGIs are copied to koha/cgi-bin
182 and other scripts to koha/examples.
183
184 =cut
185         # Misc scripts to koha/examples
186         foreach my $src (glob("*.pl"),glob("*/*.pl"),glob("installer/*.pm"),glob("*/*/*.pl"),glob("*/*/*/*.pl")) {
187                 if ($src =~ /(misc|updater|rss)\//) {
188                         $result{$src} = '$(INST_LIBDIR)/koha/scripts/'.$src;
189                 } else {
190                         $result{$src} = '$(INST_LIBDIR)/koha/cgi-bin/'.$src;
191                 }
192         }
193
194 =pod
195
196 Templates are copied to koha/templates,
197
198 =cut
199         foreach my $src (glob("koha-tmpl/*"),glob("koha-tmpl/intranet-tmpl/*/*/*"),glob("koha-tmpl/intranet-tmpl/*/*/*/*"),glob("koha-tmpl/intranet-tmpl/*/*/*/*/*"),glob("koha-tmpl/opac-tmpl/*/*/*"),glob("koha-tmpl/opac-tmpl/*/*/*/*"),glob("koha-tmpl/opac-tmpl/*/*/*/*/*")) {
200
201 =pod
202
203 excluding non-files, CVS files and whitespace in filenames.
204
205 =cut
206                 if ((-f $src) && ($src !~ /(\/CVS\/|\s)/)) {
207                         $result{$src} = '$(INST_LIBDIR)/koha/templates/'.$src;
208                 }
209         }
210
211         return \%result;
212 }
213
214 __END__
215
216
217 =head1 SEE ALSO
218
219 ExtUtils::MakeMaker(3)
220
221 =cut
222