Updated CVS_README
[BackupPC.git] / configure.pl
index b19f83d..784f944 100755 (executable)
@@ -37,7 +37,7 @@
 #
 #========================================================================
 #
-# Version 2.1.0beta1, released 9 Apr 2004.
+# Version 3.0.0alpha, released 23 Jan 2006
 #
 # See http://backuppc.sourceforge.net.
 #
@@ -129,13 +129,14 @@ EOF
 #                
 #    InstallDir   which includes subdirs bin, lib, doc
 #
-# With FHS enabled (which is the default for new installations):
+# With FHS enabled (which is the default for new installations)
+# the config files move to /etc/BackupPC and log files to /var/log:
 #
 #    /etc/BackupPC/config.pl  main config file (was $TopDir/conf/config.pl)
 #    /etc/BackupPC/hosts      hosts file (was $TopDir/conf/hosts)
 #    /etc/BackupPC/pc/HOST.pl per-pc config file (was $TopDir/pc/HOST/config.pl)
 #    /var/log/BackupPC        log files (was $TopDir/log)
-#    /var/lib/BackupPC        Pid, status and email info (was $TopDir/log)
+#    /var/log/BackupPC        Pid, status and email info (was $TopDir/log)
 #
 
 print <<EOF if ( !$opts{fhs} || !-f "/etc/BackupPC/config.pl" );
@@ -185,9 +186,12 @@ if ( $ConfigPath ne "" && -r $ConfigPath ) {
     %Conf = $bpc->Conf();
     %OrigConf = %Conf;
     if ( !$opts{fhs} ) {
-        ($Conf{TopDir} = $ConfigPath) =~ s{/[^/]+/[^/]+$}{};
+        ($Conf{TopDir} = $ConfigPath) =~ s{/[^/]+/[^/]+$}{}
+                    if ( $Conf{TopDir} eq '' );
+        $bpc->{LogDir} = $Conf{LogDir}  = "$Conf{TopDir}/log"
+                    if ( $Conf{LogDir} eq '' );
     }
-    $Conf{ConfDir} = $confDir;
+    $bpc->{ConfDir} = $Conf{ConfDir} = $confDir;
     my $err = $bpc->ServerConnect($Conf{ServerHost}, $Conf{ServerPort}, 1);
     if ( $err eq "" ) {
         print <<EOF;
@@ -548,60 +552,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/FileZIO.pm
-       BackupPC/Attrib.pm
-        BackupPC/PoolWrite.pm
-       BackupPC/Lib.pm
-       BackupPC/Storage.pm
-       BackupPC/View.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
-       BackupPC/Config/Meta.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/Storage/Text.pm
-       BackupPC/Xfer/Archive.pm
-       BackupPC/Xfer/BackupPCd.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
+        __CONFIGURE_LIB_LIST__
     ) ) {
-    InstallFile("lib/$lib", "$DestDir$Conf{InstallDir}/lib/$lib", 0444);
+    InstallFile($lib, "$DestDir$Conf{InstallDir}/$lib", 0444);
 }
 
 if ( $Conf{CgiImageDir} ne "" ) {
@@ -887,7 +848,8 @@ sub InstallFile
            s/__LOGDIR__/$Conf{LogDir}/g;
            s/__CONFDIR__/$Conf{ConfDir}/g;
            s/__TOPDIR__/$Conf{TopDir}/g;
-           s/__USEFHS__/$opts{fhs}/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/ ) {
@@ -1233,7 +1195,7 @@ Craig Barratt <cbarratt@users.sourceforge.net>
 
 =head1 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