View | Details | Raw Unified | Return to bug 13586
Collapse All | Expand All

(-)a/Makefile.PL (-25 / +8 lines)
Lines 451-463 my %config_defaults = ( Link Here
451
451
452
warn "Your platform appears to be $^O.\n" if $DEBUG;
452
warn "Your platform appears to be $^O.\n" if $DEBUG;
453
453
454
if ( $^O eq 'MSWin32' ) {
454
if ( $^O eq 'cygwin' ) {
455
	# Most Unix2Win32 ports seem to poke everything into the Program Files directory
456
	# this could be changed to put some files (ie. libraries) into system32, etc.
457
	$config_defaults{'INSTALL_MODE'} = 'single';
458
	$config_defaults{'INSTALL_BASE'} = 'c:/progra~1/koha';	# Use 8.3 names to be safe...
459
}
460
elsif ( $^O eq 'cygwin' ) {
461
	# Most Unix2Win32 ports seem to poke everything into the Program Files directory
455
	# Most Unix2Win32 ports seem to poke everything into the Program Files directory
462
	# this could be changed to put some files (ie. libraries) into system32, etc.
456
	# this could be changed to put some files (ie. libraries) into system32, etc.
463
	$config_defaults{'INSTALL_MODE'} = 'single';
457
	$config_defaults{'INSTALL_MODE'} = 'single';
Lines 1208-1216 sub get_target_directories { Link Here
1208
1202
1209
    my @basedir = File::Spec->splitdir($directories);
1203
    my @basedir = File::Spec->splitdir($directories);
1210
1204
1211
	# for Win32 we need to prepend the volume to the directory path
1205
	if ( $^O eq 'cygwin' ) { shift @basedir; unshift @basedir, 'c:'; }   # in a cygwin environment, $volume is returned empty
1212
	if ( $^O eq 'MSWin32' ) { shift @basedir; unshift @basedir, $volume; }
1213
	elsif ( $^O eq 'cygwin' ) { shift @basedir; unshift @basedir, 'c:'; }   # in a cygwin environment, $volume is returned empty
1214
1206
1215
    my $package = pop @basedir;
1207
    my $package = pop @basedir;
1216
1208
Lines 1299-1305 sub get_target_directories { Link Here
1299
1291
1300
    _get_env_overrides(\%dirmap);
1292
    _get_env_overrides(\%dirmap);
1301
    _get_argv_overrides(\%dirmap);
1293
    _get_argv_overrides(\%dirmap);
1302
    _add_destdir(\%dirmap) unless ($^O eq 'MSWin32');
1294
    _add_destdir(\%dirmap);
1303
1295
1304
    return \%dirmap, \%skipdirs;
1296
    return \%dirmap, \%skipdirs;
1305
}
1297
}
Lines 1481-1489 install :: all install_koha set_koha_ownership set_koha_permissions warn_koha_en Link Here
1481
          unless exists $skip_directories->{$key};
1473
          unless exists $skip_directories->{$key};
1482
			}
1474
			}
1483
	}
1475
	}
1484
	elsif ($^O eq 'MSWin32' ) {	# On Win32, the install probably needs to be done under the user account koha will be running as...
1485
								# We can attempt some creative things with command line utils such as CACLS which allows permission
1476
								# We can attempt some creative things with command line utils such as CACLS which allows permission
1486
								# management from Win32 cmd.exe, but permissions really only apply to NTFS.
1477
1487
	    foreach my $key (sort keys %$target_directories) {
1478
	    foreach my $key (sort keys %$target_directories) {
1488
		    $install .= qq(
1479
		    $install .= qq(
1489
KOHA_INST_$key = blib/$key
1480
KOHA_INST_$key = blib/$key
Lines 1500-1506 install :: all install_koha warn_koha_env_vars Link Here
1500
			$install .= "\t\t\$(KOHA_INST_$key) \$(KOHA_DEST_$key) \\\n"
1491
			$install .= "\t\t\$(KOHA_INST_$key) \$(KOHA_DEST_$key) \\\n"
1501
        unless exists $skip_directories->{$key};
1492
        unless exists $skip_directories->{$key};
1502
		}
1493
		}
1503
	}
1494
1504
	$install .= "\n";
1495
	$install .= "\n";
1505
1496
1506
    $install .= "warn_koha_env_vars ::\n";
1497
    $install .= "warn_koha_env_vars ::\n";
Lines 1535-1544 sub _update_zebra_conf_target { Link Here
1535
    my $target = "\nupdate_zebra_conf ::\n";
1526
    my $target = "\nupdate_zebra_conf ::\n";
1536
    $target .= "\tumask 022; \$(MOD_INSTALL) \\\n";
1527
    $target .= "\tumask 022; \$(MOD_INSTALL) \\\n";
1537
    $target .= "\t\t\$(KOHA_INST_ZEBRA_CONF_DIR) \$(KOHA_DEST_ZEBRA_CONF_DIR) \n";
1528
    $target .= "\t\t\$(KOHA_INST_ZEBRA_CONF_DIR) \$(KOHA_DEST_ZEBRA_CONF_DIR) \n";
1538
    $target .= "\t\$(NOECHO) chmod -R u+w \$(KOHA_DEST_ZEBRA_CONF_DIR)\n" unless $^O eq "MSWin32";
1529
    $target .= "\t\$(NOECHO) chmod -R u+w \$(KOHA_DEST_ZEBRA_CONF_DIR)\n";
1539
    $target .= "\tumask 022; \$(MOD_INSTALL) \\\n";
1530
    $target .= "\tumask 022; \$(MOD_INSTALL) \\\n";
1540
    $target .= "\t\t\$(KOHA_INST_PAZPAR2_CONF_DIR) \$(KOHA_DEST_PAZPAR2_CONF_DIR) \n";
1531
    $target .= "\t\t\$(KOHA_INST_PAZPAR2_CONF_DIR) \$(KOHA_DEST_PAZPAR2_CONF_DIR) \n";
1541
    $target .= "\t\$(NOECHO) chmod -R u+w \$(KOHA_DEST_PAZPAR2_CONF_DIR)\n" unless $^O eq "MSWin32";
1532
    $target .= "\t\$(NOECHO) chmod -R u+w \$(KOHA_DEST_PAZPAR2_CONF_DIR)\n";
1542
1533
1543
    return $target;
1534
    return $target;
1544
}
1535
}
Lines 1573-1579 make_upgrade_backup :: Link Here
1573
1564
1574
    return $upgrade;
1565
    return $upgrade;
1575
}
1566
}
1576
1577
sub postamble {
1567
sub postamble {
1578
    # put directory mappings into Makefile
1568
    # put directory mappings into Makefile
1579
    # so that Make will export as environment
1569
    # so that Make will export as environment
Lines 1582-1594 sub postamble { Link Here
1582
1572
1583
    my $env;
1573
    my $env;
1584
	# Hereagain, we must alter syntax per platform...
1574
	# Hereagain, we must alter syntax per platform...
1585
	if ( $^O eq 'MSWin32' ) {
1575
        {
1586
		# NOTE: it is imperative that there be no whitespaces in ENV=value...
1587
		$env = join("\n", map { "__${_}__=$target_directories->{$_}" } keys %$target_directories);
1588
		$env .= "\n\n";
1589
		$env .= join("\n", map { "__${_}__=$config{$_}" } keys %config);
1590
	}
1591
    else {
1592
		$env = join("\n", map { "export __${_}__ := $target_directories->{$_}" } keys %$target_directories);
1576
		$env = join("\n", map { "export __${_}__ := $target_directories->{$_}" } keys %$target_directories);
1593
		$env .= "\n\n";
1577
		$env .= "\n\n";
1594
		$env .= join("\n", map { "export __${_}__ := $config{$_}" } keys %config);
1578
		$env .= join("\n", map { "export __${_}__ := $config{$_}" } keys %config);
1595
- 

Return to bug 13586