script to update child to other member-catergory.
[koha.git] / Makefile.PL
blob7b59a44f4a9523e5ccddcb403e90dd412a2f12af
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
8 # version.
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;
23 use POSIX;
25 die "perl 5.6.1 or later required" unless ($] >= 5.006001);
27 =head1 NAME
29 Makefile.PL - Koha packager and installer
31 =head1 SYNOPSIS
33 =head2 BASIC INSTALLATION
35         perl Makefile.PL
36         make
37         sudo make install
39 =head2 PACKAGING RELEASE TARBALLS
41         make manifest tardist
42         make manifest zipdist
44 =head2 CLEANING UP
46         make clean
48 =head1 DESCRIPTION
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
54 and installing with the above commands,
55 it allows us to check pre-requisites
56 and generate configuration files.
58 =head1 VARIABLES
60 =head2 NAME, VERSION_FROM, ABSTRACT, AUTHOR
62 Basic metadata about this software.
64 =head2 NO_META
66 Suppress generation of META.yml file.
68 =head2 PREREQ_PM
70 Hash of perl modules and versions required.
72 =head2 PM
74 Hash of file mappings
76 =head2 CONFIGURE
78 Maybe use prompt() here in future to get configuration values 
79 interactively at installation time.
81 =head2 PL_FILES
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
86 to generate initial configuration files in future.
88 =cut
90 WriteMakefile(
92     NAME => 'koha',
93     #VERSION => strftime('2.9.%Y%m%d%H',gmtime),
94     VERSION_FROM => 'C4/Context.pm',
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 'Biblio::EndnoteStyle' => 0.05,
100 'CGI' => 3.15,
101 'CGI::Carp' => 1.29,
102 'CGI::Session' => '4.10',
103 'Class::Factory::Util' => 1.7,
104 'Class::Accessor' => 0.30,
105 'DBD::mysql' => 3.0008,
106 'DBI' => 1.53,
107 'Data::Dumper' => 2.121_08,
108 'Date::Calc' => 5.4,
109 'Date::Manip' => 5.44,
110 'Digest::MD5' => 2.36,
111 'File::Temp' => 0.16,
112 'GD::Barcode::UPCE' => 1.1,
113 'Getopt::Long' => 2.35,
114 'Getopt::Std' => 1.05,
115 'HTML::Template::Pro' => 0.65,
116 'HTTP::Cookies' => 1.39,
117 'HTTP::Request::Common' => 1.26,
118 'LWP::Simple' => 1.41,
119 'LWP::UserAgent' => 2.033,
120 'Lingua::Stem' => 0.82,
121 'List::Util' => 1.18,
122 'Locale::Language' => 2.07,
123 'MARC::Charset' => 0.98,
124 'MARC::Crosswalk::DublinCore' => 0.03,
125 'MARC::File::XML' => 0.88,
126 'MARC::Record' => 2.00,
127 'MARC::Crosswalk::DublinCore' => 0.02,
128 'MIME::Base64' => 3.07,
129 'MIME::QuotedPrint' => 3.07,
130 'Mail::Sendmail' => 0.79,
131 'Net::Z3950::ZOOM' => 1.16,
132 'PDF::API2' => 2.000,
133 'PDF::API2::Page' => 2.000,
134 'PDF::API2::Util' => 2.000,
135 'PDF::Reuse' => 0.33,
136 'PDF::Reuse::Barcode' => 0.05,
137 'POSIX' => 1.09,
138 'Schedule::At' => 1.06,
139 'Term::ANSIColor' => 1.10,
140 'Test' => 1.25,
141 'Test::Harness' => 2.56,
142 'Test::More' => 0.62,
143 'Text::CSV' => 0.01,
144 'Text::CSV_XS' => 0.32,
145 'Text::Wrap' => 2005.082401,
146 'Time::HiRes' => 1.86,
147 'Time::localtime' => 1.02,
148 'Unicode::Normalize' => 0.32,
149 'XML::Dumper' => 0.81,
150 'XML::LibXML' => 1.59,
151 'XML::LibXSLT' => 1.63,
152 'XML::SAX::ParserFactory' => 1.01,
153 'XML::Simple' => 2.14,
154 'XML::RSS' => 1.31,
155         },
157         # File tree mapping
158         PM => map_tree(),
160         # disable tests
161         'test' => {TESTS => 't/dummy.t'},
163 #   CONFIGURE => sub {
164 #     # Ask for options with prompt($question,$default) calls here?
165 #     return { macro => { 'export TEST' => '755' } }
166 #     },
168    PL_FILES => { # generator => target(s)
169       'rewrite-config.PL' => [
170          '$(PREFIX)/share/koha/etc/koha-conf.xml',
171          '$(PREFIX)/share/koha/etc/koha-httpd.conf',
172          '$(PREFIX)/share/koha/etc/zebradb/etc/passwd',
173          '$(PREFIX)/share/koha/etc/zebradb/zebra-biblios.cfg',
174          '$(PREFIX)/share/koha/etc/zebradb/zebra-authorities.cfg'
175          ]
176    }
177 #     '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'],
178 #     'misc/koha.conf.PL' => '$(INST_LIBDIR)/../etc/koha.conf',
179 #     'misc/apache-koha.conf.PL' => '$(INST_LIBDIR)/../etc/apache-koha.conf',
180 #     'misc/koha.sql.PL' => '$(INST_LIBDIR)/intranet/scripts/koha.sql',
181 #     'z3950/z3950-daemon-options.PL' => '$(INST_LIBDIR)/intranet/scripts/z3950daemon/z3950-daemon-options',
182 #     # fake target to check permissions
183 #     'misc/chmod.PL' => '$(INST_LIBDIR)/fake-target'
184 #     }
185    # need to set ownerships
186    # need to load koha.sql
187    # need to link koha-httpd.conf
188    # need to start z3950-daemon
191 =head1 FUNCTIONS
193 =head2 map_tree
195 This function lists all files and where to install each one.
196 It returns a hash reference suitable for the PM variable above.
198 =cut
200 sub map_tree {
201         my %result => ();
203 =pod
205 C4/*.pm is copied to perl's lib namespace.
207 =cut
208         foreach my $src (glob("C4/*.pm")) {
209                 $result{$src} = '$(INST_LIBDIR)/'.$src;
210         }
212 =pod
214 CGIs are copied to $(PREFIX)/lib/cgi-bin/koha/
215 and other scripts to koha/
217 =cut
218         foreach my $src ("mainpage.pl","help.pl","kohaversion.pl",glob("*/*.pl"),glob("installer/*"),glob("installer/*/*/*/*"),glob("*/*/*.pl"),glob("*/*/*/*.pl")) {
219                 if ($src =~ /(misc|updater|rss)\//) {
220                         $result{$src} = '$(INST_LIBDIR)/koha/'.$src;
221                 } else {
222                         $result{$src} = '$(PREFIX)/lib/cgi-bin/koha/'.$src;
223                 }
224         }
226 =pod
228 Templates are copied to koha/templates,
230 =cut
231         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/*/*/*/*/*")) {
233 =pod
235 excluding non-files and whitespace in filenames.
237 =cut
238                 if ((-f $src) && ($src !~ /(\s)/)) {
239                         $result{$src} = '$(INST_LIBDIR)/koha/templates/'.$src;
240                 }
241         }
242 =pod
244 etc files are copied to /usr/share/koha/etc/
246 =cut
247         # Misc etc to koha/etc
248         foreach my $src (glob("etc/zebradb/*/*/*"),glob("etc/zebradb/*/*"),glob("etc/zebradb/*"),glob("etc/*")) {
249                 if (-f $src) {
250                         $result{$src} = '$(PREFIX)/share/koha/'.$src;
251                 }
252         }
255         return \%result;
258 __END__
261 =head1 SEE ALSO
263 ExtUtils::MakeMaker(3)
265 =head1 AUTHOR
267 MJ Ray mjr at phonecoop.coop
269 =cut