1 # Copyright 2007 MJ Ray
3 # This file is part of Koha.
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
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.
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
18 # Current maintainer MJR http://mjr.towers.org.uk/
19 # See http://www.koha.org/wiki/?page=KohaInstaller
21 # 2007-11-05 Corrected CGI copy to include entire 'installer' subdir structure. -fbcit
22 use ExtUtils::MakeMaker;
25 die "perl 5.6.1 or later required" unless ($] >= 5.006001);
29 Makefile.PL - Koha packager and installer
33 =head2 BASIC INSTALLATION
36 or perl Makefile.PL INSTALL_BASE=/path/to/your/home/dir MARCFLAVOUR=marc21 LANGUAGE=en
40 =head2 PACKAGING RELEASE TARBALLS
51 This is a packager and installer that uses
52 ExtUtils::MakeMaker, which is fairly common
54 As well as building tar or zip files
55 and installing with the above commands,
56 it allows us to check pre-requisites
57 and generate configuration files.
61 =head2 NAME, VERSION_FROM, ABSTRACT, AUTHOR
63 Basic metadata about this software.
67 Suppress generation of META.yml file.
71 Hash of perl modules and versions required.
79 Maybe use prompt() here in future to get configuration values
80 interactively at installation time.
84 This is a hash of PL scripts to run after installation and
85 the files to ask them to generate.
86 Maybe use the values from CONFIGURE
87 to generate initial configuration files in future.
95 while ($marc_value ne 'marc21' && $marc_value ne 'unimarc'){
96 my $message= "Chose your flavour of MARC, unimarc or marc21 [marc21]";
97 $marc_value=prompt($message) || 'marc21';
99 if ($lang_value ne 'en' && $lang_value ne 'fr'){
100 my $message= "Choose your language, en or fr [en]";
101 $lang_value=prompt($message) || 'en';
107 #VERSION => strftime('2.9.%Y%m%d%H',gmtime),
108 VERSION_FROM => 'kohaversion.pl',
109 ABSTRACT => 'Award-winning integrated library system (ILS) and Web OPAC',
110 AUTHOR => 'Koha Developers <koha-devel@nongnu.org>',
113 'Biblio::EndnoteStyle' => 0.05,
116 'CGI::Session' => '4.10',
117 'Class::Factory::Util' => 1.7,
118 'Class::Accessor' => 0.30,
119 'DBD::mysql' => 3.0008,
121 'Data::Dumper' => 2.121_08,
123 'Date::Manip' => 5.44,
124 'Digest::MD5' => 2.36,
125 'File::Temp' => 0.16,
126 'GD::Barcode::UPCE' => 1.1,
127 'Getopt::Long' => 2.35,
128 'Getopt::Std' => 1.05,
129 'HTML::Template::Pro' => 0.65,
130 'HTTP::Cookies' => 1.39,
131 'HTTP::Request::Common' => 1.26,
132 'LWP::Simple' => 1.41,
133 'LWP::UserAgent' => 2.033,
134 'Lingua::Stem' => 0.82,
135 'List::Util' => 1.18,
136 'Locale::Language' => 2.07,
137 'MARC::Charset' => 0.98,
138 'MARC::Crosswalk::DublinCore' => 0.03,
139 'MARC::File::XML' => 0.88,
140 'MARC::Record' => 2.00,
141 'MARC::Crosswalk::DublinCore' => 0.02,
142 'MIME::Base64' => 3.07,
143 'MIME::QuotedPrint' => 3.07,
144 'Mail::Sendmail' => 0.79,
145 'Net::Z3950::ZOOM' => 1.16,
146 'PDF::API2' => 2.000,
147 'PDF::API2::Page' => 2.000,
148 'PDF::API2::Util' => 2.000,
149 'PDF::Reuse' => 0.33,
150 'PDF::Reuse::Barcode' => 0.05,
152 'Schedule::At' => 1.06,
153 'Term::ANSIColor' => 1.10,
155 'Test::Harness' => 2.56,
156 'Test::More' => 0.62,
158 'Text::CSV_XS' => 0.32,
159 'Text::Wrap' => 2005.082401,
160 'Time::HiRes' => 1.86,
161 'Time::localtime' => 1.02,
162 'Unicode::Normalize' => 0.32,
163 'XML::Dumper' => 0.81,
164 'XML::LibXML' => 1.59,
165 'XML::LibXSLT' => 1.63,
166 'XML::SAX::ParserFactory' => 1.01,
167 'XML::Simple' => 2.14,
175 'test' => {TESTS => 't/dummy.t'},
178 # # Ask for options with prompt($question,$default) calls here?
179 # return { macro => { 'export TEST' => '755' } }
182 PL_FILES => { # generator => target(s)
183 'rewrite-config.PL' => [
184 '$(INSTALL_BASE)/share/koha/etc/koha-conf.xml',
185 '$(INSTALL_BASE)/share/koha/etc/koha-httpd.conf',
186 '$(INSTALL_BASE)/share/koha/etc/zebradb/etc/passwd',
187 '$(INSTALL_BASE)/share/koha/etc/zebradb/zebra-biblios.cfg',
188 '$(INSTALL_BASE)/share/koha/etc/zebradb/zebra-authorities.cfg'
191 # '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'],
192 # 'misc/koha.conf.PL' => '$(INST_LIBDIR)/../etc/koha.conf',
193 # 'misc/apache-koha.conf.PL' => '$(INST_LIBDIR)/../etc/apache-koha.conf',
194 # 'misc/koha.sql.PL' => '$(INST_LIBDIR)/intranet/scripts/koha.sql',
195 # 'z3950/z3950-daemon-options.PL' => '$(INST_LIBDIR)/intranet/scripts/z3950daemon/z3950-daemon-options',
196 # # fake target to check permissions
197 # 'misc/chmod.PL' => '$(INST_LIBDIR)/fake-target'
199 # need to set ownerships
200 # need to load koha.sql
201 # need to link koha-httpd.conf
202 # need to start z3950-daemon
209 This function lists all files and where to install each one.
210 It returns a hash reference suitable for the PM variable above.
219 C4/*.pm is copied to perl's lib namespace.
222 foreach my $src (glob("C4/*.pm")) {
223 $result{$src} = '$(INST_LIBDIR)/'.$src;
228 CGIs are copied to $(INSTALL_BASE)/lib/cgi-bin/koha/
229 and other scripts to koha/
232 foreach my $src ("mainpage.pl","help.pl","kohaversion.pl",glob("*/*.pl"),glob("installer/*"),glob("installer/*/*/*/*"),glob("installer/*/*/*/*/*"),glob("*/*/*.pl"),glob("*/*/*/*.pl"),glob("installer/*/*/*.sql"))
235 if ($src =~ /(misc|updater|rss)\//) {
236 $result{$src} = '$(INST_LIBDIR)/koha/'.$src;
238 $result{$src} = '$(INSTALL_BASE)/lib/cgi-bin/koha/'.$src;
245 Templates are copied to koha/templates,
248 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/*/*/*/*/*")) {
252 excluding non-files and whitespace in filenames.
255 if ((-f $src) && ($src !~ /(\s)/)) {
256 $result{$src} = '$(INST_LIBDIR)/koha/templates/'.$src;
262 etc files are copied to /usr/share/koha/etc/
265 # Misc etc to koha/etc
266 foreach my $src (glob("etc/zebradb/*/*/*"),glob("etc/zebradb/*/*"),glob("etc/zebradb/*"),glob("etc/*")) {
268 $result{$src} = '$(INSTALL_BASE)/share/koha/'.$src;
272 # set up zebra with the appropriate language and marc config
273 $result{"etc/zebradb/lang_defs/sort-string-$lang_value.chr"} = '$(INSTALL_BASE)/share/koha/etc/zebradb/etc/sort-string-utf.chr';
274 $result{"etc/zebradb/marc_defs/biblios-$marc_value.abs"} = '$(INSTALL_BASE)/share/koha/etc/zebradb/biblios/etc/record.abs';
275 $result{"etc/zebradb/marc_defs/authorities-$marc_value.abs"} = '$(INSTALL_BASE)/share/koha/etc/zebradb/authorities/etc/record.abs';
284 ExtUtils::MakeMaker(3)
288 MJ Ray mjr at phonecoop.coop