Skip to content
Newer
Older
100755 265 lines (203 sloc) 6.56 KB
d0cc4b2 New installer and exclusions file
slef authored
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
7d99474 Corrected CGI copy to include entire 'installer' subdir structure
Chris Nighswonger authored
20 #
21 # 2007-11-05 Corrected CGI copy to include entire 'installer' subdir structure. -fbcit
d0cc4b2 New installer and exclusions file
slef authored
22 use ExtUtils::MakeMaker;
23 use POSIX;
24
25 die "perl 5.6.1 or later required" unless ($] >= 5.006001);
26
27 =head1 NAME
28
29 Makefile.PL - Koha packager and installer
30
31 =head1 SYNOPSIS
32
61190e9 @mjray New installation instructions and release notes.
mjray authored
33 =head2 BASIC INSTALLATION
34
d96ae00 ytpo fixes in description and variables
slef authored
35 perl Makefile.PL
36 make
37 sudo make install
61190e9 @mjray New installation instructions and release notes.
mjray authored
38
39 =head2 PACKAGING RELEASE TARBALLS
40
d96ae00 ytpo fixes in description and variables
slef authored
41 make manifest tardist
42 make manifest zipdist
d0cc4b2 New installer and exclusions file
slef authored
43
61190e9 @mjray New installation instructions and release notes.
mjray authored
44 =head2 CLEANING UP
45
46 make clean
47
d0cc4b2 New installer and exclusions file
slef authored
48 =head1 DESCRIPTION
49
50 This is a packager and installer that uses
51 ExtUtils::MakeMaker, which is fairly common
52 on perl systems.
53 As well as building tar or zip files
61190e9 @mjray New installation instructions and release notes.
mjray authored
54 and installing with the above commands,
d0cc4b2 New installer and exclusions file
slef authored
55 it allows us to check pre-requisites
56 and generate configuration files.
57
58 =head1 VARIABLES
59
e449c13 @mjray Add configuration file helper to the installer
mjray authored
60 =head2 NAME, VERSION_FROM, ABSTRACT, AUTHOR
d0cc4b2 New installer and exclusions file
slef authored
61
62 Basic metadata about this software.
63
64 =head2 NO_META
65
66 Suppress generation of META.yml file.
67
68 =head2 PREREQ_PM
69
70 Hash of perl modules and versions required.
71
72 =head2 PM
73
74 Hash of file mappings
75
76 =head2 CONFIGURE
77
61190e9 @mjray New installation instructions and release notes.
mjray authored
78 Maybe use prompt() here in future to get configuration values
79 interactively at installation time.
d0cc4b2 New installer and exclusions file
slef authored
80
81 =head2 PL_FILES
82
83 This is a hash of PL scripts to run after installation and
84 the files to ask them to generate.
85 Maybe use the values from CONFIGURE
61190e9 @mjray New installation instructions and release notes.
mjray authored
86 to generate initial configuration files in future.
d0cc4b2 New installer and exclusions file
slef authored
87
88 =cut
89
90 WriteMakefile(
91
92 NAME => 'koha',
e449c13 @mjray Add configuration file helper to the installer
mjray authored
93 #VERSION => strftime('2.9.%Y%m%d%H',gmtime),
94 VERSION_FROM => 'C4/Context.pm',
d0cc4b2 New installer and exclusions file
slef authored
95 ABSTRACT => 'Award-winning integrated library system (ILS) and Web OPAC',
96 AUTHOR => 'Koha Developers <koha-devel@nongnu.org>',
97 NO_META => 1,
98 PREREQ_PM => {
99 'CGI' => 3.15,
100 'CGI::Carp' => 1.29,
6cdf083 new virtual shelves changes, keyed by biblionumber
Joshua Ferraro authored
101 'CGI::Session' => '4.10',
df38770 Add more modules - listed in about.pl but not "use"d anywhere.
slef authored
102 'Class::Accessor' => 0.30,
103 'DBD::mysql' => 3.0008,
d0cc4b2 New installer and exclusions file
slef authored
104 'DBI' => 1.53,
105 'Data::Dumper' => 2.121_08,
106 'Date::Calc' => 5.4,
107 'Date::Manip' => 5.44,
108 'Digest::MD5' => 2.36,
109 'File::Temp' => 0.16,
110 'GD::Barcode::UPCE' => 1.1,
111 'Getopt::Long' => 2.35,
112 'Getopt::Std' => 1.05,
113 'HTML::Template::Pro' => 0.65,
114 'HTTP::Cookies' => 1.39,
115 'HTTP::Request::Common' => 1.26,
116 'LWP::Simple' => 1.41,
117 'LWP::UserAgent' => 2.033,
118 'Lingua::Stem' => 0.82,
119 'List::Util' => 1.18,
120 'Locale::Language' => 2.07,
121 'MARC::Charset' => 0.95,
122 'MARC::File::XML' => 0.86,
123 'MARC::Record' => 1.38,
124 'MIME::Base64' => 3.07,
125 'MIME::QuotedPrint' => 3.07,
126 'Mail::Sendmail' => 0.79,
127 'PDF::API2' => 2.000,
128 'PDF::API2::Page' => 2.000,
129 'PDF::API2::Util' => 2.000,
130 'PDF::Reuse' => 0.33,
131 'PDF::Reuse::Barcode' => 0.05,
132 'POSIX' => 1.09,
8fcd2a6 fixing misplaced apostrophe
Joshua Ferraro authored
133 'Schedule::At' => 1.06,
d0cc4b2 New installer and exclusions file
slef authored
134 'Term::ANSIColor' => 1.10,
135 'Test' => 1.25,
136 'Test::Harness' => 2.56,
137 'Test::More' => 0.62,
310fdc3 adding missing dependancies (needed by scheduler & patron import)
Paul POULAIN authored
138 'Test::CSV' => 0.01,
d0cc4b2 New installer and exclusions file
slef authored
139 'Text::Wrap' => 2005.082401,
140 'Time::HiRes' => 1.86,
141 'Time::localtime' => 1.02,
142 'Unicode::Normalize' => 0.32,
310fdc3 adding missing dependancies (needed by scheduler & patron import)
Paul POULAIN authored
143 'XML::Dumper' => 0.81,
d0cc4b2 New installer and exclusions file
slef authored
144 'XML::LibXML' => 1.59,
145 'XML::SAX::ParserFactory' => 1.01,
146 'XML::Simple' => 2.14,
3ea77fd adding XML::RSS as mandatory package (to have RSS working)
tipaul authored
147 'XML::RSS' => 1.31,
71c2d3a updating install dependancies
Paul POULAIN authored
148 'ZOOM' => 1.16,
d0cc4b2 New installer and exclusions file
slef authored
149 },
150
151 # File tree mapping
152 PM => map_tree(),
153
a5a4196 @mjray Disable tests
mjray authored
154 # disable tests
155 'test' => {TESTS => 't/dummy.t'},
156
d0cc4b2 New installer and exclusions file
slef authored
157 # CONFIGURE => sub {
158 # # Ask for options with prompt($question,$default) calls here?
159 # return { macro => { 'export TEST' => '755' } }
160 # },
161
e449c13 @mjray Add configuration file helper to the installer
mjray authored
162 PL_FILES => { # generator => target(s)
163 'rewrite-config.PL' => [
243ec54 @mjray Move many files to more FHS-like paths
mjray authored
164 '$(PREFIX)/share/koha/etc/koha-conf.xml',
165 '$(PREFIX)/share/koha/etc/koha-httpd.conf',
89ab0be corrected path to zebra passwd file
Chris Nighswonger authored
166 '$(PREFIX)/share/koha/etc/zebradb/etc/passwd',
9eab9f1 @mjray Add more zebra configuration
mjray authored
167 '$(PREFIX)/share/koha/etc/zebradb/zebra-biblios.cfg',
168 '$(PREFIX)/share/koha/etc/zebradb/zebra-authorities.cfg'
e449c13 @mjray Add configuration file helper to the installer
mjray authored
169 ]
170 }
d0cc4b2 New installer and exclusions file
slef authored
171 # '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'],
172 # 'misc/koha.conf.PL' => '$(INST_LIBDIR)/../etc/koha.conf',
173 # 'misc/apache-koha.conf.PL' => '$(INST_LIBDIR)/../etc/apache-koha.conf',
174 # 'misc/koha.sql.PL' => '$(INST_LIBDIR)/intranet/scripts/koha.sql',
175 # 'z3950/z3950-daemon-options.PL' => '$(INST_LIBDIR)/intranet/scripts/z3950daemon/z3950-daemon-options',
176 # # fake target to check permissions
177 # 'misc/chmod.PL' => '$(INST_LIBDIR)/fake-target'
178 # }
179 # need to set ownerships
180 # need to load koha.sql
181 # need to link koha-httpd.conf
182 # need to start z3950-daemon
183 );
184
185 =head1 FUNCTIONS
186
187 =head2 map_tree
188
189 This function lists all files and where to install each one.
61190e9 @mjray New installation instructions and release notes.
mjray authored
190 It returns a hash reference suitable for the PM variable above.
d0cc4b2 New installer and exclusions file
slef authored
191
192 =cut
193
194 sub map_tree {
195 my %result => ();
196
197 =pod
198
199 C4/*.pm is copied to perl's lib namespace.
200
201 =cut
202 foreach my $src (glob("C4/*.pm")) {
203 $result{$src} = '$(INST_LIBDIR)/'.$src;
204 }
205
206 =pod
207
243ec54 @mjray Move many files to more FHS-like paths
mjray authored
208 CGIs are copied to $(PREFIX)/lib/cgi-bin/koha/
209 and other scripts to koha/
d0cc4b2 New installer and exclusions file
slef authored
210
211 =cut
781ad97 Corrected Makefile.PL to move kohaversion.pl to cgi-bin/koha
Chris Nighswonger authored
212 foreach my $src ("mainpage.pl","help.pl","kohaversion.pl",glob("*/*.pl"),glob("installer/*"),glob("installer/*/*/*/*"),glob("*/*/*.pl"),glob("*/*/*/*.pl")) {
d0cc4b2 New installer and exclusions file
slef authored
213 if ($src =~ /(misc|updater|rss)\//) {
243ec54 @mjray Move many files to more FHS-like paths
mjray authored
214 $result{$src} = '$(INST_LIBDIR)/koha/'.$src;
d0cc4b2 New installer and exclusions file
slef authored
215 } else {
243ec54 @mjray Move many files to more FHS-like paths
mjray authored
216 $result{$src} = '$(PREFIX)/lib/cgi-bin/koha/'.$src;
d0cc4b2 New installer and exclusions file
slef authored
217 }
218 }
219
220 =pod
221
222 Templates are copied to koha/templates,
223
224 =cut
225 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/*/*/*/*/*")) {
226
227 =pod
228
229 excluding non-files, CVS files and whitespace in filenames.
230
231 =cut
232 if ((-f $src) && ($src !~ /(\/CVS\/|\s)/)) {
233 $result{$src} = '$(INST_LIBDIR)/koha/templates/'.$src;
234 }
235 }
e449c13 @mjray Add configuration file helper to the installer
mjray authored
236 =pod
237
243ec54 @mjray Move many files to more FHS-like paths
mjray authored
238 etc files are copied to /usr/share/koha/etc/
e449c13 @mjray Add configuration file helper to the installer
mjray authored
239
240 =cut
241 # Misc etc to koha/etc
aeb17d6 @mjray BUGFIX: Handle etc/zebradb tree
mjray authored
242 foreach my $src (glob("etc/zebradb/*/*/*"),glob("etc/zebradb/*/*"),glob("etc/zebradb/*"),glob("etc/*")) {
243 if (-f $src) {
244 $result{$src} = '$(PREFIX)/share/koha/'.$src;
245 }
e449c13 @mjray Add configuration file helper to the installer
mjray authored
246 }
247
d0cc4b2 New installer and exclusions file
slef authored
248
249 return \%result;
250 }
251
252 __END__
253
254
255 =head1 SEE ALSO
256
257 ExtUtils::MakeMaker(3)
258
e449c13 @mjray Add configuration file helper to the installer
mjray authored
259 =head1 AUTHOR
260
261 MJ Ray mjr at phonecoop.coop
262
d0cc4b2 New installer and exclusions file
slef authored
263 =cut
264
Something went wrong with that request. Please try again.