summaryrefslogtreecommitdiff
path: root/sysutils/boxbackup
diff options
context:
space:
mode:
authorMarcus Alves Grando <mnag@FreeBSD.org>2006-03-24 19:31:14 +0000
committerMarcus Alves Grando <mnag@FreeBSD.org>2006-03-24 19:31:14 +0000
commita36e51250ba90ba0689249bdd0c21498f51e4c3e (patch)
tree913d36147bbae136eb83d5db453a8a2bfb0b337d /sysutils/boxbackup
parent- Fix rc.d startup script (diff)
- Update to 0.10 [1]
- Fix hard-coded g++ to USE_GCC=3.2+ PR: 94752 [1] Submitted by: maintainer
Notes
Notes: svn path=/head/; revision=158080
Diffstat (limited to 'sysutils/boxbackup')
-rw-r--r--sysutils/boxbackup/Makefile71
-rw-r--r--sysutils/boxbackup/distinfo6
-rw-r--r--sysutils/boxbackup/files/patch-infrastrcture-BoxPlatform.pm11
-rw-r--r--sysutils/boxbackup/files/patch-lib-common-BoxPortsAndFiles.h19
-rw-r--r--sysutils/boxbackup/pkg-deinstall69
-rw-r--r--sysutils/boxbackup/pkg-install2
-rw-r--r--sysutils/boxbackup/pkg-plist6
7 files changed, 133 insertions, 51 deletions
diff --git a/sysutils/boxbackup/Makefile b/sysutils/boxbackup/Makefile
index eaa470a6a7b0..531e3c2770a0 100644
--- a/sysutils/boxbackup/Makefile
+++ b/sysutils/boxbackup/Makefile
@@ -6,7 +6,7 @@
#
PORTNAME= boxbackup
-PORTVERSION= 0.09
+PORTVERSION= 0.10
CATEGORIES= sysutils
MASTER_SITES= ${MASTER_SITE_SOURCEFORGE}
MASTER_SITE_SUBDIR= ${PORTNAME}
@@ -16,58 +16,79 @@ MAINTAINER= james@netinertia.co.uk
COMMENT= An open source, completely automatic on-line backup system for UNIX
USE_OPENSSL= yes
-HAS_CONFIGURE= yes
-CONFIGURE_ARGS= openssl:${OPENSSLBASE}
-USE_REINPLACE= yes
+GNU_CONFIGURE= yes
USE_PERL5= yes
+USE_GCC= 3.2+
PKGMESSAGE= ${WRKDIR}/pkg-message
OPTIONS= CLIENT "Install the bbackupd client" On \
SERVER "Install the bbstored server" On \
- TESTS "Allows use of a 'check' target to run tests" Off
+ 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
+NO_PACKAGE= GNU GPL prevents distributing binaries linked against GNU readline
+.endif
+
.if defined(WITHOUT_CLIENT) && defined(WITHOUT_SERVER)
-IGNORE= requires at least CLIENT or SERVER to be defined.\
- Please \`make config\` again
+IGNORE= requires at least CLIENT or SERVER to be defined. Please run 'make config' again
.endif
.if defined(WITHOUT_CLIENT)
-PLIST_SUB+= CLIENT="@comment "
+PLIST_SUB+= CLIENT="@comment "
.else
-USE_RC_SUBR+= bbackupd.sh
-PLIST_SUB+= CLIENT=""
-ALL_TARGET+= parcels/${DISTNAME}-backup-client-FreeBSD.tgz
-INSTALL_TARGET+=install-backup-client
+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 "
+PLIST_SUB+= SERVER="@comment "
.else
-USE_RC_SUBR+= bbstored.sh
-PLIST_SUB+= SERVER=""
-ALL_TARGET+= parcels/${DISTNAME}-backup-server-FreeBSD.tgz
-INSTALL_TARGET+=install-backup-server
+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[0-9]*
+CONFLICTS= boxbackup-client-[0-9]*
PKGNAMESUFFIX= -server
.elif defined(WITHOUT_SERVER)
-CONFLICTS= boxbackup[0-9]*
+CONFLICTS= boxbackup-server-[0-9]*
PKGNAMESUFFIX= -client
.endif
post-patch:
- @${REINPLACE_CMD} -e 's,%%PREFIX%%,${PREFIX},' ${WRKSRC}/infrastructure/BoxPlatform.pm
- @${REINPLACE_CMD} -e 's,%%PREFIX%%,${PREFIX},' ${WRKSRC}/lib/common/BoxPortsAndFiles.h
+# 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, perl , ${PERL} ,' \
+ @${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
@@ -75,10 +96,10 @@ post-patch:
@${CAT} ${FILESDIR}/pkg-message.server >> ${PKGMESSAGE}
.endif
-.if !defined(WITHOUT_SERVER)
pre-install:
+.if !defined(WITHOUT_SERVER)
@${SETENV} PKG_PREFIX=${PREFIX} \
- ${SH} ${PKGINSTALL} ${PKGNAME} PRE-INSTALL
+ ${SH} ${PKGINSTALL} ${PKGNAME} PRE-INSTALL
.endif
post-install:
@@ -90,8 +111,8 @@ post-install:
.endif
@${CAT} ${PKGMESSAGE}
+test:
.if defined(WITH_TESTS)
-check:
@${ECHO_CMD} "===> Running tests"
@${MAKE} -C ${WRKSRC} test
.endif
diff --git a/sysutils/boxbackup/distinfo b/sysutils/boxbackup/distinfo
index 019196a9741e..60b275b1c9e8 100644
--- a/sysutils/boxbackup/distinfo
+++ b/sysutils/boxbackup/distinfo
@@ -1,3 +1,3 @@
-MD5 (boxbackup-0.09.tgz) = b4fced539ed72855383f25609de9e6da
-SHA256 (boxbackup-0.09.tgz) = e77ecb2514c976a8e59e7588bb9bf3d09a4d1b612748b1b63ef532f1c43f1e86
-SIZE (boxbackup-0.09.tgz) = 505088
+MD5 (boxbackup-0.10.tgz) = 2dc02d87932fdb222ed019443ddcf444
+SHA256 (boxbackup-0.10.tgz) = 09e88f4ee26b76b3d6e6a0cf3fc374e55d79dd84e9884dfc6a7635593862d361
+SIZE (boxbackup-0.10.tgz) = 842450
diff --git a/sysutils/boxbackup/files/patch-infrastrcture-BoxPlatform.pm b/sysutils/boxbackup/files/patch-infrastrcture-BoxPlatform.pm
deleted file mode 100644
index 8feda5a2cf96..000000000000
--- a/sysutils/boxbackup/files/patch-infrastrcture-BoxPlatform.pm
+++ /dev/null
@@ -1,11 +0,0 @@
---- infrastructure/BoxPlatform.pm.orig Sat Jan 8 13:27:12 2005
-+++ infrastructure/BoxPlatform.pm Sat Jan 8 13:27:33 2005
-@@ -78,7 +78,7 @@
- close VERSION;
-
- # where to put the files
-- $install_into_dir = '/usr/local/bin';
-+ $install_into_dir = '%%PREFIX%%/bin';
-
- # if it's Darwin,
- if($build_os eq 'Darwin')
diff --git a/sysutils/boxbackup/files/patch-lib-common-BoxPortsAndFiles.h b/sysutils/boxbackup/files/patch-lib-common-BoxPortsAndFiles.h
index 91820e35a3d1..7dc6c8f43d83 100644
--- a/sysutils/boxbackup/files/patch-lib-common-BoxPortsAndFiles.h
+++ b/sysutils/boxbackup/files/patch-lib-common-BoxPortsAndFiles.h
@@ -1,6 +1,6 @@
---- lib/common/BoxPortsAndFiles.h.orig Sat Jan 8 13:30:04 2005
-+++ lib/common/BoxPortsAndFiles.h Sat Jan 8 13:31:40 2005
-@@ -54,16 +54,16 @@
+--- 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)
@@ -9,14 +9,17 @@
// directory within the RAIDFILE root for the backup store daemon
#define BOX_RAIDFILE_ROOT_BBSTORED "backup"
- // Backup client daemon
+@@ -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 efault
+ // 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"
-
- #endif // BOXPORTSANDFILES__H
+ // Default name of the named pipe
+ #define BOX_NAMED_PIPE_NAME L"\\\\.\\pipe\\boxbackup"
diff --git a/sysutils/boxbackup/pkg-deinstall b/sysutils/boxbackup/pkg-deinstall
new file mode 100644
index 000000000000..be8a67a2dad9
--- /dev/null
+++ b/sysutils/boxbackup/pkg-deinstall
@@ -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
diff --git a/sysutils/boxbackup/pkg-install b/sysutils/boxbackup/pkg-install
index 6b3df4053d82..594c74b8202b 100644
--- a/sysutils/boxbackup/pkg-install
+++ b/sysutils/boxbackup/pkg-install
@@ -24,7 +24,7 @@ PRE-INSTALL)
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 "BoxBackup Store Daemon"
+ -d /nonexistent -c "Box Backup Store Daemon"
then
echo "Added user \"${USER}\"."
else
diff --git a/sysutils/boxbackup/pkg-plist b/sysutils/boxbackup/pkg-plist
index a2e5a682355f..02884ee5eb40 100644
--- a/sysutils/boxbackup/pkg-plist
+++ b/sysutils/boxbackup/pkg-plist
@@ -9,6 +9,6 @@
%%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%%@dirrm etc/box/bbackupd
-%%SERVER%%@dirrm etc/box/bbstored
-@dirrm etc/box
+%%CLIENT%%@dirrmtry etc/box/bbackupd
+%%SERVER%%@dirrmtry etc/box/bbstored
+@dirrmtry etc/box