summaryrefslogtreecommitdiff
path: root/distribution
diff options
context:
space:
mode:
authorBen Summers <ben@fluffy.co.uk>2005-10-14 08:50:54 +0000
committerBen Summers <ben@fluffy.co.uk>2005-10-14 08:50:54 +0000
commit99f8ce096bc5569adbfea1911dbcda24c28d8d8b (patch)
tree049c302161fea1f2f6223e1e8f3c40d9e8aadc8b /distribution
Box Backup 0.09 with a few tweeks
Diffstat (limited to 'distribution')
-rw-r--r--distribution/COMMON-MANIFEST.txt24
-rw-r--r--distribution/boxbackup/CONTACT.txt6
-rw-r--r--distribution/boxbackup/DISTRIBUTION-MANIFEST.txt34
-rw-r--r--distribution/boxbackup/DOCUMENTATION.txt6
-rw-r--r--distribution/boxbackup/LICENSE.txt37
-rwxr-xr-xdistribution/boxbackup/LINUX.txt27
-rw-r--r--distribution/boxbackup/NETBSD.txt8
-rw-r--r--distribution/boxbackup/THANKS.txt37
-rw-r--r--distribution/boxbackup/VERSION.txt2
-rw-r--r--distribution/boxbackup/contrib/cygwin/README.txt30
-rwxr-xr-xdistribution/boxbackup/contrib/cygwin/install-cygwin-service.pl112
-rwxr-xr-xdistribution/boxbackup/contrib/cygwin/remove-cygwin-service.sh14
-rw-r--r--distribution/boxbackup/contrib/redhat/README.txt7
-rw-r--r--distribution/boxbackup/contrib/redhat/bbackupd83
-rw-r--r--distribution/boxbackup/contrib/redhat/bbstored83
-rw-r--r--distribution/boxbackup/contrib/rpm/README.txt16
-rw-r--r--distribution/boxbackup/contrib/rpm/boxbackup.spec206
-rw-r--r--distribution/boxbackup/contrib/suse/README.txt5
-rw-r--r--distribution/boxbackup/contrib/suse/bbackupd101
-rw-r--r--distribution/boxbackup/contrib/suse/bbstored103
20 files changed, 941 insertions, 0 deletions
diff --git a/distribution/COMMON-MANIFEST.txt b/distribution/COMMON-MANIFEST.txt
new file mode 100644
index 00000000..5f734964
--- /dev/null
+++ b/distribution/COMMON-MANIFEST.txt
@@ -0,0 +1,24 @@
+lib/common
+lib/crypto
+lib/server
+lib/compress
+test/common
+test/common/testfiles
+test/basicserver
+test/basicserver/testfiles
+test/crypto
+test/compress
+docs/common notes
+docs/common/lib_common notes/lib_common
+docs/common/lib_crypto notes/lib_crypto
+docs/common/lib_server notes/lib_server
+MKDIR infrastructure
+infrastructure/buildenv-testmain-template.cpp
+infrastructure/makebuildenv.pl
+infrastructure/BoxPlatform.pm
+infrastructure/makeparcels.pl
+MKDIR infrastructure/tests
+infrastructure/tests/common_tests.pl
+parcels.txt
+configure
+runtest.pl
diff --git a/distribution/boxbackup/CONTACT.txt b/distribution/boxbackup/CONTACT.txt
new file mode 100644
index 00000000..849c1e76
--- /dev/null
+++ b/distribution/boxbackup/CONTACT.txt
@@ -0,0 +1,6 @@
+
+http://www.fluffy.co.uk/boxbackup/
+
+Ben Summers
+ben@fluffy.co.uk
+
diff --git a/distribution/boxbackup/DISTRIBUTION-MANIFEST.txt b/distribution/boxbackup/DISTRIBUTION-MANIFEST.txt
new file mode 100644
index 00000000..72b3866d
--- /dev/null
+++ b/distribution/boxbackup/DISTRIBUTION-MANIFEST.txt
@@ -0,0 +1,34 @@
+lib/raidfile
+test/raidfile
+test/raidfile/testfiles
+lib/backupclient
+lib/backupstore
+bin/bbstored
+bin/bbstoreaccounts
+bin/bbackupd
+bin/bbackupquery
+bin/bbackupctl
+bin/bbackupobjdump
+test/backupstore
+test/backupstore/testfiles
+test/backupstorefix
+test/backupstorefix/testfiles
+test/backupstorepatch
+test/bbackupd
+test/bbackupd/testfiles
+test/backupdiff
+docs/raidfile notes
+docs/raidfile/lib_raidfile notes/lib_raidfile
+docs/backup notes
+TODO.txt
+BUGS.txt
+distribution/boxbackup/contrib contrib
+NO-LICENSE-IN-DIR contrib/rpm
+distribution/boxbackup/contrib/rpm contrib/rpm
+REPLACE-VERSION-IN contrib/rpm/boxbackup.spec
+NO-LICENSE-IN-DIR contrib/redhat
+distribution/boxbackup/contrib/redhat contrib/redhat
+NO-LICENSE-IN-DIR contrib/suse
+distribution/boxbackup/contrib/suse contrib/suse
+NO-LICENSE-IN-DIR contrib/cygwin
+distribution/boxbackup/contrib/cygwin contrib/cygwin
diff --git a/distribution/boxbackup/DOCUMENTATION.txt b/distribution/boxbackup/DOCUMENTATION.txt
new file mode 100644
index 00000000..1cda3a2a
--- /dev/null
+++ b/distribution/boxbackup/DOCUMENTATION.txt
@@ -0,0 +1,6 @@
+
+For compilation and installation instructions, see the web site at
+
+ http://www.fluffy.co.uk/boxbackup/
+
+
diff --git a/distribution/boxbackup/LICENSE.txt b/distribution/boxbackup/LICENSE.txt
new file mode 100644
index 00000000..fc3f9f3e
--- /dev/null
+++ b/distribution/boxbackup/LICENSE.txt
@@ -0,0 +1,37 @@
+
+Copyright (c) 2003, 2005
+ Ben Summers. All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions
+are met:
+1. Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+3. All use of this software and associated advertising materials must
+ display the following acknowledgement:
+ This product includes software developed by Ben Summers.
+4. The names of the Authors may not be used to endorse or promote
+ products derived from this software without specific prior written
+ permission.
+
+[Where legally impermissible the Authors do not disclaim liability for
+direct physical injury or death caused solely by defects in the software
+unless it is modified by a third party.]
+
+THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR
+IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY DIRECT,
+INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGE.
+
+
+ \ No newline at end of file
diff --git a/distribution/boxbackup/LINUX.txt b/distribution/boxbackup/LINUX.txt
new file mode 100755
index 00000000..3342ab2a
--- /dev/null
+++ b/distribution/boxbackup/LINUX.txt
@@ -0,0 +1,27 @@
+
+For instructions on building an RPM of Box Backup, see the contrib/rpm
+directory. This is primarily for RedHat style systems, but notes are provided
+on what needs to be modified for SUSE.
+
+
+Requirements:
+
+ OpenSSL 0.9.7
+
+Require zlib and openssl headers for compilation -- may not be included when
+installing the packages. (libssl-dev + libz-dev packages under debian)
+
+Bekerley DB v1 support is required. The configure script should find an
+appropriate db package -- and if not, use an in-memory version of the code.
+However, the in-memory version is not desirable as it will lose information
+over restarts of the daemon.
+
+Ideally, include the readline headers -- libreadline4-dev, probably.
+
+
+
+(OpenSSL 0.9.7 is required as it implements new interfaces which make encryption
+using the same key faster by avoiding key setup each time around. Configure it with
+./config shared , then copy the libs and headers into the required places.)
+
+
diff --git a/distribution/boxbackup/NETBSD.txt b/distribution/boxbackup/NETBSD.txt
new file mode 100644
index 00000000..03000791
--- /dev/null
+++ b/distribution/boxbackup/NETBSD.txt
@@ -0,0 +1,8 @@
+
+Install perl
+
+Install OpenSSL 0.9.7 or later.
+
+Not a completely working port -- symlinks don't get backed up or restored properly.
+(run test/bbackupd)
+
diff --git a/distribution/boxbackup/THANKS.txt b/distribution/boxbackup/THANKS.txt
new file mode 100644
index 00000000..42736a65
--- /dev/null
+++ b/distribution/boxbackup/THANKS.txt
@@ -0,0 +1,37 @@
+
+Many individuals have helped with the development of Box Backup by testing, reporting experiences, and making suggestions. In particular, thanks are due to
+
+Pascal Lalonde
+ - Comprehensive and accurate bug reports, and constructive feedback
+
+Paul Arch
+ - Cygwin client port
+
+Ben Lovett
+ - Help with odd architectures, suggesting small changes
+
+Martin Ebourne
+ - RPM specification for RedHat based Linux distributions
+ - Patch to fix problems on 64 bit architectures
+ - Patch to fix compilation after RedHat Fedora's latest changes
+
+Per Thomsen
+ - Cygwin Windows service install scripts and build notes
+
+Tim Fletcher
+David Harris
+Richard Eigenmann
+ - Testing many attempts at clean compiles on various Linux distributions
+
+Eduardo Alvarenga
+ - Valuable feedback and persuasion to include new features
+
+Joe Gillespie
+ - Web site design
+
+Jrme Schell
+ - Fixes to build+config problems on Linux
+
+John Pybus
+ - Ideas and feature requests
+ - Useful little patches to code
diff --git a/distribution/boxbackup/VERSION.txt b/distribution/boxbackup/VERSION.txt
new file mode 100644
index 00000000..88e195fb
--- /dev/null
+++ b/distribution/boxbackup/VERSION.txt
@@ -0,0 +1,2 @@
+0.08
+boxbackup
diff --git a/distribution/boxbackup/contrib/cygwin/README.txt b/distribution/boxbackup/contrib/cygwin/README.txt
new file mode 100644
index 00000000..83f32fd9
--- /dev/null
+++ b/distribution/boxbackup/contrib/cygwin/README.txt
@@ -0,0 +1,30 @@
+ Making boxbackup run as a Windows Service
+
+For most installations (with the default locations for config files,
+etc.) running the install-cygwin-service.pl script will complete the
+installation painlessly, and you will have a running bbackupd after
+completing the installation, and whenever you reboot.
+
+Simply run the script:
+
+perl install-cygwin-service.pl
+
+The service can be monitored in the Windows Service Manager. It is named
+boxbackup.
+
+For non-standard configurations, there are command-line options to point
+the script to the bbackupd.conf config file, and the bbackupd.exe
+executable:
+
+perl install-cygwin-service.pl [-c <path-to-bbackupd-config-file>] [-e
+<path-to-bbackupd-executable-file>]
+
+
+ Removing the Service
+
+If you decide not to run backups on a machine anymore, simply remove the
+service by running:
+
+sh remove-cygwin-service.sh
+
+
diff --git a/distribution/boxbackup/contrib/cygwin/install-cygwin-service.pl b/distribution/boxbackup/contrib/cygwin/install-cygwin-service.pl
new file mode 100755
index 00000000..65758067
--- /dev/null
+++ b/distribution/boxbackup/contrib/cygwin/install-cygwin-service.pl
@@ -0,0 +1,112 @@
+#!/usr/bin/perl -w
+
+
+# Contributed to the boxbackup project by Per Reedtz Thomsen. pthomsen@reedtz.com
+
+# This script reads the config file for boxbackup, and changes the mode
+# of the directory named by 'DataDirectory' and any files there. Also,
+# the files pointed to by the 'CommandSocket' and 'PidFile' configuration
+# parameters will be chmod'ed to be read-write by all.
+# The Windows services are created and started using the 'cygrunsrv' utility.
+
+# Date Who Comments
+# 20041005 pthomsen@reedtz.com Created
+# 20041020 pthomsen@reedtz.com Switched to using Getopt::Std for cmd-line things.
+
+use strict;
+
+use Getopt::Std;
+getopt('ce');
+our ($opt_c, $opt_e);
+# Figure out the config file to use. Default is /etc/box/bbackupd.conf
+my $confFile = (defined($opt_c) ? $opt_c : "/etc/box/bbackupd.conf");
+# Figure out the bbaackupd executable to use. Default is /usr/local/bin/bbackupd.exe
+my $exeFile = (defined($opt_e) ? $opt_e : "/usr/local/bin/bbackupd.exe");
+
+die "File $confFile does not exist. Please provide the full path to the bbackupd configuration file.\n" if !(-f $confFile);
+die "Can't read $confFile. Permission denied. Please chmod the file so I can read it.\n" if !(-r $confFile);
+die "File $exeFile does not exist. Please provide the full path to the bbackupd.exe file.\n" if !(-f $exeFile);
+die "File $exeFile is not executable. Please provide the full path to the correct bbackupd.exe file.\n" if !(-x $exeFile);
+
+# print "Config: $confFile\n";
+
+my $dataDir;
+my $cmdSocket;
+my $pidFile;
+
+open (CONFIG, "<$confFile") or die "Can't open $confFile: $!\n";
+
+# Read the confgiguration file, and pull the DataDirectory, CommandSocket, and PidFile parameters.
+while (<CONFIG>)
+{
+
+ if (/^\s*DataDirectory\s*=\s*([^\n\s]+)\s*\n/)
+ {
+ $dataDir = $1;
+ next;
+ }
+
+ if (/^\s*CommandSocket\s*=\s*([^\n\s]+)\s*\n/)
+ {
+ $cmdSocket = $1;
+ next;
+ }
+ if (/^\s*PidFile\s*=\s*([^\n\s]+)\s*\n/)
+ {
+ $pidFile = $1;
+ next;
+ }
+}
+
+# check that we got all the parameters from the file. If not, die.
+if ((!defined($dataDir)) || (!defined($cmdSocket)) || (!defined($pidFile)))
+{
+ die "Could not read config parameters from $confFile. Values retrieved:\n\tDataDirectory = $dataDir\n\tCommandSocket = $cmdSocket\n\tPidFile = $pidFile\n";
+}
+
+
+print "Parameters retrieved from $confFile. Values:\n\tDataDirectory = $dataDir\n\tCommandSocket = $cmdSocket\n\tPidFile = $pidFile\n";
+print "chmod...";
+# change the mode of the files/dirs retrieved.
+chmod(0777, $dataDir) or die "Can't chmod $dataDir: $!\n";
+chmod(0666, "$dataDir/*") or die "Can't chmod $dataDir/*: $!\n";
+chmod(0666, $pidFile) or die "Can't chmod $pidFile: $!\n";
+chmod(0755, $cmdSocket) or die "Can't chmod $cmdSocket: $!\n";
+print " Done.\n";
+
+# Now install the service using cygrunsrv.
+# Details:
+# -I <svc_name> Install a service. svc_name is the name under which the
+# service will appear in the Windows Service Manager
+# -p <path_to_exe> Path to the executable.
+# -a <options> Command line options to the executable.
+# -f <description> Description of the service.
+# -o Attempt clean exit of service during system shutdown
+
+print "Installing boxbackup service...";
+my $sysCmd = "cygrunsrv.exe -I boxbackup -p " . $exeFile;
+$sysCmd .= " -a \"" . $confFile . " SINGLEPROCESS\"";
+$sysCmd .= " -o -f \"Online Backup System by Ben Summers\"";
+print "$sysCmd\n";
+my $output = qx($sysCmd);
+die "cygrunsrv failed to install service. Error Message: $output\n" if($output ne "");
+print " Done.\n";
+
+
+# Start the service
+# Details:
+# -S <svc_name> Start a service. svc_name is the name of the (installed)
+# service to start.
+
+print "Starting boxbackup service...";
+$sysCmd = "cygrunsrv.exe -S boxbackup";
+print "$sysCmd\n";
+$output = qx($sysCmd);
+die "cygrunsrv failed to start service. Error Message: $output\n" if($output ne "");
+print " Done.\n";
+
+print "\n\nService Installation complete. To test, reboot your machine, and make sure that\n";
+print "the boxbackup service is running. A good way to make sure, is to check that the account number\n";
+print "from this machine is connecting to the bbstored server. Check the bbstored logs for more info.\n\n";
+
+
diff --git a/distribution/boxbackup/contrib/cygwin/remove-cygwin-service.sh b/distribution/boxbackup/contrib/cygwin/remove-cygwin-service.sh
new file mode 100755
index 00000000..e766333d
--- /dev/null
+++ b/distribution/boxbackup/contrib/cygwin/remove-cygwin-service.sh
@@ -0,0 +1,14 @@
+#!/bin/bash
+
+# Contributed to the boxbackup project by Per Reedtz Thomsen. pthomsen@reedtz.com
+
+# This script removes the 'boxbackup' service from the Windows service manager
+# using the cygrunsrv utility.
+
+# Date Who Comments
+# 20041005 pthomsen@reedtz.com Created
+
+cygrunsrv -R boxbackup
+
+echo "Service \"boxbackup\" removed."
+
diff --git a/distribution/boxbackup/contrib/redhat/README.txt b/distribution/boxbackup/contrib/redhat/README.txt
new file mode 100644
index 00000000..cfc8d968
--- /dev/null
+++ b/distribution/boxbackup/contrib/redhat/README.txt
@@ -0,0 +1,7 @@
+These start scripts are for Fedora Core or RedHat Enterprise Linux. If
+installed manually they should be placed in /etc/rc.d/init.d.
+
+They may also work for Mandrake.
+
+Martin Ebourne
+martin@zepler.org
diff --git a/distribution/boxbackup/contrib/redhat/bbackupd b/distribution/boxbackup/contrib/redhat/bbackupd
new file mode 100644
index 00000000..63c61ff7
--- /dev/null
+++ b/distribution/boxbackup/contrib/redhat/bbackupd
@@ -0,0 +1,83 @@
+#! /bin/bash
+#
+# bbackupd Start/Stop the box backup daemon.
+#
+# chkconfig: 345 93 07
+# description: bbackup is the client side deamon for Box Backup, a completely \
+# automatic on-line backup system
+# processname: bbackupd
+# config: /etc/box
+# pidfile: /var/run/bbackupd.pid
+
+# Source function library.
+. /etc/init.d/functions
+
+RETVAL=0
+
+# See how we were called.
+
+prog="bbackupd"
+
+# Check that configuration exists.
+[ -f /etc/box/$prog.conf ] || exit 0
+
+start() {
+ echo -n $"Starting $prog: "
+ daemon $prog
+ RETVAL=$?
+ echo
+ [ $RETVAL -eq 0 ] && touch /var/lock/subsys/$prog
+ return $RETVAL
+}
+
+stop() {
+ echo -n $"Stopping $prog: "
+ killproc $prog
+ RETVAL=$?
+ echo
+ [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/$prog
+ return $RETVAL
+}
+
+rhstatus() {
+ status $prog
+}
+
+restart() {
+ stop
+ start
+}
+
+reload() {
+ echo -n $"Reloading $prog daemon configuration: "
+ killproc $prog -HUP
+ retval=$?
+ echo
+ return $RETVAL
+}
+
+case "$1" in
+ start)
+ start
+ ;;
+ stop)
+ stop
+ ;;
+ restart)
+ restart
+ ;;
+ reload)
+ reload
+ ;;
+ status)
+ rhstatus
+ ;;
+ condrestart)
+ [ -f /var/lock/subsys/$prog ] && restart || :
+ ;;
+ *)
+ echo $"Usage: $0 {start|stop|status|reload|restart|condrestart}"
+ exit 1
+esac
+
+exit $?
diff --git a/distribution/boxbackup/contrib/redhat/bbstored b/distribution/boxbackup/contrib/redhat/bbstored
new file mode 100644
index 00000000..eadca1d1
--- /dev/null
+++ b/distribution/boxbackup/contrib/redhat/bbstored
@@ -0,0 +1,83 @@
+#! /bin/bash
+#
+# bbstored Start/Stop the box backup daemon.
+#
+# chkconfig: 345 93 07
+# description: bbstore is the server side deamon for Box Backup, a completely \
+# automatic on-line backup system
+# processname: bbstored
+# config: /etc/box
+# pidfile: /var/run/bbstored.pid
+
+# Source function library.
+. /etc/init.d/functions
+
+RETVAL=0
+
+# See how we were called.
+
+prog="bbstored"
+
+# Check that configuration exists.
+[ -f /etc/box/$prog.conf ] || exit 0
+
+start() {
+ echo -n $"Starting $prog: "
+ daemon $prog
+ RETVAL=$?
+ echo
+ [ $RETVAL -eq 0 ] && touch /var/lock/subsys/$prog
+ return $RETVAL
+}
+
+stop() {
+ echo -n $"Stopping $prog: "
+ killproc $prog
+ RETVAL=$?
+ echo
+ [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/$prog
+ return $RETVAL
+}
+
+rhstatus() {
+ status $prog
+}
+
+restart() {
+ stop
+ start
+}
+
+reload() {
+ echo -n $"Reloading $prog daemon configuration: "
+ killproc $prog -HUP
+ retval=$?
+ echo
+ return $RETVAL
+}
+
+case "$1" in
+ start)
+ start
+ ;;
+ stop)
+ stop
+ ;;
+ restart)
+ restart
+ ;;
+ reload)
+ reload
+ ;;
+ status)
+ rhstatus
+ ;;
+ condrestart)
+ [ -f /var/lock/subsys/$prog ] && restart || :
+ ;;
+ *)
+ echo $"Usage: $0 {start|stop|status|reload|restart|condrestart}"
+ exit 1
+esac
+
+exit $?
diff --git a/distribution/boxbackup/contrib/rpm/README.txt b/distribution/boxbackup/contrib/rpm/README.txt
new file mode 100644
index 00000000..290a5252
--- /dev/null
+++ b/distribution/boxbackup/contrib/rpm/README.txt
@@ -0,0 +1,16 @@
+BUILDING AN RPM
+
+The easy way is to:
+
+rpmbuild -ta <tarfile>
+
+where <tarfile> is the archive you downloaded of Box Backup.
+
+This RPM should work on RedHat Enterprise, Fedora Core, Mandrake, SUSE, and
+any similar distributions. It has been developed and tested on Fedora Core.
+
+Changes for SUSE Linux were provided by Chris Smith
+(chris.smith@nothingbutnet.co.nz).
+
+Martin Ebourne
+martin@zepler.org
diff --git a/distribution/boxbackup/contrib/rpm/boxbackup.spec b/distribution/boxbackup/contrib/rpm/boxbackup.spec
new file mode 100644
index 00000000..2dd88cc1
--- /dev/null
+++ b/distribution/boxbackup/contrib/rpm/boxbackup.spec
@@ -0,0 +1,206 @@
+%define bb_user_id 171
+%define ident %{name}-%{version}
+
+# Detect distribution. So far we only special-case SUSE. If you need to make
+# any distro specific changes to get the package building on your system
+# please email them to martin@zepler.org
+#%define is_fc %(test -e %{_sysconfdir}/fedora-release && echo 1 || echo 0)
+#%define is_mdk %(test -e %{_sysconfdir}/mandrake-release && echo 1 || echo 0)
+#%define is_rh %(test -e %{_sysconfdir}/redhat-release && echo 1 || echo 0)
+%define is_suse %(test -e %{_sysconfdir}/SuSE-release && echo 1 || echo 0)
+
+%if %{is_suse}
+%define init_dir %{_sysconfdir}/init.d
+%define dist suse
+%define rc_start rc
+%else
+%define init_dir %{_sysconfdir}/rc.d/init.d
+%define dist redhat
+%define rc_start "service "
+%endif
+
+Summary: An automatic on-line backup system for UNIX.
+Name: boxbackup
+Version: ###DISTRIBUTION-VERSION-NUMBER###
+Release: 1
+License: BSD
+Group: Applications/Archiving
+Packager: Martin Ebourne <martin@zepler.org>
+URL: http://www.fluffy.co.uk/boxbackup/
+Source0: %{ident}.tgz
+Requires: openssl >= 0.9.7a
+BuildRoot: %{_tmppath}/%{ident}-%{release}-root
+BuildRequires: openssl >= 0.9.7a, openssl-devel
+
+%description
+Box Backup is a completely automatic on-line backup system. Backed up files
+are stored encrypted on a filesystem on a remote server, which does not need
+to be trusted. The backup server runs as a daemon on the client copying only
+the changes within files, and old versions and deleted files are retained. It
+is designed to be easy and cheap to run a server and (optional) RAID is
+implemented in userland for ease of use.
+
+%package client
+Summary: An automatic on-line backup system for UNIX.
+Group: Applications/Archiving
+
+%description client
+Box Backup is a completely automatic on-line backup system. Backed up files
+are stored encrypted on a filesystem on a remote server, which does not need
+to be trusted. The backup server runs as a daemon on the client copying only
+the changes within files, and old versions and deleted files are retained. It
+is designed to be easy and cheap to run a server and (optional) RAID is
+implemented in userland for ease of use.
+
+This package contains the client.
+
+%package server
+Summary: An automatic on-line backup system for UNIX.
+Group: System Environment/Daemons
+
+%description server
+Box Backup is a completely automatic on-line backup system. Backed up files
+are stored encrypted on a filesystem on a remote server, which does not need
+to be trusted. The backup server runs as a daemon on the client copying only
+the changes within files, and old versions and deleted files are retained. It
+is designed to be easy and cheap to run a server and (optional) RAID is
+implemented in userland for ease of use.
+
+This package contains the server.
+
+%prep
+%setup -q
+
+%build
+./configure
+
+make
+
+%install
+rm -rf $RPM_BUILD_ROOT
+
+mkdir -p $RPM_BUILD_ROOT%{_docdir}/%{ident}
+mkdir -p $RPM_BUILD_ROOT%{_bindir}
+mkdir -p $RPM_BUILD_ROOT%{_sbindir}
+mkdir -p $RPM_BUILD_ROOT%{init_dir}
+mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/box/bbackupd
+mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/box/bbstored
+mkdir -p $RPM_BUILD_ROOT%{_var}/lib/box
+
+install -m 644 BUGS.txt $RPM_BUILD_ROOT%{_docdir}/%{ident}
+install -m 644 LINUX.txt $RPM_BUILD_ROOT%{_docdir}/%{ident}
+install -m 644 VERSION.txt $RPM_BUILD_ROOT%{_docdir}/%{ident}
+install -m 644 CONTACT.txt $RPM_BUILD_ROOT%{_docdir}/%{ident}
+install -m 644 DOCUMENTATION.txt $RPM_BUILD_ROOT%{_docdir}/%{ident}
+install -m 644 ExceptionCodes.txt $RPM_BUILD_ROOT%{_docdir}/%{ident}
+install -m 644 THANKS.txt $RPM_BUILD_ROOT%{_docdir}/%{ident}
+install -m 644 LICENSE.txt $RPM_BUILD_ROOT%{_docdir}/%{ident}
+install -m 644 TODO.txt $RPM_BUILD_ROOT%{_docdir}/%{ident}
+
+# Client
+touch $RPM_BUILD_ROOT%{_sysconfdir}/box/bbackupd.conf
+install -m 755 contrib/%{dist}/bbackupd $RPM_BUILD_ROOT%{init_dir}
+%if %{is_suse}
+ln -s ../../%{init_dir}/bbackupd $RPM_BUILD_ROOT%{_sbindir}/rcbbackupd
+%endif
+%define client_dir parcels/%{ident}-backup-client-Linux
+install %{client_dir}/bbackupd $RPM_BUILD_ROOT%{_sbindir}
+install %{client_dir}/bbackupquery $RPM_BUILD_ROOT%{_sbindir}
+install %{client_dir}/bbackupctl $RPM_BUILD_ROOT%{_sbindir}
+install %{client_dir}/bbackupd-config $RPM_BUILD_ROOT%{_sbindir}
+
+# Server
+touch $RPM_BUILD_ROOT%{_sysconfdir}/box/bbstored.conf
+touch $RPM_BUILD_ROOT%{_sysconfdir}/box/raidfile.conf
+install -m 755 contrib/%{dist}/bbstored $RPM_BUILD_ROOT%{init_dir}
+%if %{is_suse}
+ln -s ../../%{init_dir}/bbstored $RPM_BUILD_ROOT%{_sbindir}/rcbbstored
+%endif
+%define server_dir parcels/%{ident}-backup-server-Linux
+install %{server_dir}/bbstored $RPM_BUILD_ROOT%{_sbindir}
+install %{server_dir}/bbstoreaccounts $RPM_BUILD_ROOT%{_sbindir}
+install %{server_dir}/bbstored-certs $RPM_BUILD_ROOT%{_bindir}
+install %{server_dir}/bbstored-config $RPM_BUILD_ROOT%{_sbindir}
+install %{server_dir}/raidfile-config $RPM_BUILD_ROOT%{_sbindir}
+
+%pre server
+%{_sbindir}/useradd -c "Box Backup" -u %{bb_user_id} \
+ -s /sbin/nologin -r -d / box 2> /dev/null || :
+
+%post client
+/sbin/chkconfig --add bbackupd
+if [ ! -f %{_sysconfdir}/box/bbackupd.conf ]; then
+ echo "You should run the following to configure the client:"
+ echo "bbackupd-config %{_sysconfdir}/box lazy <account-number> <server-host>" \
+ "%{_var}/lib/box <backup-directories>"
+ echo "Then follow the instructions. Use this to start the client:"
+ echo "%{rc_start}bbackupd start"
+fi
+
+%post server
+/sbin/chkconfig --add bbstored
+if [ ! -f %{_sysconfdir}/box/bbstored.conf ]; then
+ echo "You should run the following to configure the server:"
+ echo "raidfile-config %{_sysconfdir}/box 2048 <store-directory> [<raid-directories>]"
+ echo "bbstored-config %{_sysconfdir}/box" `hostname` box
+ echo "Then follow the instructions. Use this to start the server:"
+ echo "%{rc_start}bbstored start"
+fi
+
+%preun client
+if [ $1 = 0 ]; then
+ %{init_dir}/bbackupd stop > /dev/null 2>&1
+ /sbin/chkconfig --del bbackupd
+fi
+
+%preun server
+if [ $1 = 0 ]; then
+ %{init_dir}/bbstored stop > /dev/null 2>&1
+ /sbin/chkconfig --del bbstored
+fi
+
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+%files client
+%defattr(-,root,root,-)
+%dir %attr(700,root,root) %{_sysconfdir}/box/bbackupd
+%dir %attr(755,root,root) %{_var}/lib/box
+%doc %{_docdir}/%{ident}/*.txt
+%config %{init_dir}/bbackupd
+%if %{is_suse}
+%{_sbindir}/rcbbackupd
+%endif
+%config %ghost %{_sysconfdir}/box/bbackupd.conf
+%{_sbindir}/bbackupd
+%{_sbindir}/bbackupquery
+%{_sbindir}/bbackupctl
+%{_sbindir}/bbackupd-config
+
+%files server
+%defattr(-,root,root,-)
+%dir %attr(700,box,root) %{_sysconfdir}/box/bbstored
+%config %{init_dir}/bbstored
+%if %{is_suse}
+%{_sbindir}/rcbbstored
+%endif
+%config %ghost %{_sysconfdir}/box/bbstored.conf
+%config %ghost %{_sysconfdir}/box/raidfile.conf
+%{_sbindir}/bbstored
+%{_sbindir}/bbstoreaccounts
+%{_bindir}/bbstored-certs
+%{_sbindir}/bbstored-config
+%{_sbindir}/raidfile-config
+
+%changelog
+* Fri Oct 1 2004 Martin Ebourne <martin@zepler.org> - 0.08-3
+- Moved most of the exes to /usr/sbin
+- SUSE updates from Chris Smith
+
+* Fri Sep 24 2004 Martin Ebourne <martin@zepler.org> - 0.08-2
+- Added support for other distros
+- Changes for SUSE provided by Chris Smith <chris.smith@nothingbutnet.co.nz>
+
+* Mon Sep 16 2004 Martin Ebourne <martin@zepler.org> - 0.07-1
+- Initial build
diff --git a/distribution/boxbackup/contrib/suse/README.txt b/distribution/boxbackup/contrib/suse/README.txt
new file mode 100644
index 00000000..0f260b7a
--- /dev/null
+++ b/distribution/boxbackup/contrib/suse/README.txt
@@ -0,0 +1,5 @@
+These start scripts are for SUSE Linux. If installed manually they should be
+placed in /etc/init.d.
+
+Copyright (c)2004, Nothing But Net Limited
+<chris.smith@nothingbutnet.co.nz>
diff --git a/distribution/boxbackup/contrib/suse/bbackupd b/distribution/boxbackup/contrib/suse/bbackupd
new file mode 100644
index 00000000..4dd94154
--- /dev/null
+++ b/distribution/boxbackup/contrib/suse/bbackupd
@@ -0,0 +1,101 @@
+#!/bin/sh
+#
+# Copyright (c)2004, Nothing But Net Limited
+# <chris.smith@nothingbutnet.co.nz>
+#
+######################################################################
+# RELEASED AND PROVIDED TO YOU UNDER THE SAME LICENCE AS THE BOXBACKUP
+# SUITE OF PROGRAMS. LICENCE MAY BE VIEWED HERE:
+#
+# http://www.fluffy.co.uk/boxbackup/license.html
+######################################################################
+#
+# /etc/init.d/bbackupd
+# and its symbolic link
+# /(usr/)sbin/rcbbackupd
+#
+### BEGIN INIT INFO
+# Provides: bbackupd
+# Required-Start: $named $network $local_fs $syslog
+# X-UnitedLinux-Should-Start: $time ypbind sendmail
+# Required-Stop: $named $network $localfs $syslog
+# X-UnitedLinux-Should-Stop: $time ypbind sendmail
+# Default-Start: 3 5
+# Default-Stop: 0 1 2 6
+# Short-Description: BoxBackup client side daemon
+# Description: Client daemon for the BoxBackup software
+# that allows you to communicate with a bbstored server.
+### END INIT INFO
+
+# Check for missing binaries (stale symlinks should not happen)
+BBACKUPD_BIN=/usr/sbin/bbackupd
+if [ ! -x $BBACKUPD_BIN ] ; then
+ echo "$BBACKUPD_BIN not installed"
+ exit 5
+fi
+
+. /etc/rc.status
+
+# Reset status of this service
+rc_reset
+
+case "$1" in
+ start)
+ echo -n "Starting bbackupd "
+ startproc $BBACKUPD_BIN
+ rc_status -v
+ ;;
+
+ stop)
+ echo -n "Shutting down bbackupd "
+ killproc -TERM $BBACKUPD_BIN
+ rc_status -v
+ ;;
+
+ try-restart|condrestart)
+ if test "$1" = "condrestart"; then
+ echo "${attn} Use try-restart ${done}(LSB)${attn} rather than condrestart ${warn}(RH)${norm}"
+ fi
+ $0 status
+ if test $? = 0; then
+ $0 restart
+ else
+ rc_reset # Not running is not a failure.
+ fi
+ rc_status
+ ;;
+
+ restart)
+ $0 stop
+ $0 start
+ rc_status
+ ;;
+
+ force-reload)
+ echo -n "Reload service bbackupd "
+ killproc -HUP $BBACKUPD_BIN
+ rc_status -v
+ ;;
+
+ reload)
+ echo -n "Reload service bbackupd "
+ killproc -HUP $BBACKUPD_BIN
+ rc_status -v
+ ;;
+
+ status)
+ echo -n "Checking for service bbackupd "
+ checkproc $BBACKUPD_BIN
+ rc_status -v
+ ;;
+
+ probe)
+ test /etc/box/bbackupd.conf -nt /var/run/bbackupd.pid && echo reload
+ ;;
+
+ *)
+ echo "Usage: $0 {start|stop|status|try-restart|restart|force-reload|reload|probe}"
+ exit 1
+
+esac
+rc_exit
diff --git a/distribution/boxbackup/contrib/suse/bbstored b/distribution/boxbackup/contrib/suse/bbstored
new file mode 100644
index 00000000..1824dda7
--- /dev/null
+++ b/distribution/boxbackup/contrib/suse/bbstored
@@ -0,0 +1,103 @@
+#!/bin/sh
+#
+# Copyright (c)2004, Nothing But Net Limited
+# <chris.smith@nothingbutnet.co.nz>
+#
+######################################################################
+# RELEASED AND PROVIDED TO YOU UNDER THE SAME LICENCE AS THE BOXBACKUP
+# SUITE OF PROGRAMS. LICENCE MAY BE VIEWED HERE:
+#
+# http://www.fluffy.co.uk/boxbackup/license.html
+######################################################################
+#
+# /etc/init.d/bbackupd
+# and its symbolic link
+# /(usr/)sbin/rcbbackupd
+#
+### BEGIN INIT INFO
+# Provides: bbackupd
+# Required-Start: $named $network $local_fs $syslog
+# X-UnitedLinux-Should-Start: $time ypbind sendmail
+# Required-Stop: $named $network $localfs $syslog
+# X-UnitedLinux-Should-Stop: $time ypbind sendmail
+# Default-Start: 3 5
+# Default-Stop: 0 1 2 6
+# Short-Description: BoxBackup server side daemon
+# Description: Client daemon for the BoxBackup software
+# that allows you to communicate with a bbstored server.
+### END INIT INFO
+#
+
+# Check for missing binaries (stale symlinks should not happen)
+BBACKUPD_BIN=/usr/sbin/bbstored
+if [ ! -x $BBACKUPD_BIN ] ; then
+ echo "$BBACKUPD_BIN not installed"
+ exit 5
+fi
+
+. /etc/rc.status
+
+# Reset status of this service
+rc_reset
+
+case "$1" in
+ start)
+ echo -n "Starting bbstored "
+ startproc $BBACKUPD_BIN
+ rc_status -v
+ ;;
+
+ stop)
+ echo -n "Shutting down bstored "
+ killproc -TERM $BBACKUPD_BIN
+ rc_status -v
+ ;;
+
+ try-restart|condrestart)
+ if test "$1" = "condrestart"; then
+ echo "${attn} Use try-restart ${done}(LSB)${attn} rather than condrestart ${warn}(RH)${norm}"
+ fi
+ $0 status
+ if test $? = 0; then
+ $0 restart
+ else
+ rc_reset # Not running is not a failure.
+ fi
+ rc_status
+ ;;
+
+ restart)
+ $0 stop
+ $0 start
+ rc_status
+ ;;
+
+ force-reload)
+ echo -n "Reload service bbstored "
+ killproc -HUP $BBACKUPD_BIN
+ rc_status -v
+ ;;
+
+ reload)
+ echo -n "Reload service bbstored "
+ killproc -HUP $BBACKUPD_BIN
+ rc_status -v
+ ;;
+
+ status)
+ echo -n "Checking for service bbstored "
+ checkproc $BBACKUPD_BIN
+ rc_status -v
+ ;;
+
+ probe)
+ test /etc/box/bbstored.conf -nt /var/run/bbstored.pid && echo reload
+ ;;
+
+ *)
+ echo "Usage: $0 {start|stop|status|try-restart|restart|force-reload|reload|probe}"
+ exit 1
+ ;;
+
+esac
+rc_exit