(bug #3458) fix die and unimarc 700-4 plugin
[koha.git] / install-CPAN.pl
blobcd78896c36cdd203701d97d5b693c96508559847
1 # cpan_install.pl - Install prerequisites from CPAN then Koha
3 ($ARGV[0] =~ /koha-.*z/) || die "
4 Run this as the CPAN-owning user (usually root) with:
5 perl $0 path/to/koha.tgz
6 ";
8 # Copyright 2007 MJ Ray
10 # This file is part of Koha.
12 # Koha is free software; you can redistribute it and/or modify it under the
13 # terms of the GNU General Public License as published by the Free Software
14 # Foundation; either version 2 of the License, or (at your option) any later
15 # version.
17 # Koha is distributed in the hope that it will be useful, but WITHOUT ANY
18 # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
19 # A PARTICULAR PURPOSE. See the GNU General Public License for more details.
21 # You should have received a copy of the GNU General Public License along with
22 # Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
23 # Suite 330, Boston, MA 02111-1307 USA
25 # Current maintainer MJR http://mjr.towers.org.uk/
26 # See http://www.koha.org/wiki/?page=KohaInstaller
28 # Create a fake CPAN location for koha
29 use CPAN;
30 CPAN::Config->load;
31 $cpan = $CPAN::Config->{cpan_home};
32 mkdir $cpan.'/sources/authors/id';
33 mkdir $cpan.'/sources/authors/id/K';
34 mkdir $cpan.'/sources/authors/id/K/KO';
35 mkdir $cpan.'/sources/authors/id/K/KO/KOHA';
37 # Move the tarball to it
38 $koha = $ARGV[0];
39 ( rename $koha,$cpan.'/sources/authors/id/K/KO/KOHA/'.$koha ) ||
40 die 'Cannot move koha distribution into position.
41 This may be due to an unconfigured CPAN or running as the wrong user.
42 To configure cpan, try perl -MCPAN -e shell
43 Installation aborted';
45 # Start the main CPAN install routine
46 CPAN::install('KOHA/'.$koha);