X-Git-Url: http://git.rot13.org/?a=blobdiff_plain;ds=sidebyside;f=configure.pl;h=f20682a93e02777b2e90fee5b37b6073133461da;hb=523fdef21f0ca0d691a0b8c95ca76b18a1adb60a;hp=0b8e030538cbb374b00ee4010b0945631f50a470;hpb=546f9691f118c9ea2d164f377994b4a018a60d02;p=BackupPC.git diff --git a/configure.pl b/configure.pl index 0b8e030..f20682a 100755 --- a/configure.pl +++ b/configure.pl @@ -19,7 +19,7 @@ # Craig Barratt # # COPYRIGHT -# Copyright (C) 2001-2004 Craig Barratt +# Copyright (C) 2001-2006 Craig Barratt # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -78,9 +78,7 @@ EOF } my %opts; -$opts{fhs} = 1; $opts{"set-perms"} = 1; -$opts{"backuppc-user"} = "backuppc"; if ( !GetOptions( \%opts, "batch", @@ -131,7 +129,7 @@ EOF # # InstallDir which includes subdirs bin, lib, doc # -# With FSH enabled (which is the default for new installations): +# With FHS enabled (which is the default for new installations): # # /etc/BackupPC/config.pl main config file (was $TopDir/conf/config.pl) # /etc/BackupPC/hosts hosts file (was $TopDir/conf/hosts) @@ -155,15 +153,16 @@ EOF # my $ConfigPath = ""; while ( 1 ) { - if ( $opts{fhs} && -f "/etc/BackupPC/config.pl" ) { + if ( -f "/etc/BackupPC/config.pl" ) { $ConfigPath = "/etc/BackupPC/config.pl"; + $opts{fhs} = 1 if ( !defined($opts{fhs}) ); } else { $ConfigPath = prompt("--> Full path to existing main config.pl", $ConfigPath, "config-path"); } last if ( $ConfigPath eq "" - || ($ConfigPath =~ /^\// && -r $ConfigPath && -w $ConfigPath) ); + || ($ConfigPath =~ /^\// && -f $ConfigPath && -w $ConfigPath) ); my $problem = "is not an absolute path"; $problem = "is not writable" if ( !-w $ConfigPath ); $problem = "is not readable" if ( !-r $ConfigPath ); @@ -175,6 +174,8 @@ while ( 1 ) { exit(1); } } +$opts{fhs} = 1 if ( !defined($opts{fhs}) && $ConfigPath eq "" ); +$opts{fhs} = 0 if ( !defined($opts{fhs}) ); my $bpc; if ( $ConfigPath ne "" && -r $ConfigPath ) { @@ -208,7 +209,6 @@ if ( $opts{fhs} ) { $Conf{ConfDir} ||= "/etc/BackupPC"; $Conf{InstallDir} ||= "/usr/local/BackupPC"; $Conf{LogDir} ||= "/var/log/BackupPC"; - $Conf{StatusDir} ||= "/var/lib/BackupPC"; } # @@ -497,7 +497,9 @@ exit unless prompt("--> Do you want to continue?", "y") =~ /y/i; # foreach my $dir ( qw(bin doc lib/BackupPC/CGI + lib/BackupPC/Config lib/BackupPC/Lang + lib/BackupPC/Storage lib/BackupPC/Xfer lib/BackupPC/Zip ) ) { @@ -535,7 +537,6 @@ foreach my $dir ( ( "$Conf{TopDir}/trash", "$Conf{ConfDir}", "$Conf{LogDir}", - "$Conf{StatusDir}", ) ) { mkpath("$DestDir/$dir", 0, 0750) if ( !-d "$DestDir/$dir" ); if ( !-d "$DestDir/$dir" @@ -547,56 +548,17 @@ foreach my $dir ( ( } printf("Installing binaries in $DestDir$Conf{InstallDir}/bin\n"); -foreach my $prog ( qw(BackupPC BackupPC_dump BackupPC_link BackupPC_nightly - BackupPC_sendEmail BackupPC_tarCreate BackupPC_trashClean - BackupPC_tarExtract BackupPC_compressPool BackupPC_zcat - BackupPC_archive BackupPC_archiveHost - BackupPC_restore BackupPC_serverMesg BackupPC_zipCreate ) ) { - InstallFile("bin/$prog", "$DestDir$Conf{InstallDir}/bin/$prog", 0555); +foreach my $prog ( qw( + __CONFIGURE_BIN_LIST__ + ) ) { + InstallFile($prog, "$DestDir$Conf{InstallDir}/$prog", 0555); } printf("Installing library in $DestDir$Conf{InstallDir}/lib\n"); foreach my $lib ( qw( - BackupPC/Lib.pm - BackupPC/FileZIO.pm - BackupPC/Attrib.pm - BackupPC/PoolWrite.pm - BackupPC/View.pm - BackupPC/Xfer/Archive.pm - BackupPC/Xfer/Tar.pm - BackupPC/Xfer/Smb.pm - BackupPC/Xfer/Rsync.pm - BackupPC/Xfer/RsyncDigest.pm - BackupPC/Xfer/RsyncFileIO.pm - BackupPC/Zip/FileMember.pm - BackupPC/Lang/en.pm - BackupPC/Lang/fr.pm - BackupPC/Lang/es.pm - BackupPC/Lang/de.pm - BackupPC/Lang/it.pm - BackupPC/Lang/nl.pm - BackupPC/CGI/AdminOptions.pm - BackupPC/CGI/Archive.pm - BackupPC/CGI/ArchiveInfo.pm - BackupPC/CGI/Browse.pm - BackupPC/CGI/DirHistory.pm - BackupPC/CGI/EmailSummary.pm - BackupPC/CGI/GeneralInfo.pm - BackupPC/CGI/HostInfo.pm - BackupPC/CGI/Lib.pm - BackupPC/CGI/LOGlist.pm - BackupPC/CGI/Queue.pm - BackupPC/CGI/ReloadServer.pm - BackupPC/CGI/RestoreFile.pm - BackupPC/CGI/RestoreInfo.pm - BackupPC/CGI/Restore.pm - BackupPC/CGI/StartServer.pm - BackupPC/CGI/StartStopBackup.pm - BackupPC/CGI/StopServer.pm - BackupPC/CGI/Summary.pm - BackupPC/CGI/View.pm + __CONFIGURE_LIB_LIST__ ) ) { - InstallFile("lib/$lib", "$DestDir$Conf{InstallDir}/lib/$lib", 0444); + InstallFile($lib, "$DestDir$Conf{InstallDir}/$lib", 0444); } if ( $Conf{CgiImageDir} ne "" ) { @@ -882,6 +844,8 @@ sub InstallFile s/__LOGDIR__/$Conf{LogDir}/g; s/__CONFDIR__/$Conf{ConfDir}/g; s/__TOPDIR__/$Conf{TopDir}/g; + s/^(\s*my \$useFHS\s*=\s*)\d;/${1}$opts{fhs};/ + if ( $prog =~ /Lib.pm/ ); s/__BACKUPPCUSER__/$Conf{BackupPCUser}/g; s/__CGIDIR__/$Conf{CgiDir}/g; if ( $first && /^#.*bin\/perl/ ) { @@ -1135,8 +1099,9 @@ final locations. =item B<--fhs> Use locations specified by the Filesystem Hierarchy Standard -for installing BackupPC. This is enabled by default. To -use the pre-3.0 installation locations, specify --no-fhs. +for installing BackupPC. This is enabled by default for new +installatios. To use the pre-3.0 installation locations, +specify --no-fhs. =item B<--help|?>