5 use File::Path qw(make_path);
10 my $source = File::Spec->rel2abs('.');
11 my $destination = File::Spec->rel2abs('.') . "/t/db_dependent/data";
13 make_path("$destination/var/lock/zebradb");
14 make_path("$destination/var/lib/zebradb");
15 make_path("$destination/var/run/zebradb");
17 $ENV{'INSTALL_BASE'} = $destination;
18 $ENV{'__INSTALL_BASE__'} = $destination;
20 my @files = ( "$source/etc/koha-conf.xml" );
22 find(sub { push @files, $File::Find::name if ( -f $File::Find::name ); }, "$source/etc/zebradb");
24 foreach my $file (@files) {
26 $target =~ s#$source#$destination#;
27 $target =~ s#etc/zebradb#etc/koha/zebradb#;
29 make_path(dirname($target));
30 copy("$file", "$target");
31 system("perl $source/rewrite-config.PL $target");
32 if ($file =~ m/xml/) {
33 replace("$target", "$destination/intranet/templates", "$source/koha-tmpl/intranet-tmpl");
39 my ($file, $pattern, $replacement) = @_;
40 system("sed -i -e 's#$pattern#$replacement#' $file");