Date: Sun, 09 Jan 2005 13:05:33 +0000 From: "James O'Gorman" <james@netinertia.co.uk> To: FreeBSD-gnats-submit@FreeBSD.org Subject: ports/75990: New port: sysutils/boxbackup - An automatic on-line backup system for UNIX Message-ID: <E1CnclB-000Je0-Ht@lister.netinertia.co.uk> Resent-Message-ID: <200501091310.j09DAOul092254@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 75990 >Category: ports >Synopsis: New port: sysutils/boxbackup - An automatic on-line backup system for UNIX >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Sun Jan 09 13:10:23 GMT 2005 >Closed-Date: >Last-Modified: >Originator: James O'Gorman >Release: FreeBSD 5.3-RELEASE-p2 i386 >Organization: >Environment: System: FreeBSD lister.netinertia.co.uk 5.3-RELEASE-p2 FreeBSD 5.3-RELEASE-p2 #0: Tue Dec 21 12:19:51 GMT 2004 root@lister.netinertia.co.uk:/usr/obj/usr/src/sys/LISTER i386 >Description: This is a new port for BoxBackup, an on-line backup system. This port has reserved UID/GID 505 >How-To-Repeat: >Fix: # This is a shell archive. Save it in a file, remove anything before # this line, and then unpack it by entering "sh file". Note, it may # create directories; files and directories will be owned by you and # have default permissions. # # This archive contains: # # boxbackup # boxbackup/Makefile # boxbackup/pkg-descr # boxbackup/files # boxbackup/files/bbackupd.sh # boxbackup/files/bbstored.sh # boxbackup/files/pkg-message.server # boxbackup/files/patch-infrastrcture-BoxPlatform.pm # boxbackup/files/patch-lib-common-BoxPortsAndFiles.h # boxbackup/files/pkg-message.client # boxbackup/distinfo # boxbackup/pkg-plist # boxbackup/pkg-install # echo c - boxbackup mkdir -p boxbackup > /dev/null 2>&1 echo x - boxbackup/Makefile sed 's/^X//' >boxbackup/Makefile << 'END-of-boxbackup/Makefile' X# vim: ts=4 X# New ports collection makefile for: boxbackup X# Date created: 19 December 2004 X# Whom: James O'Gorman <james@netinertia.co.uk> X# X# $FreeBSD$ X# X XPORTNAME= boxbackup XPORTVERSION= 0.09 XCATEGORIES= sysutils XMASTER_SITES= ${MASTER_SITE_SOURCEFORGE} XMASTER_SITE_SUBDIR= ${PORTNAME} X.if defined(CLIENT_ONLY) && !defined(SERVER_ONLY) XPKGNAMESUFFIX= -client X.elif defined(SERVER_ONLY) && !defined(CLIENT_ONLY) XPKGNAMESUFFIX= -server X.endif XEXTRACT_SUFX= .tgz X XMAINTAINER= james@netinertia.co.uk XCOMMENT= An open source, completely automatic on-line backup system for UNIX X XRUN_DEPENDS= openssl:${PORTSDIR}/security/openssl X XHAS_CONFIGURE= yes XUSE_REINPLACE= yes XUSE_RC_SUBR= yes X X.if defined(CLIENT_ONLY) && !defined(SERVER_ONLY) XCONFLICTS= boxbackup-[0-9]* boxbackup-server-[0-9]* XPLIST_SUB+= CLIENT="" XPLIST_SUB+= SERVER="@comment " XALL_TARGET= parcels/${DISTNAME}-backup-client-FreeBSD.tgz XINSTALL_TARGET= install-backup-client X.elif defined(SERVER_ONLY) && !defined(CLIENT_ONLY) XCONFLICTS= boxbackup-[0-9]* boxbackup-client-[0-9]* XPLIST_SUB+= SERVER="" XPLIST_SUB+= CLIENT="@comment " XALL_TARGET= parcels/${DISTNAME}-backup-server-FreeBSD.tgz XINSTALL_TARGET= install-backup-server X.else XPLIST_SUB+= CLIENT="" XPLIST_SUB+= SERVER="" XINSTALL_TARGET= install-backup-server install-backup-client X.endif X X# These will be used at some point in the future when I get around to X# automating the final configuration. X#WITH_BACKUPSTORE?= /var/bbstored X#WITH_WORKINGDIR?= /var/bbackupd X#WITH_BACKUPMODE?= lazy X X.if ${.CURDIR} == ${MASTERDIR} Xpre-everything:: X @${ECHO} "${PORTNAME} has the following options:" X @${ECHO} "" X.if !defined(CLIENT_ONLY) X @${ECHO} " CLIENT_ONLY Only install client suite" X.endif X.if !defined(SERVER_ONLY) X @${ECHO} " SERVER_ONLY Only install server suite" X.endif X.if !defined(WITH_TESTS) X @${ECHO} " WITH_TESTS Allows use of a \"check\" target" X @${ECHO} " to run tests" X.endif X @${ECHO} "" X.if defined(SERVER_ONLY) && defined(CLIENT_ONLY) X @${ECHO} "SERVER_ONLY and CLIENT_ONLY are mutually exclusive." X @${ECHO} "Please choose one or the other." X @exit 1 X.endif X.endif X Xpost-patch: X @${REINPLACE_CMD} -e 's,%%PREFIX%%,${PREFIX},' ${WRKSRC}/infrastructure/BoxPlatform.pm X @${REINPLACE_CMD} -e 's,%%PREFIX%%,${PREFIX},' ${WRKSRC}/lib/common/BoxPortsAndFiles.h X @${SED} -e 's,%%PREFIX%%,${PREFIX},g' <${FILESDIR}/bbstored.sh >\ X ${WRKSRC}/bbstored.sh X @${SED} -e 's,%%PREFIX%%,${PREFIX},g' <${FILESDIR}/bbackupd.sh >\ X ${WRKSRC}/bbackupd.sh X @${RM} -f ${PKGDIR}/pkg-message X.if defined(CLIENT_ONLY) || !defined(SERVER_ONLY) X @${CAT} ${FILESDIR}/pkg-message.client >>${PKGDIR}/pkg-message X.endif X.if defined(SERVER_ONLY) || !defined(CLIENT_ONLY) X @${CAT} ${FILESDIR}/pkg-message.server >>${PKGDIR}/pkg-message X.endif X X.if defined(SERVER_ONLY) || !defined(CLIENT_ONLY) Xpre-install: X @${SETENV} PKG_PREFIX=${PREFIX} \ X ${SH} ${PKGINSTALL} ${PKGNAME} PRE-INSTALL X.endif X Xpost-install: X @${ECHO_CMD} "===> Installing startup scripts" X.if defined(CLIENT_ONLY) || !defined(SERVER_ONLY) X @${INSTALL_SCRIPT} -m 751 ${WRKSRC}/bbackupd.sh ${PREFIX}/etc/rc.d/bbackupd.sh X @${MKDIR} -m 0700 ${PREFIX}/etc/box/bbackupd X.endif X.if defined(SERVER_ONLY) || !defined(CLIENT_ONLY) X @${INSTALL_SCRIPT} -m 751 ${WRKSRC}/bbstored.sh ${PREFIX}/etc/rc.d/bbstored.sh X @${MKDIR} -m 0700 ${PREFIX}/etc/box/bbstored X.endif X @${CAT} ${PKGMESSAGE} X# At some point we might want to automate final configuration... X#.if !defined(BATCH) && exists(${PREFIX}/bin/bbackupd-config) X# @${PREFIX}/bin/bbackupd-config ${PREFIX}/etc/box ${WITH_BACKUPMODE} ${ACCOUNT} ${BACKUP_SERVER} ${WITH_WORKDIR} ${BACKUPDIRS} X#.endif X X.if defined(WITH_TESTS) Xcheck: X @${ECHO_CMD} "===> Running tests" X @${MAKE} -C ${WRKSRC} test X.endif X X.include <bsd.port.mk> END-of-boxbackup/Makefile echo x - boxbackup/pkg-descr sed 's/^X//' >boxbackup/pkg-descr << 'END-of-boxbackup/pkg-descr' XThis is a port of Box Backup, an online backup daemon X XThe backup daemon, bbackupd, runs on all machines to be backed up. The Xstore server daemon, bbstored runs on a central server. Data is sent Xto the store server, which stores all data on local filesystems, that Xis, only on local hard drives. Tape or other archive media is not Xused. X XThe system is designed to be easy to set up and run, and cheap to use. XOnce set up, there should be no need for user or administrative Xintervention, apart from usual system maintenance. X XWWW: http://www.fluffy.co.uk/boxbackup/ END-of-boxbackup/pkg-descr echo c - boxbackup/files mkdir -p boxbackup/files > /dev/null 2>&1 echo x - boxbackup/files/bbackupd.sh sed 's/^X//' >boxbackup/files/bbackupd.sh << 'END-of-boxbackup/files/bbackupd.sh' X#!/bin/sh X# X# X# PROVIDE: bbackupd X# REQUIRE: NETWORKING X# KEYWORD: FreeBSD shutdown X X# X# Add the following line to /etc/rc.conf to enable bbackupd: X# X#bbackupd_enable="YES" X# X Xbbackupd_enable=${bbackupd_enable-"NO"} Xbbackupd_flags=${bbackupd_flags-"/usr/local/etc/box/bbackupd.conf"} Xbbackupd_pidfile=${bbackupd_pidfile-"/var/run/bbackupd.pid"} X X. /etc/rc.subr X Xname="bbackupd" Xrcvar=`set_rcvar` Xcommand="/usr/local/bin/bbackupd" Xextra_commands="reload" X Xload_rc_config $name Xrun_rc_command "$1" END-of-boxbackup/files/bbackupd.sh echo x - boxbackup/files/bbstored.sh sed 's/^X//' >boxbackup/files/bbstored.sh << 'END-of-boxbackup/files/bbstored.sh' X#!/bin/sh X# X# X# PROVIDE: bbstored X# REQUIRE: NETWORKING X# KEYWORD: FreeBSD shutdown X X# X# Add the following line to /etc/rc.conf to enable bbstored: X# X#bbstored_enable="YES" X# X Xbbstored_enable=${bbstored_enable-"NO"} Xbbstored_flags=${bbstored_flags-"/usr/local/etc/box/bbstored.conf"} Xbbstored_pidfile=${bbstored_pidfile-"/var/run/bbstored.pid"} X X. /etc/rc.subr X Xname="bbstored" Xrcvar=`set_rcvar` Xcommand="/usr/local/bin/bbstored" Xextra_commands="reload" X Xload_rc_config $name Xrun_rc_command "$1" END-of-boxbackup/files/bbstored.sh echo x - boxbackup/files/pkg-message.server sed 's/^X//' >boxbackup/files/pkg-message.server << 'END-of-boxbackup/files/pkg-message.server' X XTo run bbstored at startup, add bbstored_enable="YES" to /etc/rc.conf XPlease see http://www.fluffy.co.uk/boxbackup/server.html for server Xconfiguration options END-of-boxbackup/files/pkg-message.server echo x - boxbackup/files/patch-infrastrcture-BoxPlatform.pm sed 's/^X//' >boxbackup/files/patch-infrastrcture-BoxPlatform.pm << 'END-of-boxbackup/files/patch-infrastrcture-BoxPlatform.pm' X--- infrastructure/BoxPlatform.pm.orig Sat Jan 8 13:27:12 2005 X+++ infrastructure/BoxPlatform.pm Sat Jan 8 13:27:33 2005 X@@ -78,7 +78,7 @@ X close VERSION; X X # where to put the files X- $install_into_dir = '/usr/local/bin'; X+ $install_into_dir = '%%PREFIX%%/bin'; X X # if it's Darwin, X if($build_os eq 'Darwin') END-of-boxbackup/files/patch-infrastrcture-BoxPlatform.pm echo x - boxbackup/files/patch-lib-common-BoxPortsAndFiles.h sed 's/^X//' >boxbackup/files/patch-lib-common-BoxPortsAndFiles.h << 'END-of-boxbackup/files/patch-lib-common-BoxPortsAndFiles.h' X--- lib/common/BoxPortsAndFiles.h.orig Sat Jan 8 13:30:04 2005 X+++ lib/common/BoxPortsAndFiles.h Sat Jan 8 13:31:40 2005 X@@ -54,16 +54,16 @@ X X // Backup store daemon X #define BOX_PORT_BBSTORED (BOX_PORT_BASE+1) X-#define BOX_FILE_BBSTORED_DEFAULT_CONFIG "/etc/box/bbstored.conf" X+#define BOX_FILE_BBSTORED_DEFAULT_CONFIG "%%PREFIX%%/etc/box/bbstored.conf" X // directory within the RAIDFILE root for the backup store daemon X #define BOX_RAIDFILE_ROOT_BBSTORED "backup" X X // Backup client daemon X-#define BOX_FILE_BBACKUPD_DEFAULT_CONFIG "/etc/box/bbackupd.conf" X+#define BOX_FILE_BBACKUPD_DEFAULT_CONFIG "%%PREFIX%%/etc/box/bbackupd.conf" X X X // RaidFile conf location efault X-#define BOX_FILE_RAIDFILE_DEFAULT_CONFIG "/etc/box/raidfile.conf" X+#define BOX_FILE_RAIDFILE_DEFAULT_CONFIG "%%PREFIX%%/etc/box/raidfile.conf" X X X #endif // BOXPORTSANDFILES__H END-of-boxbackup/files/patch-lib-common-BoxPortsAndFiles.h echo x - boxbackup/files/pkg-message.client sed 's/^X//' >boxbackup/files/pkg-message.client << 'END-of-boxbackup/files/pkg-message.client' X XTo run bbackupd at startup, add bbackupd_enable="YES" to /etc/rc.conf XPlease see http://www.fluffy.co.uk/boxbackup/client.html for client Xconfiguration options END-of-boxbackup/files/pkg-message.client echo x - boxbackup/distinfo sed 's/^X//' >boxbackup/distinfo << 'END-of-boxbackup/distinfo' XMD5 (boxbackup-0.09.tgz) = b4fced539ed72855383f25609de9e6da XSIZE (boxbackup-0.09.tgz) = 505088 END-of-boxbackup/distinfo echo x - boxbackup/pkg-plist sed 's/^X//' >boxbackup/pkg-plist << 'END-of-boxbackup/pkg-plist' X%%CLIENT%%bin/bbackupctl X%%CLIENT%%bin/bbackupd X%%CLIENT%%bin/bbackupd-config X%%CLIENT%%bin/bbackupquery X%%SERVER%%bin/bbstoreaccounts X%%SERVER%%bin/bbstored X%%SERVER%%bin/bbstored-certs X%%SERVER%%bin/bbstored-config X%%SERVER%%bin/raidfile-config X%%CLIENT%%etc/rc.d/bbackupd.sh X%%SERVER%%etc/rc.d/bbstored.sh X%%CLIENT%%@dirrm etc/box/bbackupd X%%SERVER%%@dirrm etc/box/bbstored X@dirrm etc/box END-of-boxbackup/pkg-plist echo x - boxbackup/pkg-install sed 's/^X//' >boxbackup/pkg-install << 'END-of-boxbackup/pkg-install' X#!/bin/sh X X# $FreeBSD$ X Xcase $2 in XPRE-INSTALL) X USER=_bbstored X GROUP=${USER} X UID=505 X GID=${UID} X X if pw group show "${GROUP}" 2>/dev/null; then X echo "You already have a group \"${GROUP}\", so I will use it." X else X if pw groupadd ${GROUP} -g ${GID}; then X echo "Added group \"${GROUP}\"." X else X echo "Adding group \"${GROUP}\" failed..." X exit 1 X fi X fi X X if pw user show "${USER}" 2>/dev/null; then X echo "You already have a user \"${USER}\", so I will use it." X else X if pw useradd ${USER} -u ${UID} -g ${GROUP} -h - \ X -d /nonexistant -c "BoxBackup Store Daemon" X then X echo "Added user \"${USER}\"." X else X echo "Adding user \"${USER}\" failed..." X exit 1 X fi X fi X ;; Xesac END-of-boxbackup/pkg-install exit >Release-Note: >Audit-Trail: >Unformatted:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?E1CnclB-000Je0-Ht>