--- /dev/null
+DIST BackupPC-3.3.0.tar.gz 554155 SHA256 8a9c1b6faa4502b4c40617be97e806813815d9e22544854d99983c3da7c1f69b SHA512 67ec1ca4d22ab1e81f9c0f409c758347a6c772e3d1aa39c93207f9d328176ac7b4e679d0b03972fc5870c37dde0480d28c61ae19975d54e144235ea0e84e9901 WHIRLPOOL 23a9ce5dd600843cea72354e1afe595e3779f883839f8d3feca7f1355ed20048026090097ddfbcf394632672b42bef4884bc6661203542d6fe2c6bc2e8ad7b96
--- /dev/null
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+
+inherit eutils systemd webapp user
+
+MY_P="BackupPC-${PV}"
+
+DESCRIPTION="A high-performance system for backing up computers to a server's disk"
+HOMEPAGE="http://backuppc.sourceforge.net/"
+SRC_URI="mirror://sourceforge/${PN}/${MY_P}.tar.gz"
+
+LICENSE="GPL-2"
+KEYWORDS="amd64 x86"
+
+IUSE="rss samba"
+
+DEPEND="dev-lang/perl
+ app-admin/apache-tools
+ app-admin/makepasswd"
+RDEPEND="${DEPEND}
+ virtual/perl-IO-Compress
+ dev-perl/Archive-Zip
+ dev-perl/libwww-perl
+ >=app-arch/tar-1.13.20
+ app-arch/par2cmdline
+ app-arch/gzip
+ app-arch/bzip2
+ virtual/mta
+ www-apache/mod_perl
+ www-servers/apache
+ net-misc/rsync
+ >=dev-perl/File-RsyncP-0.68
+ rss? ( dev-perl/XML-RSS )
+ samba? ( net-fs/samba )"
+
+WEBAPP_MANUAL_SLOT="yes"
+SLOT="0"
+
+S=${WORKDIR}/${MY_P}
+
+CONFDIR="/etc/BackupPC"
+DATADIR="/var/lib/backuppc"
+LOGDIR="/var/log/BackupPC"
+
+pkg_setup() {
+ webapp_pkg_setup
+ enewgroup backuppc
+ enewuser backuppc -1 /bin/bash /var/lib/backuppc backuppc
+}
+
+src_prepare() {
+ epatch "${FILESDIR}/3.3.0/01-fix-configure.pl.patch"
+ epatch "${FILESDIR}/3.3.0/02-fix-config.pl-formatting.patch"
+ epatch "${FILESDIR}/3.3.0/03-reasonable-config.pl-defaults.patch"
+
+ # Fix the documentation location in the CGI interface
+ epatch "${FILESDIR}/3.2.0/04-add-docdir-marker.patch"
+ sed -i "s+__DOCDIR__+/usr/share/doc/${PF}+" "lib/BackupPC/CGI/View.pm"
+
+ epatch "${FILESDIR}/3.2.0/05-nicelevel.patch"
+ sed -i -e 's/--chuid ${USER}//' "${S}"/init.d/src/gentoo-backuppc || die "Failed to fix the init script"
+}
+
+src_test() {
+ true
+}
+
+src_install() {
+ webapp_src_preinst
+
+ local myconf
+ myconf=""
+ if use samba ; then
+ myconf="--bin-path smbclient=$(type -p smbclient)"
+ myconf="${myconf} --bin-path nmblookup=$(type -p nmblookup)"
+ fi
+
+ /usr/bin/env perl ./configure.pl \
+ --batch \
+ --bin-path perl=$(type -p perl) \
+ --bin-path tar=$(type -p tar) \
+ --bin-path rsync=$(type -p rsync) \
+ --bin-path ping=$(type -p ping) \
+ --bin-path df=$(type -p df) \
+ --bin-path ssh=$(type -p ssh) \
+ --bin-path sendmail=$(type -p sendmail) \
+ --bin-path hostname=$(type -p hostname) \
+ --bin-path gzip=$(type -p gzip) \
+ --bin-path bzip2=$(type -p bzip2) \
+ --config-dir ${CONFDIR} \
+ --install-dir /usr \
+ --data-dir ${DATADIR} \
+ --hostname $(hostname) \
+ --uid-ignore \
+ --dest-dir "${D%/}" \
+ --html-dir ${MY_HTDOCSDIR}/image \
+ --html-dir-url /image \
+ --cgi-dir ${MY_HTDOCSDIR} \
+ --fhs \
+ ${myconf} || die "failed the configure.pl script"
+
+ ebegin "Installing documentation"
+
+ pod2man \
+ -errors=none \
+ --section=8 \
+ --center="BackupPC manual" \
+ "${S}"/doc/BackupPC.pod backuppc.8 || die "failed to generate man page"
+
+ doman backuppc.8
+
+ # Place the documentation in the correct location
+ dodoc "${D}/usr/doc/BackupPC.html"
+ dodoc "${D}/usr/doc/BackupPC.pod"
+ rm -rf "${D}/usr/doc"
+
+ eend 0
+
+ # Setup directories
+ dodir ${CONFDIR}/pc
+
+ keepdir ${CONFDIR}
+ keepdir ${CONFDIR}/pc
+ keepdir ${DATADIR}/{trash,pool,pc,cpool}
+ keepdir ${LOGDIR}
+
+ ebegin "Setting up init.d/conf.d/systemd scripts"
+ newinitd "${S}"/init.d/gentoo-backuppc backuppc
+ newconfd "${S}"/init.d/gentoo-backuppc.conf backuppc
+ systemd_dounit "${FILESDIR}/${PN}.service"
+ eend 0
+
+ ebegin "Setting up an apache instance for backuppc"
+
+ cp "${FILESDIR}/apache2-backuppc."{conf,init} "${WORKDIR}/"
+ cp "${FILESDIR}/httpd.conf" "${WORKDIR}/httpd.conf"
+ sed -i -e "s+HTDOCSDIR+${MY_HTDOCSDIR}+g" "${WORKDIR}/httpd.conf"
+ sed -i -e "s+AUTHFILE+${CONFDIR}/users.htpasswd+g" "${WORKDIR}/httpd.conf"
+
+ moduledir="/usr/lib/apache2/modules"
+
+ # Check if the Apache ServerRoot is real.
+ # This is sometimes broken on older amd64 systems.
+ # In this case we just patch our config file appropriately.
+ if [[ ! -d "/usr/lib/apache2" ]]; then
+ if [[ -d "/usr/lib64/apache2" ]]; then
+ sed -i -e "s+/usr/lib/apache2+/usr/lib64/apache2+g" "${WORKDIR}/httpd.conf"
+ sed -i -e "s+/usr/lib/apache2+/usr/lib64/apache2+g" "${WORKDIR}/apache2-backuppc.conf"
+ moduledir="/usr/lib64/apache2/modules"
+ fi
+ fi
+
+ # Check if we're using mod_cgid instead of mod_cgi
+ # This happens if you install apache with USE="threads"
+ if [[ -f "${moduledir}/mod_cgid.so" ]]; then
+ sed -i -e "s+mod_cgi+mod_cgid+g" "${WORKDIR}/httpd.conf"
+ sed -i -e "s+cgi_module+cgid_module+g" "${WORKDIR}/httpd.conf"
+ fi
+
+ # Install conf.d/init.d files for apache2-backuppc
+ if [ -e /etc/init.d/apache2 ]; then
+ newconfd "${WORKDIR}/apache2-backuppc.conf" apache2-backuppc
+ newinitd /etc/init.d/apache2 apache2-backuppc
+ else
+ newconfd "${WORKDIR}/apache2-backuppc.conf" apache2-backuppc
+ newinitd "${WORKDIR}/apache2-backuppc.init" apache2-backuppc
+ fi
+
+ insopts -m 0644
+ insinto ${CONFDIR}
+ doins "${WORKDIR}/httpd.conf"
+
+ eend $?
+
+ webapp_src_install || die "webapp_src_install"
+
+ # Make sure that the ownership is correct
+ chown -R backuppc:backuppc "${D}${CONFDIR}"
+ chown -R backuppc:backuppc "${D}${DATADIR}"
+ chown -R backuppc:backuppc "${D}${LOGDIR}"
+}
+
+pkg_postinst() {
+ # This is disabled since BackupPC doesn't need it
+ # webapp_pkg_postinst
+
+ elog "Installation finished, now may now start using BackupPC."
+ elog ""
+ elog "- Read the documentation in /usr/share/doc/${PF}/BackupPC.html"
+ elog " Please pay special attention to the security section."
+ elog ""
+ elog "- You can launch backuppc and it's apache web interface by running:"
+ elog " # /etc/init.d/backuppc start"
+ elog " # /etc/init.d/apache2-backuppc start"
+
+ if [[ ! -e /etc/runlevels/default/backuppc ]]; then
+ elog ""
+ elog "- You also might want to add these scripts to your default runlevel:"
+ elog " # rc-update add backuppc default"
+ elog " # rc-update add apache2-backuppc default"
+ fi
+
+ # Generate a new password if there's no auth file
+ if [[ ! -f "${CONFDIR}/users.htpasswd" ]]; then
+ adminuser="backuppc"
+ adminpass=$( makepasswd --chars=12 )
+ htpasswd -bc "${CONFDIR}/users.htpasswd" $adminuser $adminpass
+
+ elog ""
+ elog "- Created admin user $adminuser with password $adminpass"
+ elog " To add new users, run: "
+ elog " # htpasswd ${CONFDIR}/users.htpasswd newUser"
+ fi
+
+ if [[ -d "/etc/backuppc" ]]; then
+ ewarn ""
+ ewarn "Detected old config directory in /etc/backuppc"
+ ewarn "Please migrate relevant config files to ${CONFDIR} before starting backuppc"
+ fi
+}
--- /dev/null
+--- configure.pl.orig 2010-07-31 20:52:58.000000000 +0300
++++ configure.pl 2010-09-03 22:09:46.437788435 +0300
+@@ -158,7 +158,7 @@
+ # config file to get all the defaults.
+ #
+ my $ConfigPath = "";
+-my $ConfigFileOK = 1;
++my $ConfigFileOK = 0;
+ while ( 1 ) {
+ if ( $ConfigFileOK && -f "/etc/BackupPC/config.pl" ) {
+ $ConfigPath = "/etc/BackupPC/config.pl";
+@@ -213,7 +213,8 @@
+ $bpc->{LogDir} = $Conf{LogDir} = "$Conf{TopDir}/log"
+ if ( $Conf{LogDir} eq '' );
+ }
+- $bpc->{ConfDir} = $Conf{ConfDir} = $confDir;
++ # Disable this as it's not really neccessary for this ebuild
++ # $bpc->{ConfDir} = $Conf{ConfDir} = $confDir;
+ my $err = $bpc->ServerConnect($Conf{ServerHost}, $Conf{ServerPort}, 1);
+ if ( $err eq "" ) {
+ print <<EOF;
+@@ -726,7 +727,7 @@
+ if ( $Conf{CgiDir} =~ m{cgi-bin(/.*)} ) {
+ $Conf{CgiURL} = "'http://$Conf{ServerHost}/cgi-bin$1/BackupPC_Admin'";
+ } else {
+- $Conf{CgiURL} = "'http://$Conf{ServerHost}/cgi-bin/BackupPC_Admin'";
++ $Conf{CgiURL} = "'http://$Conf{ServerHost}/BackupPC_Admin'";
+ }
+ }
+
--- /dev/null
+--- conf/config.pl.formatted 2010-09-03 23:09:13.035788559 +0300
++++ conf/config.pl 2010-09-03 23:10:19.314788450 +0300
+@@ -1319,6 +1319,8 @@
+ '--times',
+ '--block-size=2048',
+ '--recursive',
++ '--specials',
++ '--checksum-seed=32761',
+ ];
+
+ #
+@@ -1385,6 +1387,8 @@
+ '--relative',
+ '--ignore-times',
+ '--recursive',
++ '--specials',
++ '--checksum-seed=32761',
+ ];
+
+ ###########################################################################
+@@ -2015,7 +2019,7 @@
+ # --> administrative users are only craig and celia'.
+ #
+ $Conf{CgiAdminUserGroup} = '';
+-$Conf{CgiAdminUsers} = '';
++$Conf{CgiAdminUsers} = 'backuppc';
+
+ #
+ # URL of the BackupPC_Admin CGI script. Used for email messages.
+@@ -2062,7 +2066,7 @@
+ # dates (MM/DD), a value of 2 uses full YYYY-MM-DD format, and zero
+ # for international dates (DD/MM).
+ #
+-$Conf{CgiDateFormatMMDD} = 1;
++$Conf{CgiDateFormatMMDD} = 2;
+
+ #
+ # If set, the complete list of hosts appears in the left navigation
+@@ -2248,7 +2252,7 @@
+ ClientTimeout => 1,
+ MaxOldPerPCLogFiles => 1,
+ CompressLevel => 1,
+- ClientNameAlias => 1,
++ ClientNameAlias => 0,
+ DumpPreUserCmd => 0,
+ DumpPostUserCmd => 0,
+ RestorePreUserCmd => 0,
--- /dev/null
+--- lib/BackupPC/CGI/View.pm.orig 2009-09-30 19:08:34.353577546 +0300
++++ lib/BackupPC/CGI/View.pm 2009-09-30 19:16:01.982412712 +0300
+@@ -86,7 +86,7 @@
+ $file = $bpc->ConfDir() . "/hosts";
+ $linkHosts = 1;
+ } elsif ( $type eq "docs" ) {
+- $file = $bpc->InstallDir() . "/doc/BackupPC.html";
++ $file = "__DOCDIR__/BackupPC.html";
+ } elsif ( $host ne "" ) {
+ if ( !defined($In{num}) ) {
+ # get the latest LOG file
--- /dev/null
+--- init.d/src/gentoo-backuppc.orig 2009-10-18 00:14:44.125346723 +0300
++++ init.d/src/gentoo-backuppc 2009-10-18 00:15:37.101346981 +0300
+@@ -21,7 +21,7 @@
+ start() {
+ checkconfig || return 1
+ ebegin "Starting BackupPC"
+- start-stop-daemon --start --chuid ${USER} --user ${USER} --pidfile ${PID_FILE} --exec ${EXEC} -- ${EXEC_OPTIONS}
++ start-stop-daemon --start --chuid ${USER} --user ${USER} --nicelevel ${NICELEVEL} --pidfile ${PID_FILE} --exec ${EXEC} -- ${EXEC_OPTIONS}
+ eend $?
+ }
+
+--- init.d/src/gentoo-backuppc.conf.orig 2009-10-18 00:14:52.513347638 +0300
++++ init.d/src/gentoo-backuppc.conf 2009-10-18 00:16:03.457346630 +0300
+@@ -3,3 +3,4 @@
+ PID_FILE=__LOGDIR__/BackupPC.pid
+ EXEC=__INSTALLDIR__/bin/BackupPC
+ EXEC_OPTIONS=-d
++NICELEVEL=0
--- /dev/null
+--- configure.pl.dist 2013-09-23 23:01:19.524743747 +0300
++++ configure.pl 2013-09-23 23:01:37.344567459 +0300
+@@ -158,7 +158,7 @@
+ # config file to get all the defaults.
+ #
+ my $ConfigPath = "";
+-my $ConfigFileOK = 1;
++my $ConfigFileOK = 0;
+ while ( 1 ) {
+ if ( $ConfigFileOK && -f "/etc/BackupPC/config.pl" ) {
+ $ConfigPath = "/etc/BackupPC/config.pl";
+@@ -213,7 +213,8 @@
+ $bpc->{LogDir} = $Conf{LogDir} = "$Conf{TopDir}/log"
+ if ( $Conf{LogDir} eq '' );
+ }
+- $bpc->{ConfDir} = $Conf{ConfDir} = $confDir;
++ # Disable this as it's not really neccessary for this ebuild
++ # $bpc->{ConfDir} = $Conf{ConfDir} = $confDir;
+ my $err = $bpc->ServerConnect($Conf{ServerHost}, $Conf{ServerPort}, 1);
+ if ( $err eq "" ) {
+ print <<EOF;
+@@ -729,7 +730,7 @@
+ if ( $Conf{CgiDir} =~ m{cgi-bin(/.*)} ) {
+ $Conf{CgiURL} = "'http://$Conf{ServerHost}/cgi-bin$1/BackupPC_Admin'";
+ } else {
+- $Conf{CgiURL} = "'http://$Conf{ServerHost}/cgi-bin/BackupPC_Admin'";
++ $Conf{CgiURL} = "'http://$Conf{ServerHost}/BackupPC_Admin'";
+ }
+ }
+
--- /dev/null
+--- conf/config.pl.dist 2013-09-23 23:05:50.332064754 +0300
++++ conf/config.pl 2013-09-23 23:07:44.110943607 +0300
+@@ -87,7 +87,7 @@
+ # Default value prevents any access from group other, and prevents
+ # group write.
+ #
+-$Conf{UmaskMode} = 027;
++$Conf{UmaskMode} = 27;
+
+ #
+ # Times at which we wake up, check all the PCs, and schedule necessary
+@@ -113,7 +113,31 @@
+ # you want BackupPC_nightly to run (eg: when you don't expect a lot
+ # of regular backups to run).
+ #
+-$Conf{WakeupSchedule} = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23];
++$Conf{WakeupSchedule} = [
++ 1,
++ 2,
++ 3,
++ 4,
++ 5,
++ 6,
++ 7,
++ 8,
++ 9,
++ 10,
++ 11,
++ 12,
++ 13,
++ 14,
++ 15,
++ 16,
++ 17,
++ 18,
++ 19,
++ 20,
++ 21,
++ 22,
++ 23
++];
+
+ #
+ # Maximum number of simultaneous backups to run. If there
+@@ -224,9 +248,9 @@
+ # Full path to various commands for archiving
+ #
+ $Conf{SplitPath} = '';
+-$Conf{ParPath} = '';
+-$Conf{CatPath} = '';
+-$Conf{GzipPath} = '';
++$Conf{ParPath} = '';
++$Conf{CatPath} = '';
++$Conf{GzipPath} = '';
+ $Conf{Bzip2Path} = '';
+
+ #
+@@ -302,11 +326,11 @@
+ # a symbolic link to the new location, or mount the new BackupPC
+ # store at the existing $Conf{TopDir} setting.
+ #
+-$Conf{TopDir} = '';
+-$Conf{ConfDir} = '';
+-$Conf{LogDir} = '';
+-$Conf{InstallDir} = '';
+-$Conf{CgiDir} = '';
++$Conf{TopDir} = '';
++$Conf{ConfDir} = '';
++$Conf{LogDir} = '';
++$Conf{InstallDir} = '';
++$Conf{CgiDir} = '';
+
+ #
+ # Whether BackupPC and the CGI script BackupPC_Admin verify that they
+@@ -316,7 +340,7 @@
+ # BackupPC might be accidently started as root or the wrong user,
+ # or if the CGI script is not installed correctly.
+ #
+-$Conf{BackupPCUserVerify} = 1;
++$Conf{BackupPCUserVerify} = '1';
+
+ #
+ # Maximum number of hardlinks supported by the $TopDir file system
+@@ -333,7 +357,7 @@
+ # Advanced option for asking BackupPC to load additional perl modules.
+ # Can be a list (array ref) of module names to load at startup.
+ #
+-$Conf{PerlModuleLoad} = undef;
++$Conf{PerlModuleLoad} = undef;
+
+ #
+ # Path to init.d script and command to use that script to start the
+@@ -355,7 +379,7 @@
+ # needs to be a full path and you can't include shell syntax like
+ # redirection and pipes; put that in a script if you need it.
+ #
+-$Conf{ServerInitdPath} = '';
++$Conf{ServerInitdPath} = undef;
+ $Conf{ServerInitdStartCmd} = '';
+
+
+@@ -373,7 +397,7 @@
+ # time taken for the backup, plus the granularity of $Conf{WakeupSchedule}
+ # will make the actual backup interval a bit longer.
+ #
+-$Conf{FullPeriod} = 6.97;
++$Conf{FullPeriod} = '6.97';
+
+ #
+ # Minimum period in days between incremental backups (a user requested
+@@ -383,7 +407,7 @@
+ # time taken for the backup, plus the granularity of $Conf{WakeupSchedule}
+ # will make the actual backup interval a bit longer.
+ #
+-$Conf{IncrPeriod} = 0.97;
++$Conf{IncrPeriod} = '0.97';
+
+ #
+ # Number of full backups to keep. Must be >= 1.
+@@ -458,7 +482,9 @@
+ # $Conf{FullKeepCnt} = 4;
+ # $Conf{FullKeepCnt} = [4];
+ #
+-$Conf{FullKeepCnt} = 1;
++$Conf{FullKeepCnt} = [
++ 1
++];
+
+ #
+ # Very old full backups are removed after $Conf{FullAgeMax} days. However,
+@@ -470,7 +496,7 @@
+ # full backups to exceed $Conf{FullAgeMax}.
+ #
+ $Conf{FullKeepCntMin} = 1;
+-$Conf{FullAgeMax} = 90;
++$Conf{FullAgeMax} = 90;
+
+ #
+ # Number of incremental backups to keep. Must be >= 1.
+@@ -487,7 +513,7 @@
+ # matter how old they are.
+ #
+ $Conf{IncrKeepCntMin} = 1;
+-$Conf{IncrAgeMax} = 30;
++$Conf{IncrAgeMax} = 30;
+
+ #
+ # Level of each incremental. "Level" follows the terminology
+@@ -565,7 +591,9 @@
+ # meaning each incremental backed up all the files that
+ # changed since the last full.
+ #
+-$Conf{IncrLevels} = [1];
++$Conf{IncrLevels} = [
++ 1
++];
+
+ #
+ # Disable all full and incremental backups. These settings are
+@@ -631,7 +659,7 @@
+ # The default is off. You can turn this on or off at any
+ # time without affecting existing backups.
+ #
+-$Conf{IncrFill} = 0;
++$Conf{IncrFill} = '0';
+
+ #
+ # Number of restore logs to keep. BackupPC remembers information about
+@@ -683,7 +711,7 @@
+ # '*' => ['/myFiles', '/important'], # these are other shares
+ # };
+ #
+-$Conf{BackupFilesOnly} = undef;
++$Conf{BackupFilesOnly} = {};
+
+ #
+ # List of directories or files to exclude from the backup. For Smb,
+@@ -739,7 +767,7 @@
+ # '*' => ['/junk', '/dont_back_this_up'], # these are for other shares
+ # };
+ #
+-$Conf{BackupFilesExclude} = undef;
++$Conf{BackupFilesExclude} = {};
+
+ #
+ # PCs that are always or often on the network can be backed up after
+@@ -770,7 +798,7 @@
+ # to just set $Conf{WakeupSchedule} to a restricted schedule.
+ #
+ $Conf{BlackoutBadPingLimit} = 3;
+-$Conf{BlackoutGoodCnt} = 7;
++$Conf{BlackoutGoodCnt} = 7;
+
+ #
+ # One or more blackout periods can be specified. If a client is
+@@ -813,11 +841,17 @@
+ # Saturday night.
+ #
+ $Conf{BlackoutPeriods} = [
+- {
+- hourBegin => 7.0,
+- hourEnd => 19.5,
+- weekDays => [1, 2, 3, 4, 5],
+- },
++ {
++ 'hourEnd' => '19.5',
++ 'weekDays' => [
++ 1,
++ 2,
++ 3,
++ 4,
++ 5
++ ],
++ 'hourBegin' => 7
++ }
+ ];
+
+ #
+@@ -826,7 +860,7 @@
+ # backed up. If you have shares that might be empty (and therefore an
+ # empty backup is valid) you should set this flag to 0.
+ #
+-$Conf{BackupZeroFilesIsFatal} = 1;
++$Conf{BackupZeroFilesIsFatal} = '1';
+
+ ###########################################################################
+ # How to backup a client
+@@ -922,7 +956,9 @@
+ #
+ # This setting only matters if $Conf{XferMethod} = 'smb'.
+ #
+-$Conf{SmbShareName} = 'C$';
++$Conf{SmbShareName} = [
++ 'C$'
++];
+
+ #
+ # Smbclient share user name. This is passed to smbclient's -U argument.
+@@ -975,9 +1011,7 @@
+ # needs to be a full path and you can't include shell syntax like
+ # redirection and pipes; put that in a script if you need it.
+ #
+-$Conf{SmbClientFullCmd} = '$smbClientPath \\\\$host\\$shareName'
+- . ' $I_option -U $userName -E -d 1'
+- . ' -c tarmode\\ full -Tc$X_option - $fileList';
++$Conf{SmbClientFullCmd} = '$smbClientPath \\\\$host\\$shareName $I_option -U $userName -E -d 1 -c tarmode\\ full -Tc$X_option - $fileList';
+
+ #
+ # Command to run smbclient for an incremental dump.
+@@ -989,9 +1023,7 @@
+ # needs to be a full path and you can't include shell syntax like
+ # redirection and pipes; put that in a script if you need it.
+ #
+-$Conf{SmbClientIncrCmd} = '$smbClientPath \\\\$host\\$shareName'
+- . ' $I_option -U $userName -E -d 1'
+- . ' -c tarmode\\ full -TcN$X_option $timeStampFile - $fileList';
++$Conf{SmbClientIncrCmd} = '$smbClientPath \\\\$host\\$shareName $I_option -U $userName -E -d 1 -c tarmode\\ full -TcN$X_option $timeStampFile - $fileList';
+
+ #
+ # Command to run smbclient for a restore.
+@@ -1007,9 +1039,7 @@
+ # needs to be a full path and you can't include shell syntax like
+ # redirection and pipes; put that in a script if you need it.
+ #
+-$Conf{SmbClientRestoreCmd} = '$smbClientPath \\\\$host\\$shareName'
+- . ' $I_option -U $userName -E -d 1'
+- . ' -c tarmode\\ full -Tx -';
++$Conf{SmbClientRestoreCmd} = '$smbClientPath \\\\$host\\$shareName $I_option -U $userName -E -d 1 -c tarmode\\ full -Tx -';
+
+ ###########################################################################
+ # Tar Configuration
+@@ -1044,7 +1074,9 @@
+ #
+ # This setting only matters if $Conf{XferMethod} = 'tar'.
+ #
+-$Conf{TarShareName} = '/';
++$Conf{TarShareName} = [
++ '/'
++];
+
+ #
+ # Command to run tar on the client. GNU tar is required. You will
+@@ -1088,9 +1120,7 @@
+ # needs to be a full path and you can't include shell syntax like
+ # redirection and pipes; put that in a script if you need it.
+ #
+-$Conf{TarClientCmd} = '$sshPath -q -x -n -l root $host'
+- . ' env LC_ALL=C $tarPath -c -v -f - -C $shareName+'
+- . ' --totals';
++$Conf{TarClientCmd} = '$sshPath -q -x -n -l root $host env LC_ALL=C $tarPath -c -v -f - -C $shareName+ --totals';
+
+ #
+ # Extra tar arguments for full backups. Several variables are substituted at
+@@ -1149,9 +1179,7 @@
+ # needs to be a full path and you can't include shell syntax like
+ # redirection and pipes; put that in a script if you need it.
+ #
+-$Conf{TarClientRestoreCmd} = '$sshPath -q -x -l root $host'
+- . ' env LC_ALL=C $tarPath -x -p --numeric-owner --same-owner'
+- . ' -v -f - -C $shareName+';
++$Conf{TarClientRestoreCmd} = '$sshPath -q -x -l root $host env LC_ALL=C $tarPath -x -p --numeric-owner --same-owner -v -f - -C $shareName+';
+
+ #
+ # Full path for tar on the client. Security caution: normal users should not
+@@ -1223,7 +1251,9 @@
+ #
+ # $Conf{RsyncShareName} = ['/', '/var', '/data', '/boot'];
+ #
+-$Conf{RsyncShareName} = '/';
++$Conf{RsyncShareName} = [
++ '/'
++];
+
+ #
+ # Rsync daemon port on the client, for $Conf{XferMethod} = "rsyncd".
+@@ -1252,7 +1282,7 @@
+ # connect to an rsyncd on the client that is not password protected.
+ # Turn off at your own risk.
+ #
+-$Conf{RsyncdAuthRequired} = 1;
++$Conf{RsyncdAuthRequired} = '1';
+
+ #
+ # When rsync checksum caching is enabled (by adding the
+@@ -1275,35 +1305,23 @@
+ #
+ # This setting has no effect unless checksum caching is turned on.
+ #
+-$Conf{RsyncCsumCacheVerifyProb} = 0.01;
++$Conf{RsyncCsumCacheVerifyProb} = '0.01';
+
+ #
+ # Arguments to rsync for backup. Do not edit the first set unless you
+ # have a thorough understanding of how File::RsyncP works.
+ #
+ $Conf{RsyncArgs} = [
+- #
+- # Do not edit these!
+- #
+- '--numeric-ids',
+- '--perms',
+- '--owner',
+- '--group',
+- '-D',
+- '--links',
+- '--hard-links',
+- '--times',
+- '--block-size=2048',
+- '--recursive',
+-
+- #
+- # Rsync >= 2.6.3 supports the --checksum-seed option
+- # which allows rsync checksum caching on the server.
+- # Uncomment this to enable rsync checksum caching if
+- # you have a recent client rsync version and you want
+- # to enable checksum caching.
+- #
+- #'--checksum-seed=32761',
++ '--numeric-ids',
++ '--perms',
++ '--owner',
++ '--group',
++ '-D',
++ '--links',
++ '--hard-links',
++ '--times',
++ '--block-size=2048',
++ '--recursive',
+ ];
+
+ #
+@@ -1358,34 +1376,18 @@
+ # Note: $Conf{RsyncArgsExtra} doesn't apply to $Conf{RsyncRestoreArgs}.
+ #
+ $Conf{RsyncRestoreArgs} = [
+- #
+- # Do not edit these!
+- #
+- '--numeric-ids',
+- '--perms',
+- '--owner',
+- '--group',
+- '-D',
+- '--links',
+- '--hard-links',
+- '--times',
+- '--block-size=2048',
+- '--relative',
+- '--ignore-times',
+- '--recursive',
+-
+- #
+- # Rsync >= 2.6.3 supports the --checksum-seed option
+- # which allows rsync checksum caching on the server.
+- # Uncomment this to enable rsync checksum caching if
+- # you have a recent client rsync version and you want
+- # to enable checksum caching.
+- #
+- #'--checksum-seed=32761',
+-
+- #
+- # Add additional arguments here
+- #
++ '--numeric-ids',
++ '--perms',
++ '--owner',
++ '--group',
++ '-D',
++ '--links',
++ '--hard-links',
++ '--times',
++ '--block-size=2048',
++ '--relative',
++ '--ignore-times',
++ '--recursive',
+ ];
+
+ ###########################################################################
+@@ -1518,7 +1520,7 @@
+ #
+ # Set to 0 to disable this feature.
+ #
+-$Conf{ArchivePar} = 0;
++$Conf{ArchivePar} = '0';
+
+ #
+ # Archive Size Split
+@@ -1554,9 +1556,7 @@
+ # needs to be a full path and you can't include shell syntax like
+ # redirection and pipes; put that in a script if you need it.
+ #
+-$Conf{ArchiveClientCmd} = '$Installdir/bin/BackupPC_archiveHost'
+- . ' $tarCreatePath $splitpath $parpath $host $backupnumber'
+- . ' $compression $compext $splitsize $archiveloc $parfile *';
++$Conf{ArchiveClientCmd} = '$Installdir/bin/BackupPC_archiveHost $tarCreatePath $splitpath $parpath $host $backupnumber $compression $compext $splitsize $archiveloc $parfile *';
+
+ #
+ # Full path for ssh. Security caution: normal users should not
+@@ -1628,7 +1628,7 @@
+ # setting this flag is a great way to verify that the machines have
+ # their netbios name set correctly before turning on DCHP.
+ #
+-$Conf{FixedIPNetBiosNameCheck} = 0;
++$Conf{FixedIPNetBiosNameCheck} = '0';
+
+ #
+ # Full path to the ping command. Security caution: normal users
+@@ -1805,13 +1805,13 @@
+ # needs to be a full path and you can't include shell syntax like
+ # redirection and pipes; put that in a script if you need it.
+ #
+-$Conf{DumpPreUserCmd} = undef;
+-$Conf{DumpPostUserCmd} = undef;
+-$Conf{DumpPreShareCmd} = undef;
+-$Conf{DumpPostShareCmd} = undef;
+-$Conf{RestorePreUserCmd} = undef;
++$Conf{DumpPreUserCmd} = undef;
++$Conf{DumpPostUserCmd} = undef;
++$Conf{DumpPreShareCmd} = undef;
++$Conf{DumpPostShareCmd} = undef;
++$Conf{RestorePreUserCmd} = undef;
+ $Conf{RestorePostUserCmd} = undef;
+-$Conf{ArchivePreUserCmd} = undef;
++$Conf{ArchivePreUserCmd} = undef;
+ $Conf{ArchivePostUserCmd} = undef;
+
+ #
+@@ -1835,7 +1835,7 @@
+ # that snapshots or dumps a database which fails because
+ # of some database error.
+ #
+-$Conf{UserCmdCheckStatus} = 0;
++$Conf{UserCmdCheckStatus} = '0';
+
+ #
+ # Override the client's host name. This allows multiple clients
+@@ -1873,7 +1873,7 @@
+ # rounded up (ie: 2.5 means a user will never receive email more
+ # than once every 3 days).
+ #
+-$Conf{EMailNotifyMinDays} = 2.5;
++$Conf{EMailNotifyMinDays} = '2.5';
+
+ #
+ # Name to use as the "from" name for email. Depending upon your mail
+@@ -1928,7 +1928,7 @@
+ # When there have been no backups in this number of days the user
+ # is sent an email.
+ #
+-$Conf{EMailNotifyOldBackupDays} = 7.0;
++$Conf{EMailNotifyOldBackupDays} = 7;
+
+ #
+ # This subject and message is sent to a user if their PC has not recently
+@@ -1955,7 +1955,7 @@
+ # How old the most recent backup of Outlook files has to be before
+ # notifying user.
+ #
+-$Conf{EMailNotifyOldOutlookDays} = 5.0;
++$Conf{EMailNotifyOldOutlookDays} = 5;
+
+ #
+ # This subject and message is sent to a user if their Outlook files have
+@@ -1983,10 +1983,9 @@
+ # Additional email headers. This sets to charset to
+ # utf8.
+ #
+-$Conf{EMailHeaders} = <<EOF;
+-MIME-Version: 1.0
++$Conf{EMailHeaders} = 'MIME-Version: 1.0
+ Content-Type: text/plain; charset="utf-8"
+-EOF
++';
+
+ ###########################################################################
+ # CGI user interface configuration settings
+@@ -2059,7 +2058,7 @@
+ # be rendered as a link to http://myhost/users/craig.html.
+ #
+ $Conf{CgiUserHomePageCheck} = '';
+-$Conf{CgiUserUrlCreate} = 'mailto:%s';
++$Conf{CgiUserUrlCreate} = 'mailto:%s';
+
+ #
+ # Date display format for CGI interface. A value of 1 uses US-style
+@@ -2074,12 +2073,12 @@
+ # the user is listed in the host file (as either the user or in moreUsers)
+ # are displayed.
+ #
+-$Conf{CgiNavBarAdminAllHosts} = 1;
++$Conf{CgiNavBarAdminAllHosts} = '1';
+
+ #
+ # Enable/disable the search box in the navigation bar.
+ #
+-$Conf{CgiSearchBoxEnable} = 1;
++$Conf{CgiSearchBoxEnable} = '1';
+
+ #
+ # Additional navigation bar links. These appear for both regular users
+@@ -2089,31 +2088,34 @@
+ # just literally displaying name.
+ #
+ $Conf{CgiNavBarLinks} = [
+- {
+- link => "?action=view&type=docs",
+- lname => "Documentation", # actually displays $Lang->{Documentation}
+- },
+- {
+- link => "http://backuppc.wiki.sourceforge.net",
+- name => "Wiki", # displays literal "Wiki"
+- },
+- {
+- link => "http://backuppc.sourceforge.net",
+- name => "SourceForge", # displays literal "SourceForge"
+- },
++ {
++ 'link' => '?action=view&type=docs',
++ 'lname' => 'Documentation',
++ 'name' => undef
++ },
++ {
++ 'link' => 'http://backuppc.wiki.sourceforge.net',
++ 'lname' => undef,
++ 'name' => 'Wiki'
++ },
++ {
++ 'link' => 'http://backuppc.sourceforge.net',
++ 'lname' => undef,
++ 'name' => 'SourceForge'
++ }
+ ];
+
+ #
+ # Hilight colors based on status that are used in the PC summary page.
+ #
+ $Conf{CgiStatusHilightColor} = {
+- Reason_backup_failed => '#ffcccc',
+- Reason_backup_done => '#ccffcc',
+- Reason_no_ping => '#ffff99',
+- Reason_backup_canceled_by_user => '#ff9900',
+- Status_backup_in_progress => '#66cc99',
+- Disabled_OnlyManualBackups => '#d1d1d1',
+- Disabled_AllBackupsDisabled => '#d1d1d1',
++ 'Reason_backup_failed' => '#ffcccc',
++ 'Reason_backup_done' => '#ccffcc',
++ 'Reason_backup_canceled_by_user' => '#ff9900',
++ 'Reason_no_ping' => '#ffff99',
++ 'Disabled_OnlyManualBackups' => '#d1d1d1',
++ 'Status_backup_in_progress' => '#66cc99',
++ 'Disabled_AllBackupsDisabled' => '#d1d1d1'
+ };
+
+ #
+@@ -2141,7 +2143,7 @@
+ # 'pl' => 'text/plain',
+ # };
+ #
+-$Conf{CgiExt2ContentType} = { };
++$Conf{CgiExt2ContentType} = {};
+
+ #
+ # URL (without the leading http://host) for BackupPC's image directory.
+@@ -2166,7 +2168,7 @@
+ #
+ # Whether the user is allowed to edit their per-PC config.
+ #
+-$Conf{CgiUserConfigEditEnable} = 1;
++$Conf{CgiUserConfigEditEnable} = '1';
+
+ #
+ # Which per-host config variables a non-admin user is allowed
+@@ -2180,96 +2182,96 @@
+ # sorts of bad things.
+ #
+ $Conf{CgiUserConfigEdit} = {
+- FullPeriod => 1,
+- IncrPeriod => 1,
+- FullKeepCnt => 1,
+- FullKeepCntMin => 1,
+- FullAgeMax => 1,
+- IncrKeepCnt => 1,
+- IncrKeepCntMin => 1,
+- IncrAgeMax => 1,
+- IncrLevels => 1,
+- IncrFill => 1,
+- PartialAgeMax => 1,
+- RestoreInfoKeepCnt => 1,
+- ArchiveInfoKeepCnt => 1,
+- BackupFilesOnly => 1,
+- BackupFilesExclude => 1,
+- BackupsDisable => 1,
+- BlackoutBadPingLimit => 1,
+- BlackoutGoodCnt => 1,
+- BlackoutPeriods => 1,
+- BackupZeroFilesIsFatal => 1,
+- ClientCharset => 1,
+- ClientCharsetLegacy => 1,
+- XferMethod => 1,
+- XferLogLevel => 1,
+- SmbShareName => 1,
+- SmbShareUserName => 1,
+- SmbSharePasswd => 1,
+- SmbClientFullCmd => 0,
+- SmbClientIncrCmd => 0,
+- SmbClientRestoreCmd => 0,
+- TarShareName => 1,
+- TarFullArgs => 1,
+- TarIncrArgs => 1,
+- TarClientCmd => 0,
+- TarClientRestoreCmd => 0,
+- TarClientPath => 0,
+- RsyncShareName => 1,
+- RsyncdClientPort => 1,
+- RsyncdPasswd => 1,
+- RsyncdUserName => 1,
+- RsyncdAuthRequired => 1,
+- RsyncCsumCacheVerifyProb => 1,
+- RsyncArgs => 1,
+- RsyncArgsExtra => 1,
+- RsyncRestoreArgs => 1,
+- RsyncClientCmd => 0,
+- RsyncClientRestoreCmd => 0,
+- RsyncClientPath => 0,
+- FtpShareName => 1,
+- FtpUserName => 1,
+- FtpPasswd => 1,
+- FtpBlockSize => 1,
+- FtpPort => 1,
+- FtpTimeout => 1,
+- FtpFollowSymlinks => 1,
+- FtpRestoreEnabled => 1,
+- ArchiveDest => 1,
+- ArchiveComp => 1,
+- ArchivePar => 1,
+- ArchiveSplit => 1,
+- ArchiveClientCmd => 0,
+- FixedIPNetBiosNameCheck => 1,
+- NmbLookupCmd => 0,
+- NmbLookupFindHostCmd => 0,
+- PingMaxMsec => 1,
+- PingCmd => 0,
+- ClientTimeout => 1,
+- MaxOldPerPCLogFiles => 1,
+- CompressLevel => 1,
+- ClientNameAlias => 1,
+- DumpPreUserCmd => 0,
+- DumpPostUserCmd => 0,
+- RestorePreUserCmd => 0,
+- RestorePostUserCmd => 0,
+- ArchivePreUserCmd => 0,
+- ArchivePostUserCmd => 0,
+- DumpPostShareCmd => 0,
+- DumpPreShareCmd => 0,
+- UserCmdCheckStatus => 0,
+- EMailNotifyMinDays => 1,
+- EMailFromUserName => 1,
+- EMailAdminUserName => 1,
+- EMailUserDestDomain => 1,
+- EMailNoBackupEverSubj => 1,
+- EMailNoBackupEverMesg => 1,
+- EMailNotifyOldBackupDays => 1,
+- EMailNoBackupRecentSubj => 1,
+- EMailNoBackupRecentMesg => 1,
+- EMailNotifyOldOutlookDays => 1,
+- EMailOutlookBackupSubj => 1,
+- EMailOutlookBackupMesg => 1,
+- EMailHeaders => 1,
++ FullPeriod => 1,
++ IncrPeriod => 1,
++ FullKeepCnt => 1,
++ FullKeepCntMin => 1,
++ FullAgeMax => 1,
++ IncrKeepCnt => 1,
++ IncrKeepCntMin => 1,
++ IncrAgeMax => 1,
++ IncrLevels => 1,
++ IncrFill => 1,
++ PartialAgeMax => 1,
++ RestoreInfoKeepCnt => 1,
++ ArchiveInfoKeepCnt => 1,
++ BackupFilesOnly => 1,
++ BackupFilesExclude => 1,
++ BackupsDisable => 1,
++ BlackoutBadPingLimit => 1,
++ BlackoutGoodCnt => 1,
++ BlackoutPeriods => 1,
++ BackupZeroFilesIsFatal => 1,
++ ClientCharset => 1,
++ ClientCharsetLegacy => 1,
++ XferMethod => 1,
++ XferLogLevel => 1,
++ SmbShareName => 1,
++ SmbShareUserName => 1,
++ SmbSharePasswd => 1,
++ SmbClientFullCmd => 0,
++ SmbClientIncrCmd => 0,
++ SmbClientRestoreCmd => 0,
++ TarShareName => 1,
++ TarFullArgs => 1,
++ TarIncrArgs => 1,
++ TarClientCmd => 0,
++ TarClientRestoreCmd => 0,
++ TarClientPath => 0,
++ RsyncShareName => 1,
++ RsyncdClientPort => 1,
++ RsyncdPasswd => 1,
++ RsyncdUserName => 1,
++ RsyncdAuthRequired => 1,
++ RsyncCsumCacheVerifyProb => 1,
++ RsyncArgs => 1,
++ RsyncArgsExtra => 1,
++ RsyncRestoreArgs => 1,
++ RsyncClientCmd => 0,
++ RsyncClientRestoreCmd => 0,
++ RsyncClientPath => 0,
++ FtpShareName => 1,
++ FtpUserName => 1,
++ FtpPasswd => 1,
++ FtpBlockSize => 1,
++ FtpPort => 1,
++ FtpTimeout => 1,
++ FtpFollowSymlinks => 1,
++ FtpRestoreEnabled => 1,
++ ArchiveDest => 1,
++ ArchiveComp => 1,
++ ArchivePar => 1,
++ ArchiveSplit => 1,
++ ArchiveClientCmd => 0,
++ FixedIPNetBiosNameCheck => 1,
++ NmbLookupCmd => 0,
++ NmbLookupFindHostCmd => 0,
++ PingMaxMsec => 1,
++ PingCmd => 0,
++ ClientTimeout => 1,
++ MaxOldPerPCLogFiles => 1,
++ CompressLevel => 1,
++ ClientNameAlias => 1,
++ DumpPreUserCmd => 0,
++ DumpPostUserCmd => 0,
++ RestorePreUserCmd => 0,
++ RestorePostUserCmd => 0,
++ ArchivePreUserCmd => 0,
++ ArchivePostUserCmd => 0,
++ DumpPostShareCmd => 0,
++ DumpPreShareCmd => 0,
++ UserCmdCheckStatus => 0,
++ EMailNotifyMinDays => 1,
++ EMailFromUserName => 1,
++ EMailAdminUserName => 1,
++ EMailUserDestDomain => 1,
++ EMailNoBackupEverSubj => 1,
++ EMailNoBackupEverMesg => 1,
++ EMailNotifyOldBackupDays => 1,
++ EMailNoBackupRecentSubj => 1,
++ EMailNoBackupRecentMesg => 1,
++ EMailNotifyOldOutlookDays => 1,
++ EMailOutlookBackupSubj => 1,
++ EMailOutlookBackupMesg => 1,
++ EMailHeaders => 1,
+ };
--- /dev/null
+--- conf/config.pl.formatted 2013-09-23 23:12:30.708129365 +0300
++++ conf/config.pl 2013-09-23 23:12:39.448043656 +0300
+@@ -1322,6 +1322,8 @@
+ '--times',
+ '--block-size=2048',
+ '--recursive',
++ '--specials',
++ '--checksum-seed=32761',
+ ];
+
+ #
+@@ -1388,6 +1390,8 @@
+ '--relative',
+ '--ignore-times',
+ '--recursive',
++ '--specials',
++ '--checksum-seed=32761',
+ ];
+
+ ###########################################################################
+@@ -2018,7 +2022,7 @@
+ # --> administrative users are only craig and celia'.
+ #
+ $Conf{CgiAdminUserGroup} = '';
+-$Conf{CgiAdminUsers} = '';
++$Conf{CgiAdminUsers} = 'backuppc';
+
+ #
+ # URL of the BackupPC_Admin CGI script. Used for email messages.
+@@ -2065,7 +2069,7 @@
+ # dates (MM/DD), a value of 2 uses full YYYY-MM-DD format, and zero
+ # for international dates (DD/MM).
+ #
+-$Conf{CgiDateFormatMMDD} = 1;
++$Conf{CgiDateFormatMMDD} = 2;
+
+ #
+ # If set, the complete list of hosts appears in the left navigation
+@@ -2251,7 +2255,7 @@
+ ClientTimeout => 1,
+ MaxOldPerPCLogFiles => 1,
+ CompressLevel => 1,
+- ClientNameAlias => 1,
++ ClientNameAlias => 0,
+ DumpPreUserCmd => 0,
+ DumpPostUserCmd => 0,
+ RestorePreUserCmd => 0,
--- /dev/null
+#
+# BackupPC-2.1.2pl2.diff: BackupPC patch file generated
+# on Sun Jun 18 19:36:32 2006.
+#
+# This patch file should be applied to a cleanly unpacked BackupPC
+# version 2.1.2. Do not apply any old patch files; each
+# patch file accumulates all previous changes.
+#
+# Example:
+#
+# # fetch BackupPC-2.1.2.tar.gz
+# # fetch BackupPC-2.1.2pl2.diff
+# tar zxvf BackupPC-2.1.2.tar.gz
+# cd BackupPC-2.1.2
+# patch -p0 < ../BackupPC-2.1.2pl2.diff
+# perl configure.pl
+#
+# ChangeLog:
+#
+# - In conf/config.pl, changed --devices to -D in $Conf{RsyncArgs}
+# and $Conf{RsyncRestoreArgs} to fix "fileListReceive failed" and
+# "Can't open .../f%2f for empty output" errors with rsync 2.6.7+.
+# Fix proposed by Justin Pessa and Vincent Ho, and confirmed by
+# Dan Niles.
+#
+# - Added patch from Michael (mna.news) to ignore "file is unchanged"
+# message from tar 1.15.x during incremental backups.
+#
+# - Fixed creation of .rsrc directories in bin/BackupPC_tarExtract
+# when used with xtar on MacOS. Reported by Samuel Bancal and
+# Matthew Radey, who helped with debugging.
+#
+# - Fixed bug in BackupPC_tarExtract for files >8GB in size whose
+# lengths are multiples of 256. Reported by Jamie Myers and
+# Marko Tukiainen, who both helped debugging the problem.
+#
+# - Fixed bug in lib/BackupPC/Xfer/RsyncFileIO.pm that caused
+# incorrected deleted attributes to be set in directories
+# where one of the files had an rsync phase 1 retry during
+# an incremental. Reported by Tony Nelson.
+#
+--- bin/BackupPC_tarExtract 2005-09-05 16:21:21.000000000 -0700
++++ bin/BackupPC_tarExtract 2006-06-18 19:36:31.995945464 -0700
+@@ -58,7 +58,7 @@
+ exit(1);
+ }
+ my $client = $1;
+-if ( $ARGV[1] !~ /^([\w\s\.\/\$-]+)$/ ) {
++if ( $ARGV[1] !~ /^([\w\s.\/$(){}[\]-]+)$/ ) {
+ print("$0: bad share name '$ARGV[1]'\n");
+ exit(1);
+ }
+@@ -101,7 +101,7 @@
+ # Copyright 1998 Stephen Zander. All rights reserved.
+ #
+ my $tar_unpack_header
+- = 'Z100 A8 A8 A8 A12 A12 A8 A1 Z100 A6 A2 Z32 Z32 A8 A8 A155 x12';
++ = 'Z100 A8 A8 A8 a12 A12 A8 A1 Z100 A6 A2 Z32 Z32 A8 A8 A155 x12';
+ my $tar_header_length = 512;
+
+ my $BufSize = 1048576; # 1MB or 2^20
+@@ -251,7 +251,7 @@
+ $name = $longName if ( defined($longName) );
+ $linkname = $longLink if ( defined($longLink) );
+ $name =~ s{^\./+}{};
+- $name =~ s{/+$}{};
++ $name =~ s{/+\.?$}{};
+ $name =~ s{//+}{/}g;
+ return {
+ name => $name,
+@@ -313,7 +313,7 @@
+ #
+ my($nRead);
+ #print("Reading $f->{name}, $f->{size} bytes, type $f->{type}\n");
+- pathCreate($dir, "$OutDir/$ShareName/$f->{mangleName}", $file, $f);
++ pathCreate($dir, "$OutDir/$ShareName/$f->{mangleName}", $f);
+ my $poolWrite = BackupPC::PoolWrite->new($bpc,
+ "$OutDir/$ShareName/$f->{mangleName}",
+ $f->{size}, $Compress);
+@@ -351,7 +351,7 @@
+ # a plain file.
+ #
+ $f->{size} = length($f->{linkname});
+- pathCreate($dir, "$OutDir/$ShareName/$f->{mangleName}", $file, $f);
++ pathCreate($dir, "$OutDir/$ShareName/$f->{mangleName}", $f);
+ my $poolWrite = BackupPC::PoolWrite->new($bpc,
+ "$OutDir/$ShareName/$f->{mangleName}",
+ $f->{size}, $Compress);
+@@ -369,7 +369,7 @@
+ # contents.
+ #
+ $f->{size} = length($f->{linkname});
+- pathCreate($dir, "$OutDir/$ShareName/$f->{mangleName}", $file, $f);
++ pathCreate($dir, "$OutDir/$ShareName/$f->{mangleName}", $f);
+ my $poolWrite = BackupPC::PoolWrite->new($bpc,
+ "$OutDir/$ShareName/$f->{mangleName}",
+ $f->{size}, $Compress);
+@@ -393,7 +393,7 @@
+ } else {
+ $data = "$f->{devmajor},$f->{devminor}";
+ }
+- pathCreate($dir, "$OutDir/$ShareName/$f->{mangleName}", $file, $f);
++ pathCreate($dir, "$OutDir/$ShareName/$f->{mangleName}", $f);
+ my $poolWrite = BackupPC::PoolWrite->new($bpc,
+ "$OutDir/$ShareName/$f->{mangleName}",
+ length($data), $Compress);
+@@ -487,17 +487,21 @@
+ #
+ sub pathCreate
+ {
+- my($dir, $fullPath, $file, $f) = @_;
++ my($dir, $fullPath, $f) = @_;
+
+ #
+ # Get parent directory of each of $dir and $fullPath
+ #
+- $dir =~ s{/[^/]*$}{};
++ # print("pathCreate: dir = $dir, fullPath = $fullPath\n");
++ $dir =~ s{/([^/]*)$}{};
++ my $file = $bpc->fileNameUnmangle($1);
+ $fullPath =~ s{/[^/]*$}{};
+- return if ( -d $fullPath );
++ return if ( -d $fullPath || $file eq "" );
++ unlink($fullPath) if ( -e $fullPath );
+ mkpath($fullPath, 0, 0777);
+ $Attrib{$dir} = BackupPC::Attrib->new({ compress => $Compress })
+ if ( !defined($Attrib{$dir}) );
++ # print("pathCreate: adding file = $file to dir = $dir\n");
+ $Attrib{$dir}->set($file, {
+ type => BPC_FTYPE_DIR,
+ mode => 0755,
+--- lib/BackupPC/Lib.pm 2005-09-05 16:21:21.000000000 -0700
++++ lib/BackupPC/Lib.pm 2006-06-18 19:36:32.035939384 -0700
+@@ -59,7 +59,7 @@
+ TopDir => $topDir || '__TOPDIR__',
+ BinDir => $installDir || '__INSTALLDIR__',
+ LibDir => $installDir || '__INSTALLDIR__',
+- Version => '2.1.2',
++ Version => '2.1.2pl2',
+ BackupFields => [qw(
+ num type startTime endTime
+ nFiles size nFilesExist sizeExist nFilesNew sizeNew
+--- lib/BackupPC/Xfer/RsyncFileIO.pm 2005-09-05 16:21:21.000000000 -0700
++++ lib/BackupPC/Xfer/RsyncFileIO.pm 2006-06-18 19:36:32.120926464 -0700
+@@ -405,6 +405,11 @@
+ my($fio, $d) = @_;
+ my($poolWrite);
+
++ #
++ # Don't write attributes on 2nd phase - they're already
++ # taken care of during the first phase.
++ #
++ return if ( $fio->{phase} > 0 );
+ if ( !defined($d) ) {
+ #
+ # flush all entries (in reverse order)
+@@ -932,6 +937,7 @@
+
+ close($fio->{rxInFd}) if ( defined($fio->{rxInFd}) );
+ unlink("$fio->{outDirSh}RStmp") if ( -f "$fio->{outDirSh}RStmp" );
++ $fio->{phase} = $phase;
+
+ #
+ # Check the final md4 digest
+--- lib/BackupPC/Xfer/Tar.pm 2005-09-05 16:21:21.000000000 -0700
++++ lib/BackupPC/Xfer/Tar.pm 2006-06-18 19:36:32.110927984 -0700
+@@ -221,8 +221,13 @@
+ $t->{XferLOG}->write(\"$_\n") if ( $t->{logLevel} >= 2 );
+ $t->{fileCnt}++;
+ } else {
+- $t->{XferLOG}->write(\"$_\n") if ( $t->{logLevel} >= 0 );
+- $t->{xferErrCnt}++;
++ #
++ # Ignore annoying log message on incremental for tar 1.15.x
++ #
++ if ( !/: file is unchanged; not dumped$/ ) {
++ $t->{XferLOG}->write(\"$_\n") if ( $t->{logLevel} >= 0 );
++ $t->{xferErrCnt}++;
++ }
+ #
+ # If tar encounters a minor error, it will exit with a non-zero
+ # status. We still consider that ok. Remember if tar prints
+--- conf/config.pl 2005-09-05 16:21:22.000000000 -0700
++++ conf/config.pl 2006-06-18 19:36:31.968949568 -0700
+@@ -1052,7 +1052,7 @@
+ '--perms',
+ '--owner',
+ '--group',
+- '--devices',
++ '-D',
+ '--links',
+ '--times',
+ '--block-size=2048',
+@@ -1086,7 +1086,7 @@
+ '--perms',
+ '--owner',
+ '--group',
+- '--devices',
++ '-D',
+ '--links',
+ '--times',
+ '--block-size=2048',
--- /dev/null
+# /etc/conf.d/apache2: config file for /etc/init.d/apache2
+
+# When you install a module it is easy to activate or deactivate the modules
+# and other features of apache using the APACHE2_OPTS line. Every module should
+# install a configuration in /etc/apache2/modules.d. In that file will have an
+# <IfDefine NNN> directive where NNN is the option to enable that module.
+#
+# Here are the options available in the default configuration:
+#
+# AUTH_DIGEST Enables mod_auth_digest
+# AUTHNZ_LDAP Enables authentication through mod_ldap (available if USE=ldap)
+# CACHE Enables mod_cache
+# DAV Enables mod_dav
+# ERRORDOCS Enables default error documents for many languages.
+# INFO Enables mod_info, a useful module for debugging
+# LANGUAGE Enables content-negotiation based on language and charset.
+# LDAP Enables mod_ldap (available if USE=ldap)
+# MANUAL Enables /manual/ to be the apache manual (available if USE=docs)
+# MEM_CACHE Enables default configuration mod_mem_cache
+# PROXY Enables mod_proxy
+# SSL Enables SSL (available if USE=ssl)
+# SUEXEC Enables running CGI scripts (in USERDIR) through suexec.
+# USERDIR Enables /~username mapping to /home/username/public_html
+#
+#
+# The following two options provide the default virtual host for the HTTP and
+# HTTPS protocol. YOU NEED TO ENABLE AT LEAST ONE OF THEM, otherwise apache
+# will not listen for incomming connections on the approriate port.
+#
+# DEFAULT_VHOST Enables name-based virtual hosts, with the default
+# virtual host being in /var/www/localhost/htdocs
+# SSL_DEFAULT_VHOST Enables default vhost for SSL (you should enable this
+# when you enable SSL)
+#
+APACHE2_OPTS="-D LANGUAGE -D PERL -D BACKUPPC_VHOST"
+
+# Extended options for advanced uses of Apache ONLY
+# You don't need to edit these unless you are doing crazy Apache stuff
+# As not having them set correctly, or feeding in an incorrect configuration
+# via them will result in Apache failing to start
+# YOU HAVE BEEN WARNED.
+
+# PID file
+PIDFILE=/var/run/apache-backuppc.pid
+
+# timeout for startup/shutdown checks
+#TIMEOUT=10
+
+# ServerRoot setting
+SERVERROOT=/usr/lib/apache2
+
+# Configuration file location
+# - If this does NOT start with a '/', then it is treated relative to
+# $SERVERROOT by Apache
+CONFIGFILE=/etc/BackupPC/httpd.conf
+
+# Location to log startup errors to
+# They are normally dumped to your terminal.
+#STARTUPERRORLOG="/var/log/apache2/startuperror.log"
+
+# A command that outputs a formatted text version of the HTML at the URL
+# of the command line. Designed for lynx, however other programs may work.
+#LYNX="lynx -dump"
+
+# The URL to your server's mod_status status page.
+# Required for status and fullstatus
+#STATUSURL="http://localhost/server-status"
+
+# Method to use when reloading the server
+# Valid options are 'restart' and 'graceful'
+# See http://httpd.apache.org/docs/2.2/stopping.html for information on
+# what they do and how they differ.
+#RELOAD_TYPE="graceful"
--- /dev/null
+#!/sbin/runscript
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+opts="configdump configtest fullstatus graceful gracefulstop modules reload virtualhosts"
+
+depend() {
+ need net
+ use mysql dns logger netmount postgresql
+ after sshd
+}
+
+configtest() {
+ ebegin "Checking ${SVCNAME} configuration"
+ checkconfig
+ eend $?
+}
+
+checkconfd() {
+ PIDFILE="${PIDFILE:-/var/run/apache2-backuppc.pid}"
+ TIMEOUT=${TIMEOUT:-10}
+
+ SERVERROOT="${SERVERROOT:-/usr/lib/apache2}"
+ if [ ! -d ${SERVERROOT} ]; then
+ eerror "SERVERROOT does not exist: ${SERVERROOT}"
+ return 1
+ fi
+
+ CONFIGFILE="${CONFIGFILE:-/etc/BackupPC/httpd.conf}"
+ [ "${CONFIGFILE#/}" = "${CONFIGFILE}" ] && CONFIGFILE="${SERVERROOT}/${CONFIGFILE}"
+ if [ ! -r "${CONFIGFILE}" ]; then
+ eerror "Unable to read configuration file: ${CONFIGFILE}"
+ return 1
+ fi
+
+ APACHE2_OPTS="${APACHE2_OPTS} -d ${SERVERROOT}"
+ APACHE2_OPTS="${APACHE2_OPTS} -f ${CONFIGFILE}"
+ [ -n "${STARTUPERRORLOG}" ] && APACHE2_OPTS="${APACHE2_OPTS} -E ${STARTUPERRORLOG}"
+
+ APACHE2="/usr/sbin/apache2"
+}
+
+checkconfig() {
+ checkconfd || return 1
+
+ ${APACHE2} ${APACHE2_OPTS} -t 1>/dev/null 2>&1
+ ret=$?
+ if [ $ret -ne 0 ]; then
+ eerror "${SVCNAME} has detected a syntax error in your configuration files:"
+ ${APACHE2} ${APACHE2_OPTS} -t
+ fi
+
+ return $ret
+}
+
+start() {
+ checkconfig || return 1
+
+ [ -f /var/log/apache2/ssl_scache ] && rm /var/log/apache2/ssl_scache
+
+ ebegin "Starting ${SVCNAME}"
+ ${APACHE2} ${APACHE2_OPTS} -k start
+
+ let i=0
+ while [ ! -e "${PIDFILE}" ] && [ $i -lt ${TIMEOUT} ]; do
+ sleep 1 && i=$(expr $i + 1)
+ done
+
+ test $i -le ${TIMEOUT}
+ eend $?
+}
+
+stop() {
+ checkconfd || return 1
+
+ ebegin "Stopping ${SVCNAME}"
+ ${APACHE2} ${APACHE2_OPTS} -k stop
+
+ let i=0
+ while pidof "${APACHE2}" >/dev/null && [ $i -lt ${TIMEOUT} ]; do
+ sleep 1 && i=$(expr $i + 1)
+ done
+
+ test $i -le ${TIMEOUT}
+ eend $?
+}
+
+reload() {
+ RELOAD_TYPE="${RELOAD_TYPE:-graceful}"
+
+ checkconfig || return 1
+ service_started "${SVCNAME}" || return
+
+ if [ "${RELOAD_TYPE}" = "restart" ]; then
+ ebegin "Restarting ${SVCNAME}"
+ ${APACHE2} ${APACHE2_OPTS} -k restart
+ eend $?
+ elif [ "${RELOAD_TYPE}" = "graceful" ]; then
+ ebegin "Gracefully restarting ${SVCNAME}"
+ ${APACHE2} ${APACHE2_OPTS} -k graceful
+ eend $?
+ else
+ eerror "${RELOAD_TYPE} is not a valid RELOAD_TYPE. Please edit /etc/conf.d/${SVCNAME}"
+ fi
+}
+
+graceful() {
+ checkconfig || return 1
+ service_started "${SVCNAME}" || return
+ ebegin "Gracefully restarting ${SVCNAME}"
+ ${APACHE2} ${APACHE2_OPTS} -k graceful
+ eend $?
+}
+
+gracefulstop() {
+ checkconfig || return 1
+
+ # zap!
+ if service_started "${SVCNAME}"; then
+ mark_service_stopped "${SVCNAME}"
+ fi
+
+ ebegin "Gracefully stopping ${SVCNAME}"
+ ${APACHE2} ${APACHE2_OPTS} -k graceful-stop
+ eend $?
+}
+
+modules() {
+ checkconfig || return 1
+
+ ${APACHE2} ${APACHE2_OPTS} -M 2>&1
+}
+
+fullstatus() {
+ LYNX="${LYNX:-lynx -dump}"
+ STATUSURL="${STATUSURL:-http://localhost/server-status}"
+
+ if ! service_started "${SVCNAME}"; then
+ eerror "${SVCNAME} not started"
+ elif ! type -p ${LYNX} 2>&1 >/dev/null; then
+ eerror "lynx not found! you need to emerge www-client/lynx"
+ else
+ ${LYNX} ${STATUSURL}
+ fi
+}
+
+virtualhosts() {
+ checkconfd || return 1
+ ${APACHE2} ${APACHE2_OPTS} -S
+}
+
+configdump() {
+ LYNX="${LYNX:-lynx -dump}"
+ INFOURL="${INFOURL:-http://localhost/server-info}"
+
+ checkconfd || return 1
+
+ if ! service_started "${SVCNAME}"; then
+ eerror "${SVCNAME} not started"
+ elif ! type -p ${LYNX} 2>&1 >/dev/null; then
+ eerror "lynx not found! you need to emerge www-client/lynx"
+ else
+ echo "${APACHE2} started with '${APACHE2_OPTS}'"
+ for i in config server list; do
+ ${LYNX} "${INFOURL}/?${i}" | sed '/Apache Server Information/d;/^[[:space:]]\+[_]\+$/Q'
+ done
+ fi
+}
+
+# vim: ts=4 filetype=gentoo-init-d
--- /dev/null
+[Unit]
+Description= BackupPC server
+After=syslog.target local-fs.target remote-fs.target
+
+[Service]
+Type=oneshot
+User=backuppc
+Group=backuppc
+ExecStart=/usr/bin/BackupPC -d
+RemainAfterExit=yes
+
+[Install]
+WantedBy=multi-user.target
--- /dev/null
+# This is a modification of the default Apache 2.2 configuration file
+# for Gentoo Linux.
+#
+# Support:
+# http://www.gentoo.org/main/en/lists.xml [mailing lists]
+# http://forums.gentoo.org/ [web forums]
+# irc://irc.freenode.net#gentoo-apache [irc chat]
+#
+# Bug Reports:
+# http://bugs.gentoo.org [gentoo related bugs]
+# http://httpd.apache.org/bug_report.html [apache httpd related bugs]
+#
+#
+# This is the main Apache HTTP server configuration file. It contains the
+# configuration directives that give the server its instructions.
+# See <URL:http://httpd.apache.org/docs/2.2> for detailed information.
+# In particular, see
+# <URL:http://httpd.apache.org/docs/2.2/mod/directives.html>
+# for a discussion of each configuration directive.
+#
+# Do NOT simply read the instructions in here without understanding
+# what they do. They're here only as hints or reminders. If you are unsure
+# consult the online docs. You have been warned.
+#
+# Configuration and logfile names: If the filenames you specify for many
+# of the server's control files begin with "/" (or "drive:/" for Win32), the
+# server will use that explicit path. If the filenames do *not* begin
+# with "/", the value of ServerRoot is prepended -- so "var/log/apache2/foo_log"
+# with ServerRoot set to "/usr" will be interpreted by the
+# server as "/usr/var/log/apache2/foo.log".
+
+# ServerRoot: The top of the directory tree under which the server's
+# configuration, error, and log files are kept.
+#
+# Do not add a slash at the end of the directory path. If you point
+# ServerRoot at a non-local disk, be sure to point the LockFile directive
+# at a local disk. If you wish to share the same ServerRoot for multiple
+# httpd daemons, you will need to change at least LockFile and PidFile.
+ServerRoot "/usr/lib/apache2"
+
+# Dynamic Shared Object (DSO) Support
+#
+# To be able to use the functionality of a module which was built as a DSO you
+# have to place corresponding `LoadModule' lines at this location so the
+# directives contained in it are actually available _before_ they are used.
+# Statically compiled modules (those listed by `httpd -l') do not need
+# to be loaded here.
+#
+# Example:
+# LoadModule foo_module modules/mod_foo.so
+#
+# GENTOO: Automatically defined based on APACHE2_MODULES USE_EXPAND variable.
+# Do not change manually, it will be overwritten on upgrade.
+#
+# The following modules are considered as the default configuration.
+# If you wish to disable one of them, you may have to alter other
+# configuration directives.
+#
+# Change these at your own risk!
+
+LoadModule actions_module modules/mod_actions.so
+LoadModule alias_module modules/mod_alias.so
+LoadModule auth_basic_module modules/mod_auth_basic.so
+<IfDefine AUTH_DIGEST>
+LoadModule auth_digest_module modules/mod_auth_digest.so
+</IfDefine>
+LoadModule authn_anon_module modules/mod_authn_anon.so
+LoadModule authn_dbm_module modules/mod_authn_dbm.so
+LoadModule authn_default_module modules/mod_authn_default.so
+LoadModule authn_file_module modules/mod_authn_file.so
+LoadModule authz_dbm_module modules/mod_authz_dbm.so
+LoadModule authz_default_module modules/mod_authz_default.so
+LoadModule authz_groupfile_module modules/mod_authz_groupfile.so
+LoadModule authz_host_module modules/mod_authz_host.so
+LoadModule authz_owner_module modules/mod_authz_owner.so
+LoadModule authz_user_module modules/mod_authz_user.so
+LoadModule autoindex_module modules/mod_autoindex.so
+<IfDefine CACHE>
+LoadModule cache_module modules/mod_cache.so
+</IfDefine>
+LoadModule cgi_module modules/mod_cgi.so
+LoadModule deflate_module modules/mod_deflate.so
+LoadModule dir_module modules/mod_dir.so
+<IfDefine CACHE>
+LoadModule disk_cache_module modules/mod_disk_cache.so
+</IfDefine>
+LoadModule env_module modules/mod_env.so
+LoadModule expires_module modules/mod_expires.so
+LoadModule ext_filter_module modules/mod_ext_filter.so
+<IfDefine CACHE>
+LoadModule file_cache_module modules/mod_file_cache.so
+</IfDefine>
+LoadModule filter_module modules/mod_filter.so
+LoadModule headers_module modules/mod_headers.so
+LoadModule include_module modules/mod_include.so
+<IfDefine INFO>
+LoadModule info_module modules/mod_info.so
+</IfDefine>
+LoadModule log_config_module modules/mod_log_config.so
+LoadModule logio_module modules/mod_logio.so
+<IfDefine CACHE>
+LoadModule mem_cache_module modules/mod_mem_cache.so
+</IfDefine>
+LoadModule mime_module modules/mod_mime.so
+LoadModule mime_magic_module modules/mod_mime_magic.so
+LoadModule negotiation_module modules/mod_negotiation.so
+<IfDefine PROXY>
+LoadModule proxy_module modules/mod_proxy.so
+</IfDefine>
+<IfDefine PROXY>
+LoadModule proxy_ajp_module modules/mod_proxy_ajp.so
+</IfDefine>
+<IfDefine PROXY>
+LoadModule proxy_balancer_module modules/mod_proxy_balancer.so
+</IfDefine>
+<IfDefine PROXY>
+LoadModule proxy_connect_module modules/mod_proxy_connect.so
+</IfDefine>
+<IfDefine PROXY>
+LoadModule proxy_http_module modules/mod_proxy_http.so
+</IfDefine>
+LoadModule rewrite_module modules/mod_rewrite.so
+LoadModule setenvif_module modules/mod_setenvif.so
+LoadModule speling_module modules/mod_speling.so
+<IfDefine SSL>
+LoadModule ssl_module modules/mod_ssl.so
+</IfDefine>
+<IfDefine STATUS>
+LoadModule status_module modules/mod_status.so
+</IfDefine>
+<IfDefine SUEXEC>
+LoadModule suexec_module modules/mod_suexec.so
+</IfDefine>
+LoadModule unique_id_module modules/mod_unique_id.so
+<IfDefine USERDIR>
+LoadModule userdir_module modules/mod_userdir.so
+</IfDefine>
+LoadModule usertrack_module modules/mod_usertrack.so
+LoadModule vhost_alias_module modules/mod_vhost_alias.so
+
+#
+# HostnameLookups: Log the names of clients or just their IP addresses
+# e.g., www.apache.org (on) or 204.62.129.132 (off).
+# The default is off because it'd be overall better for the net if people
+# had to knowingly turn this feature on, since enabling it means that
+# each client request will result in AT LEAST one lookup request to the
+# nameserver.
+#
+HostnameLookups Off
+
+# If you wish httpd to run as a different user or group, you must run
+# httpd as root initially and it will switch.
+#
+# User/Group: The name (or #number) of the user/group to run httpd as.
+# It is usually good practice to create a dedicated user and group for
+# running httpd, as with most system services.
+User backuppc
+Group backuppc
+
+# Supplemental configuration
+#
+# Most of the configuration files in the /etc/apache2/modules.d/ directory can
+# be turned on using APACHE2_OPTS in /etc/conf.d/apache2 to add extra features
+# or to modify the default configuration of the server.
+#
+# To know which flag to add to APACHE2_OPTS, look at the first line of the
+# the file, which will usually be an <IfDefine OPTION> where OPTION is the
+# flag to use.
+
+Include /etc/apache2/modules.d/*.conf
+
+# Unique lock file
+LockFile /var/lock/apache-backuppc.lock
+
+# Very important for init script
+# Unique process ID file
+PidFile /var/run/apache-backuppc.pid
+
+# Unique scoreboard file
+ScoreBoardFile /var/run/apache-backuppc.scoreboard
+
+# Common document root
+<IfDefine BACKUPPC_VHOST>
+
+
+# Common document root
+DocumentRoot HTDOCSDIR
+# see bug #178966 why this is in here
+
+# Listen: Allows you to bind Apache to specific IP addresses and/or
+# ports, instead of the default. See also the <VirtualHost>
+# directive.
+#
+# Change this to Listen on specific IP addresses as shown below to
+# prevent Apache from glomming onto all bound IP addresses.
+#
+#Listen 12.34.56.78:80
+Listen 80
+
+# Use name-based virtual hosting.
+NameVirtualHost *:80
+
+# When virtual hosts are enabled, the main host defined in the default
+# httpd.conf configuration will go away. We redefine it here so that it is
+# still available.
+#
+# If you disable this vhost by removing -D DEFAULT_VHOST from
+# /etc/conf.d/apache2, the first defined virtual host elsewhere will be
+# the default.
+<VirtualHost *:80>
+ ServerName backuppc
+
+ # Redirect requests to "/" to the CGI script
+ RedirectMatch "^/$" /BackupPC_Admin
+
+ <IfDefine SSL>
+ <IfModule ssl_module>
+ RewriteEngine On
+ RewriteCond %{HTTPS} !=on
+ RewriteRule ^/(.*) https://%{SERVER_NAME}/$1 [R,L]
+
+ ## SSL Engine Switch:
+ # Enable/Disable SSL for this virtual host.
+ SSLEngine on
+ SSLOptions +StrictRequire
+
+ ## SSL Cipher Suite:
+ # List the ciphers that the client is permitted to negotiate.
+ # See the mod_ssl documentation for a complete list.
+ SSLCipherSuite ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP:+eNULL
+
+ ## Server Certificate:
+ # Point SSLCertificateFile at a PEM encoded certificate. If the certificate
+ # is encrypted, then you will be prompted for a pass phrase. Note that a
+ # kill -HUP will prompt again. Keep in mind that if you have both an RSA
+ # and a DSA certificate you can configure both in parallel (to also allow
+ # the use of DSA ciphers, etc.)
+ SSLCertificateFile /etc/ssl/apache2/server.crt
+
+ ## Server Private Key:
+ # If the key is not combined with the certificate, use this directive to
+ # point at the key file. Keep in mind that if you've both a RSA and a DSA
+ # private key you can configure both in parallel (to also allow the use of
+ # DSA ciphers, etc.)
+ SSLCertificateKeyFile /etc/ssl/apache2/server.key
+ <FilesMatch "\.(cgi|shtml|phtml|php)$">
+ SSLOptions +StdEnvVars
+ </FilesMatch>
+
+ ## ssl-accurate-shutdown:
+ # This forces an accurate shutdown when the connection is closed, i.e. a
+ # SSL close notify alert is send and mod_ssl waits for the close notify
+ # alert of the client. This is 100% SSL/TLS standard compliant, but in
+ # practice often causes hanging connections with brain-dead browsers. Use
+ # this only for browsers where you know that their SSL implementation works
+ # correctly.
+ # Notice: Most problems of broken clients are also related to the HTTP
+ # keep-alive facility, so you usually additionally want to disable
+ # keep-alive for those clients, too. Use variable "nokeepalive" for this.
+ # Similarly, one has to force some clients to use HTTP/1.0 to workaround
+ # their broken HTTP/1.1 implementation. Use variables "downgrade-1.0" and
+ # "force-response-1.0" for this.
+ <IfModule setenvif_module>
+ BrowserMatch ".*MSIE.*" \
+ nokeepalive ssl-unclean-shutdown \
+ downgrade-1.0 force-response-1.0
+ </IfModule>
+
+ ## Per-Server Logging:
+ # The home of a custom SSL log file. Use this when you want a compact
+ # non-error SSL logfile on a virtual host basis.
+ <IfModule log_config_module>
+ CustomLog /var/log/apache2/ssl_request_log \
+ "%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \"%r\" %b"
+ </IfModule>
+ </IfModule>
+ </IfDefine>
+
+<Directory "HTDOCSDIR">
+ # Possible values for the Options directive are "None", "All",
+ # or any combination of:
+ # Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
+ #
+ # Note that "MultiViews" must be named *explicitly* --- "Options All"
+ # doesn't give it to you.
+ #
+ # The Options directive is both complicated and important. Please see
+ # http://httpd.apache.org/docs/2.2/mod/core.html#options
+ # for more information.
+ Options Indexes FollowSymLinks
+
+ # AllowOverride controls what directives may be placed in .htaccess files.
+ # It can be "All", "None", or any combination of the keywords:
+ # Options FileInfo AuthConfig Limit
+ AllowOverride None
+
+ <IfDefine SSL>
+ <IfModule ssl_module>
+ SSLOptions +StdEnvVars
+ </IfModule>
+ </IfDefine>
+
+ SetHandler perl-script
+ PerlResponseHandler ModPerl::Registry
+ PerlOptions +ParseHeaders
+ Options +ExecCGI
+
+ Order allow,deny
+ Allow from all
+
+ AuthName "Backup Admin"
+ AuthType Basic
+ AuthUserFile AUTHFILE
+ Require valid-user
+</Directory>
+
+<Directory "HTDOCSDIR/image">
+ SetHandler None
+ Options Indexes FollowSymLinks
+ Order allow,deny
+ Allow from all
+</Directory>
+
+
+ <IfModule mpm_peruser_module>
+ ServerEnvironment backuppc backuppc
+ </IfModule>
+</VirtualHost>
+</IfDefine>
+
+
+# vim: ts=4 filetype=apache
--- /dev/null
+Please make sure to edit /etc/backuppc/config.pl to suit your needs.
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>app-backup</herd>
+ <upstream>
+ <remote-id type="sourceforge">backuppc</remote-id>
+ </upstream>
+</pkgmetadata>