[Box Backup-commit] COMMIT r2008 - in box: . james james/FreeBSD james/FreeBSD/files

boxbackup-dev at fluffy.co.uk boxbackup-dev at fluffy.co.uk
Sun Dec 16 12:57:24 GMT 2007


Author: jamesog
Date: 2007-12-16 12:57:21 +0000 (Sun, 16 Dec 2007)
New Revision: 2008

Added:
   box/james/
   box/james/FreeBSD/
   box/james/FreeBSD/Makefile
   box/james/FreeBSD/distinfo
   box/james/FreeBSD/files/
   box/james/FreeBSD/files/bbackupd.sh.in
   box/james/FreeBSD/files/bbstored.sh.in
   box/james/FreeBSD/files/patch-configure.ac
   box/james/FreeBSD/files/patch-lib-common-BoxPortsAndFiles.h
   box/james/FreeBSD/files/pkg-message.client
   box/james/FreeBSD/files/pkg-message.server
   box/james/FreeBSD/pkg-deinstall
   box/james/FreeBSD/pkg-descr
   box/james/FreeBSD/pkg-install
   box/james/FreeBSD/pkg-plist
Log:
- Add a working directory for myself
- Checkin the FreeBSD port skeleton (as of 0.10 release)



Added: box/james/FreeBSD/Makefile
===================================================================
--- box/james/FreeBSD/Makefile	                        (rev 0)
+++ box/james/FreeBSD/Makefile	2007-12-16 12:57:21 UTC (rev 2008)
@@ -0,0 +1,123 @@
+# New ports collection makefile for: boxbackup
+# Date created:		19 December 2004
+# Whom:			James O'Gorman <james at netinertia.co.uk>
+#
+# $FreeBSD: ports/sysutils/boxbackup/Makefile,v 1.10 2007/09/30 04:47:25 linimon Exp $
+#
+
+PORTNAME=	boxbackup
+PORTVERSION=	0.10
+PORTREVISION=	1
+CATEGORIES=	sysutils
+MASTER_SITES=	${MASTER_SITE_SOURCEFORGE}
+MASTER_SITE_SUBDIR=${PORTNAME}
+EXTRACT_SUFX=	.tgz
+
+MAINTAINER=	james at netinertia.co.uk
+COMMENT=	An open source, completely automatic on-line backup system for UNIX
+
+USE_OPENSSL=	yes
+GNU_CONFIGURE=	yes
+USE_PERL5=	yes
+USE_GCC=	3.2+
+USE_AUTOTOOLS=	autoconf:261 aclocal:19 autoheader:261
+ACLOCAL_ARGS+=	-I ${WRKSRC}/infrastructure/m4
+
+PKGMESSAGE=	${WRKDIR}/pkg-message
+
+OPTIONS=	CLIENT "Install the bbackupd client" On \
+		SERVER "Install the bbstored server" On \
+		GNUREADLINE "Enable the use of GNU readline" Off \
+		TESTS  "Allows use of a 'test' target to run tests" Off
+
+.include <bsd.port.pre.mk>
+
+TARGETOS!=	${ECHO_CMD} `${UNAME} -s``${UNAME} -r | ${SED} -e 's/[-(].*//'` | ${TR} A-Z a-z
+
+.if defined(WITH_GNUREADLINE)
+CONFIGURE_ARGS+=--enable-gnu-readline
+.endif
+
+.if defined(WITHOUT_CLIENT) && defined(WITHOUT_SERVER)
+IGNORE=		requires at least CLIENT or SERVER to be defined.\
+		Please 'make config' again
+.endif
+
+.if defined(WITHOUT_CLIENT)
+PLIST_SUB+=	CLIENT="@comment "
+.else
+USE_RC_SUBR+=	bbackupd.sh
+PLIST_SUB+=	CLIENT=""
+ALL_TARGET+=	parcels/${DISTNAME}-backup-client-${TARGETOS}.tgz
+INSTALL_TARGET+=install-backup-client
+.endif
+
+.if defined(WITHOUT_SERVER)
+PLIST_SUB+=	SERVER="@comment "
+.else
+USE_RC_SUBR+=	bbstored.sh
+PLIST_SUB+=	SERVER=""
+ALL_TARGET+=	parcels/${DISTNAME}-backup-server-${TARGETOS}.tgz
+INSTALL_TARGET+=install-backup-server
+.endif
+
+CONFLICTS=	boxbackup-server-[0-9]* boxbackup-client-[0-9]*
+.if defined(WITHOUT_CLIENT)
+CONFLICTS=	boxbackup-client-[0-9]*
+PKGNAMESUFFIX=	-server
+.elif defined(WITHOUT_SERVER)
+CONFLICTS=	boxbackup-server-[0-9]*
+PKGNAMESUFFIX=	-client
+.endif
+
+post-patch:
+# Replace hard-coded /etc/box with $PREFIX/etc/box
+	@${REINPLACE_CMD} -e 's,%%PREFIX%%,${PREFIX},' \
+		${WRKSRC}/lib/common/BoxPortsAndFiles.h
+# Fix path to perl
+	@${FIND} ${WRKSRC} -name "*.pl" -exec \
+		${REINPLACE_CMD} -e 's,/usr/bin/perl,${PERL},g' {} \;
+	@${REINPLACE_CMD} -e 's,/usr/bin/perl,${PERL},g' \
+		${WRKSRC}/bin/bbackupd/bbackupd-config \
+		${WRKSRC}/bin/bbstored/bbstored-certs \
+		${WRKSRC}/bin/bbstored/bbstored-config \
+		${WRKSRC}/lib/raidfile/raidfile-config
+	@${FIND} ${WRKSRC} -name "Makefile.extra" -exec \
+		${REINPLACE_CMD} -e 's,perl,${PERL},g' {} \;
+	@${REINPLACE_CMD} -e 's,perl ,${PERL} ,g' \
+		${WRKSRC}/test/bbackupd/testfiles/bbackupd.conf \
+		${WRKSRC}/infrastructure/makebuildenv.pl
+	@${REINPLACE_CMD} -e 's,"perl ,PERL_EXECUTABLE " ,g' \
+		${WRKSRC}/test/backupstorefix/testbackupstorefix.cpp
+# Fix hard-coded g++
+	@${REINPLACE_CMD} -e 's,g++,${CXX},' \
+		 ${WRKSRC}/infrastructure/makebuildenv.pl
+.if !defined(WITHOUT_CLIENT)
+	@${CAT} ${FILESDIR}/pkg-message.client >> ${PKGMESSAGE}
+.endif
+.if !defined(WITHOUT_SERVER)
+	@${CAT} ${FILESDIR}/pkg-message.server >> ${PKGMESSAGE}
+.endif
+
+.if !defined(WITHOUT_SERVER)
+pre-install:
+	@${SETENV} PKG_PREFIX=${PREFIX} \
+		${SH} ${PKGINSTALL} ${PKGNAME} PRE-INSTALL
+.endif
+
+post-install:
+.if !defined(WITHOUT_CLIENT)
+	@${MKDIR} -m 0700 ${PREFIX}/etc/box/bbackupd
+.endif
+.if !defined(WITHOUT_SERVER)
+	@${MKDIR} -m 0700 ${PREFIX}/etc/box/bbstored
+.endif
+	@${CAT} ${PKGMESSAGE}
+
+.if defined(WITH_TESTS)
+test:
+	 @${ECHO_CMD} "===> Running tests"
+	 @${MAKE} -C ${WRKSRC} test
+.endif
+
+.include <bsd.port.post.mk>

Added: box/james/FreeBSD/distinfo
===================================================================
--- box/james/FreeBSD/distinfo	                        (rev 0)
+++ box/james/FreeBSD/distinfo	2007-12-16 12:57:21 UTC (rev 2008)
@@ -0,0 +1,3 @@
+MD5 (boxbackup-0.10.tgz) = 2dc02d87932fdb222ed019443ddcf444
+SHA256 (boxbackup-0.10.tgz) = 09e88f4ee26b76b3d6e6a0cf3fc374e55d79dd84e9884dfc6a7635593862d361
+SIZE (boxbackup-0.10.tgz) = 842450

Added: box/james/FreeBSD/files/bbackupd.sh.in
===================================================================
--- box/james/FreeBSD/files/bbackupd.sh.in	                        (rev 0)
+++ box/james/FreeBSD/files/bbackupd.sh.in	2007-12-16 12:57:21 UTC (rev 2008)
@@ -0,0 +1,27 @@
+#!/bin/sh
+#
+# $FreeBSD: ports/sysutils/boxbackup/files/bbackupd.sh.in,v 1.2 2006/02/20 20:47:41 dougb Exp $
+#
+# PROVIDE: bbackupd
+# REQUIRE: NETWORKING
+# KEYWORD: shutdown
+
+#
+# Add the following line to /etc/rc.conf to enable bbackupd:
+#
+#bbackupd_enable="YES"
+#
+
+: ${bbackupd_enable:="NO"}
+: ${bbackupd_flags:="%%PREFIX%%/etc/box/bbackupd.conf"}
+: ${bbackupd_pidfile:="/var/run/bbackupd.pid"}
+
+. %%RC_SUBR%%
+
+name="bbackupd"
+rcvar=`set_rcvar`
+command="%%PREFIX%%/bin/bbackupd"
+extra_commands="reload"
+
+load_rc_config $name
+run_rc_command "$1"

Added: box/james/FreeBSD/files/bbstored.sh.in
===================================================================
--- box/james/FreeBSD/files/bbstored.sh.in	                        (rev 0)
+++ box/james/FreeBSD/files/bbstored.sh.in	2007-12-16 12:57:21 UTC (rev 2008)
@@ -0,0 +1,27 @@
+#!/bin/sh
+#
+# $FreeBSD: ports/sysutils/boxbackup/files/bbstored.sh.in,v 1.2 2006/02/20 20:47:41 dougb Exp $
+#
+# PROVIDE: bbstored
+# REQUIRE: NETWORKING
+# KEYWORD: shutdown
+
+#
+# Add the following line to /etc/rc.conf to enable bbstored:
+#
+#bbstored_enable="YES"
+#
+
+: ${bbstored_enable:="NO"}
+: ${bbstored_flags:="%%PREFIX%%/etc/box/bbstored.conf"}
+: ${bbstored_pidfile:="/var/run/bbstored.pid"}
+
+. %%RC_SUBR%%
+
+name="bbstored"
+rcvar=`set_rcvar`
+command="%%PREFIX%%/bin/bbstored"
+extra_commands="reload"
+
+load_rc_config $name
+run_rc_command "$1"

Added: box/james/FreeBSD/files/patch-configure.ac
===================================================================
--- box/james/FreeBSD/files/patch-configure.ac	                        (rev 0)
+++ box/james/FreeBSD/files/patch-configure.ac	2007-12-16 12:57:21 UTC (rev 2008)
@@ -0,0 +1,35 @@
+--- configure.ac.orig	Thu Mar 16 22:26:39 2006
++++ configure.ac	Thu Mar 16 22:28:31 2006
+@@ -2,7 +2,7 @@
+ # Process this file with autoconf to produce a configure script.
+ 
+ AC_PREREQ(2.59)
+-AC_INIT([Box Backup], 0.09, [box at fluffy.co.uk])
++AC_INIT([Box Backup], 0.10, [box at fluffy.co.uk])
+ AC_CONFIG_SRCDIR([lib/common/Box.h])
+ AC_CONFIG_HEADERS([lib/common/BoxConfig.h])
+ 
+@@ -26,6 +26,12 @@
+   # Use -rdynamic if we have gcc. This is needed for backtrace
+   AC_SUBST([LDADD_RDYNAMIC], ['-rdynamic'])
+ fi
++AC_PATH_PROG([PERL], [perl], [no])
++if test "x$PERL" != "xno"; then
++  AC_DEFINE_UNQUOTED([PERL_EXECUTABLE], ["$PERL"], [Location of the perl executable])
++else
++  AC_MSG_ERROR([[perl executable was not found]])
++fi
+ 
+ 
+ ### Checks for libraries.
+@@ -208,8 +214,8 @@
+ 
+ # Configure the Box build system
+ echo
+-perl ./infrastructure/makebuildenv.pl &&
+-  perl ./infrastructure/makeparcels.pl
++$PERL ./infrastructure/makebuildenv.pl &&
++  $PERL ./infrastructure/makeparcels.pl
+ 
+ # Write summary of important info
+ cat <<EOC

Added: box/james/FreeBSD/files/patch-lib-common-BoxPortsAndFiles.h
===================================================================
--- box/james/FreeBSD/files/patch-lib-common-BoxPortsAndFiles.h	                        (rev 0)
+++ box/james/FreeBSD/files/patch-lib-common-BoxPortsAndFiles.h	2007-12-16 12:57:21 UTC (rev 2008)
@@ -0,0 +1,25 @@
+--- lib/common/BoxPortsAndFiles.h.orig	Thu Mar 16 19:28:09 2006
++++ lib/common/BoxPortsAndFiles.h	Thu Mar 16 19:28:38 2006
+@@ -53,7 +53,7 @@
+ 
+ // Backup store daemon
+ #define BOX_PORT_BBSTORED					(BOX_PORT_BASE+1)
+-#define BOX_FILE_BBSTORED_DEFAULT_CONFIG	"/etc/box/bbstored.conf"
++#define BOX_FILE_BBSTORED_DEFAULT_CONFIG	"%%PREFIX%%/etc/box/bbstored.conf"
+ // directory within the RAIDFILE root for the backup store daemon
+ #define BOX_RAIDFILE_ROOT_BBSTORED			"backup"
+ 
+@@ -61,11 +61,11 @@
+ #ifdef WIN32
+ #define BOX_FILE_BBACKUPD_DEFAULT_CONFIG	"C:\\Program Files\\Box Backup\\bbackupd.conf"
+ #else
+-#define BOX_FILE_BBACKUPD_DEFAULT_CONFIG	"/etc/box/bbackupd.conf"
++#define BOX_FILE_BBACKUPD_DEFAULT_CONFIG	"%%PREFIX%%/etc/box/bbackupd.conf"
+ #endif
+ 
+ // RaidFile conf location default
+-#define BOX_FILE_RAIDFILE_DEFAULT_CONFIG	"/etc/box/raidfile.conf"
++#define BOX_FILE_RAIDFILE_DEFAULT_CONFIG	"%%PREFIX%%/etc/box/raidfile.conf"
+ 
+ // Default name of the named pipe
+ #define BOX_NAMED_PIPE_NAME L"\\\\.\\pipe\\boxbackup"

Added: box/james/FreeBSD/files/pkg-message.client
===================================================================
--- box/james/FreeBSD/files/pkg-message.client	                        (rev 0)
+++ box/james/FreeBSD/files/pkg-message.client	2007-12-16 12:57:21 UTC (rev 2008)
@@ -0,0 +1,4 @@
+
+To run bbackupd at startup, add bbackupd_enable="YES" to /etc/rc.conf
+Please see http://www.fluffy.co.uk/boxbackup/client.html for client
+configuration options

Added: box/james/FreeBSD/files/pkg-message.server
===================================================================
--- box/james/FreeBSD/files/pkg-message.server	                        (rev 0)
+++ box/james/FreeBSD/files/pkg-message.server	2007-12-16 12:57:21 UTC (rev 2008)
@@ -0,0 +1,4 @@
+
+To run bbstored at startup, add bbstored_enable="YES" to /etc/rc.conf
+Please see http://www.fluffy.co.uk/boxbackup/server.html for server
+configuration options

Added: box/james/FreeBSD/pkg-deinstall
===================================================================
--- box/james/FreeBSD/pkg-deinstall	                        (rev 0)
+++ box/james/FreeBSD/pkg-deinstall	2007-12-16 12:57:21 UTC (rev 2008)
@@ -0,0 +1,69 @@
+#! /bin/sh
+#
+# ex:ts=4
+
+ask() {
+	local question default answer
+
+	question=$1
+	default=$2
+	if [ -z "${PACKAGE_BUILDING}" -a -z "${BATCH}" ]; then
+		read -p "${question} [${default}]? " answer
+	fi
+	echo ${answer:-${default}}
+}
+
+yesno() {
+	local question default answer
+
+	question=$1
+	default=$2
+	while :; do
+		answer=$(ask "${question}" "${default}")
+		case "${answer}" in
+		[Yy]*)	return 0;;
+		[Nn]*)	return 1;;
+		esac
+		echo "Please answer yes or no."
+	done
+}
+
+delete_account() {
+	local u pw
+
+	u=$1
+	pw=`pw usershow ${u} >/dev/null 2>&1`
+	if [ $? -eq 0 ]; then
+		if yesno "Do you want me to remove user \"${u}\"" n; then
+			pw userdel -n ${u}
+			echo "Done."
+		fi
+	fi
+}
+
+case $2 in
+
+DEINSTALL)
+	if ps -axc | grep -qw bbstored; then
+		if yesno "bbstored is still running. Shall I stop it?" y; then
+			killall bbstored
+			sleep 2
+		else
+			echo "OK ... I hope you know what you are doing."
+		fi
+	fi
+
+	if ps -axc | grep -qw bbackupd; then
+		if yesno "bbackupd is still running. Shall I stop it?" y; then
+			killall bbackupd
+			sleep 2
+		else
+			echo "OK ... I hope you know what you are doing."
+		fi
+	fi
+
+	delete_account _bbstored
+
+	;;
+
+esac

Added: box/james/FreeBSD/pkg-descr
===================================================================
--- box/james/FreeBSD/pkg-descr	                        (rev 0)
+++ box/james/FreeBSD/pkg-descr	2007-12-16 12:57:21 UTC (rev 2008)
@@ -0,0 +1,13 @@
+This is a port of Box Backup, an online backup daemon 
+
+The backup daemon, bbackupd, runs on all machines to be backed up. The
+store server daemon, bbstored runs on a central server. Data is sent
+to the store server, which stores all data on local filesystems, that
+is, only on local hard drives. Tape or other archive media is not
+used.
+
+The system is designed to be easy to set up and run, and cheap to use.
+Once set up, there should be no need for user or administrative
+intervention, apart from usual system maintenance.
+
+WWW: http://www.fluffy.co.uk/boxbackup/

Added: box/james/FreeBSD/pkg-install
===================================================================
--- box/james/FreeBSD/pkg-install	                        (rev 0)
+++ box/james/FreeBSD/pkg-install	2007-12-16 12:57:21 UTC (rev 2008)
@@ -0,0 +1,36 @@
+#!/bin/sh
+
+# $FreeBSD: ports/sysutils/boxbackup/pkg-install,v 1.3 2006/03/24 19:31:14 mnag Exp $
+
+case $2 in
+PRE-INSTALL)
+	USER=_bbstored
+	GROUP=${USER}
+	UID=505
+	GID=${UID}
+
+	if pw group show "${GROUP}" 2>/dev/null; then
+		echo "You already have a group \"${GROUP}\", so I will use it."
+	else
+		if pw groupadd ${GROUP} -g ${GID}; then
+                        echo "Added group \"${GROUP}\"."
+                else
+                        echo "Adding group \"${GROUP}\" failed..."
+                        exit 1
+                fi
+        fi
+
+	if pw user show "${USER}" 2>/dev/null; then
+		echo "You already have a user \"${USER}\", so I will use it."
+	else
+		if pw useradd ${USER} -u ${UID} -g ${GROUP} -h - \
+			-d /nonexistent -c "Box Backup Store Daemon"
+		then
+			echo "Added user \"${USER}\"."
+		else
+			echo "Adding user \"${USER}\" failed..."
+			exit 1
+		fi
+	fi
+	;;
+esac

Added: box/james/FreeBSD/pkg-plist
===================================================================
--- box/james/FreeBSD/pkg-plist	                        (rev 0)
+++ box/james/FreeBSD/pkg-plist	2007-12-16 12:57:21 UTC (rev 2008)
@@ -0,0 +1,14 @@
+%%CLIENT%%bin/bbackupctl
+%%CLIENT%%bin/bbackupd
+%%CLIENT%%bin/bbackupd-config
+%%CLIENT%%bin/bbackupquery
+%%SERVER%%bin/bbstoreaccounts
+%%SERVER%%bin/bbstored
+%%SERVER%%bin/bbstored-certs
+%%SERVER%%bin/bbstored-config
+%%SERVER%%bin/raidfile-config
+%%CLIENT%%@exec mkdir -p -m 0700 %D/etc/box/bbackupd
+%%SERVER%%@exec mkdir -p -m 0700 %D/etc/box/bbstored
+%%CLIENT%%@dirrmtry etc/box/bbackupd
+%%SERVER%%@dirrmtry etc/box/bbstored
+ at dirrmtry etc/box




More information about the Boxbackup-commit mailing list