5 use File::Path qw(make_path);
10 my $source = File::Spec->rel2abs('.');
11 my $destination = $ARGV[0];
13 make_path("$destination/var/lock/zebradb");
14 make_path("$destination/var/lock/zebradb/biblios");
15 make_path("$destination/var/lock/zebradb/authorities");
16 make_path("$destination/var/lib/zebradb");
17 make_path("$destination/var/lib/zebradb/biblios");
18 make_path("$destination/var/lib/zebradb/biblios/key");
19 make_path("$destination/var/lib/zebradb/biblios/register");
20 make_path("$destination/var/lib/zebradb/biblios/shadow");
21 make_path("$destination/var/lib/zebradb/biblios/tmp");
22 make_path("$destination/var/lib/zebradb/authorities");
23 make_path("$destination/var/lib/zebradb/authorities/key");
24 make_path("$destination/var/lib/zebradb/authorities/register");
25 make_path("$destination/var/lib/zebradb/authorities/shadow");
26 make_path("$destination/var/lib/zebradb/authorities/tmp");
27 make_path("$destination/var/run/zebradb");
29 $ENV{'INSTALL_BASE'} = $destination;
30 $ENV{'__INSTALL_BASE__'} = $destination;
32 my @files = ( "$source/etc/koha-conf.xml" );
34 find(sub { push @files, $File::Find::name if ( -f $File::Find::name ); }, "$source/etc/zebradb");
36 foreach my $file (@files) {
38 $target =~ s#$source#$destination#;
39 $target =~ s#etc/zebradb#etc/koha/zebradb#;
41 make_path(dirname($target));
42 copy("$file", "$target");
43 system("perl $source/rewrite-config.PL $target");
44 if ($file =~ m/xml/) {
45 replace("$target", "$destination/intranet/templates", "$source/koha-tmpl/intranet-tmpl");
51 my ($file, $pattern, $replacement) = @_;
52 system("sed -i -e 's#$pattern#$replacement#' $file");