aboutsummaryrefslogtreecommitdiffstats
path: root/sysutils/boxbackup
diff options
context:
space:
mode:
authorlawrance <lawrance@FreeBSD.org>2005-12-14 21:40:07 +0800
committerlawrance <lawrance@FreeBSD.org>2005-12-14 21:40:07 +0800
commit37a7b04775401b5008741ddf43e7a278ce61b2dd (patch)
tree7f39c8212a21a63f67f7f4fd657249c85372488f /sysutils/boxbackup
parentb14615a4341bd0a7ece2098f5506d8301c7ab550 (diff)
downloadfreebsd-ports-gnome-37a7b04775401b5008741ddf43e7a278ce61b2dd.tar.gz
freebsd-ports-gnome-37a7b04775401b5008741ddf43e7a278ce61b2dd.tar.zst
freebsd-ports-gnome-37a7b04775401b5008741ddf43e7a278ce61b2dd.zip
- Fix USE_RC_SUBR to use bb{ackup,store}d.sh.in
- Rename files/bb{ackup,store}d.sh as above to .sh.in, add appropriate substitutions - Add SHA256 - OPTIONSify - Some general reorganisation and cleanup of whitespace PR: ports/90166 Submitted by: James O'Gorman <james@netinertia.co.uk> (maintainer)
Diffstat (limited to 'sysutils/boxbackup')
-rw-r--r--sysutils/boxbackup/Makefile112
-rw-r--r--sysutils/boxbackup/distinfo1
-rw-r--r--sysutils/boxbackup/files/bbackupd.sh.in (renamed from sysutils/boxbackup/files/bbackupd.sh)11
-rw-r--r--sysutils/boxbackup/files/bbstored.sh.in (renamed from sysutils/boxbackup/files/bbstored.sh)11
-rw-r--r--sysutils/boxbackup/pkg-plist4
5 files changed, 58 insertions, 81 deletions
diff --git a/sysutils/boxbackup/Makefile b/sysutils/boxbackup/Makefile
index 9c1eb6d1a1b8..eaa470a6a7b0 100644
--- a/sysutils/boxbackup/Makefile
+++ b/sysutils/boxbackup/Makefile
@@ -1,120 +1,94 @@
-# vim: ts=4
# New ports collection makefile for: boxbackup
# Date created: 19 December 2004
-# Whom: James O'Gorman <james@netinertia.co.uk>
+# Whom: James O'Gorman <james@netinertia.co.uk>
#
# $FreeBSD$
#
-PORTNAME= boxbackup
+PORTNAME= boxbackup
PORTVERSION= 0.09
-CATEGORIES= sysutils
+CATEGORIES= sysutils
MASTER_SITES= ${MASTER_SITE_SOURCEFORGE}
MASTER_SITE_SUBDIR= ${PORTNAME}
-.if defined(CLIENT_ONLY) && !defined(SERVER_ONLY)
-PKGNAMESUFFIX= -client
-.elif defined(SERVER_ONLY) && !defined(CLIENT_ONLY)
-PKGNAMESUFFIX= -server
-.endif
EXTRACT_SUFX= .tgz
-MAINTAINER= james@netinertia.co.uk
-COMMENT= An open source, completely automatic on-line backup system for UNIX
+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
-USE_RC_SUBR= yes
-USE_PERL5= yes
+USE_PERL5= yes
-PKGMESSAGE= ${WRKDIR}/pkg-message
+PKGMESSAGE= ${WRKDIR}/pkg-message
-.if defined(CLIENT_ONLY) && !defined(SERVER_ONLY)
-CONFLICTS= boxbackup-[0-9]* boxbackup-server-[0-9]*
-PLIST_SUB+= CLIENT=""
-PLIST_SUB+= SERVER="@comment "
-ALL_TARGET= parcels/${DISTNAME}-backup-client-FreeBSD.tgz
-INSTALL_TARGET= install-backup-client
-.elif defined(SERVER_ONLY) && !defined(CLIENT_ONLY)
-CONFLICTS= boxbackup-[0-9]* boxbackup-client-[0-9]*
-PLIST_SUB+= SERVER=""
+OPTIONS= CLIENT "Install the bbackupd client" On \
+ SERVER "Install the bbstored server" On \
+ TESTS "Allows use of a 'check' target to run tests" Off
+
+.include <bsd.port.pre.mk>
+
+.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 "
-ALL_TARGET= parcels/${DISTNAME}-backup-server-FreeBSD.tgz
-INSTALL_TARGET= install-backup-server
.else
+USE_RC_SUBR+= bbackupd.sh
PLIST_SUB+= CLIENT=""
-PLIST_SUB+= SERVER=""
-INSTALL_TARGET= install-backup-server install-backup-client
+ALL_TARGET+= parcels/${DISTNAME}-backup-client-FreeBSD.tgz
+INSTALL_TARGET+=install-backup-client
.endif
-# These will be used at some point in the future when I get around to
-# automating the final configuration.
-#WITH_BACKUPSTORE?= /var/bbstored
-#WITH_WORKINGDIR?= /var/bbackupd
-#WITH_BACKUPMODE?= lazy
-
-.if ${.CURDIR} == ${MASTERDIR}
-pre-everything::
- @${ECHO} "${PORTNAME} has the following options:"
- @${ECHO} ""
-.if !defined(CLIENT_ONLY)
- @${ECHO} " CLIENT_ONLY Only install client suite"
-.endif
-.if !defined(SERVER_ONLY)
- @${ECHO} " SERVER_ONLY Only install server suite"
-.endif
-.if !defined(WITH_TESTS)
- @${ECHO} " WITH_TESTS Allows use of a \"check\" target"
- @${ECHO} " to run tests"
-.endif
- @${ECHO} ""
-.if defined(SERVER_ONLY) && defined(CLIENT_ONLY)
- @${ECHO} "SERVER_ONLY and CLIENT_ONLY are mutually exclusive."
- @${ECHO} "Please choose one or the other."
- @exit 1
+.if defined(WITHOUT_SERVER)
+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
.endif
+
+CONFLICTS= boxbackup-server-[0-9]* boxbackup-client-[0-9]*
+.if defined(WITHOUT_CLIENT)
+CONFLICTS= boxbackup[0-9]*
+PKGNAMESUFFIX= -server
+.elif defined(WITHOUT_SERVER)
+CONFLICTS= boxbackup[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
- @${SED} -e 's,%%PREFIX%%,${PREFIX},g' <${FILESDIR}/bbstored.sh >\
- ${WRKSRC}/bbstored.sh
- @${SED} -e 's,%%PREFIX%%,${PREFIX},g' <${FILESDIR}/bbackupd.sh >\
- ${WRKSRC}/bbackupd.sh
@${FIND} ${WRKSRC} -name "*.pl" -exec \
${REINPLACE_CMD} -e 's,/usr/bin/perl,${PERL},g' {} \;
@${REINPLACE_CMD} -e 's, perl , ${PERL} ,' \
${WRKSRC}/infrastructure/makebuildenv.pl
-.if defined(CLIENT_ONLY) || !defined(SERVER_ONLY)
+.if !defined(WITHOUT_CLIENT)
@${CAT} ${FILESDIR}/pkg-message.client >> ${PKGMESSAGE}
.endif
-.if defined(SERVER_ONLY) || !defined(CLIENT_ONLY)
+.if !defined(WITHOUT_SERVER)
@${CAT} ${FILESDIR}/pkg-message.server >> ${PKGMESSAGE}
.endif
-.if defined(SERVER_ONLY) || !defined(CLIENT_ONLY)
+.if !defined(WITHOUT_SERVER)
pre-install:
@${SETENV} PKG_PREFIX=${PREFIX} \
${SH} ${PKGINSTALL} ${PKGNAME} PRE-INSTALL
.endif
post-install:
- @${ECHO_CMD} "===> Installing startup scripts"
-.if defined(CLIENT_ONLY) || !defined(SERVER_ONLY)
- @${INSTALL_SCRIPT} -m 751 ${WRKSRC}/bbackupd.sh ${PREFIX}/etc/rc.d/bbackupd.sh
+.if !defined(WITHOUT_CLIENT)
@${MKDIR} -m 0700 ${PREFIX}/etc/box/bbackupd
.endif
-.if defined(SERVER_ONLY) || !defined(CLIENT_ONLY)
- @${INSTALL_SCRIPT} -m 751 ${WRKSRC}/bbstored.sh ${PREFIX}/etc/rc.d/bbstored.sh
+.if !defined(WITHOUT_SERVER)
@${MKDIR} -m 0700 ${PREFIX}/etc/box/bbstored
.endif
@${CAT} ${PKGMESSAGE}
-# At some point we might want to automate final configuration...
-#.if !defined(BATCH) && exists(${PREFIX}/bin/bbackupd-config)
-# @${PREFIX}/bin/bbackupd-config ${PREFIX}/etc/box ${WITH_BACKUPMODE} ${ACCOUNT} ${BACKUP_SERVER} ${WITH_WORKDIR} ${BACKUPDIRS}
-#.endif
.if defined(WITH_TESTS)
check:
@@ -122,4 +96,4 @@ check:
@${MAKE} -C ${WRKSRC} test
.endif
-.include <bsd.port.mk>
+.include <bsd.port.post.mk>
diff --git a/sysutils/boxbackup/distinfo b/sysutils/boxbackup/distinfo
index 9722d3f47e82..019196a9741e 100644
--- a/sysutils/boxbackup/distinfo
+++ b/sysutils/boxbackup/distinfo
@@ -1,2 +1,3 @@
MD5 (boxbackup-0.09.tgz) = b4fced539ed72855383f25609de9e6da
+SHA256 (boxbackup-0.09.tgz) = e77ecb2514c976a8e59e7588bb9bf3d09a4d1b612748b1b63ef532f1c43f1e86
SIZE (boxbackup-0.09.tgz) = 505088
diff --git a/sysutils/boxbackup/files/bbackupd.sh b/sysutils/boxbackup/files/bbackupd.sh.in
index 38ad3fdf2127..915903437ac3 100644
--- a/sysutils/boxbackup/files/bbackupd.sh
+++ b/sysutils/boxbackup/files/bbackupd.sh.in
@@ -1,5 +1,6 @@
#!/bin/sh
#
+# $FreeBSD$
#
# PROVIDE: bbackupd
# REQUIRE: NETWORKING
@@ -11,15 +12,15 @@
#bbackupd_enable="YES"
#
-bbackupd_enable=${bbackupd_enable-"NO"}
-bbackupd_flags=${bbackupd_flags-"/usr/local/etc/box/bbackupd.conf"}
-bbackupd_pidfile=${bbackupd_pidfile-"/var/run/bbackupd.pid"}
+: ${bbackupd_enable:="NO"}
+: ${bbackupd_flags:="%%PREFIX%%/etc/box/bbackupd.conf"}
+: ${bbackupd_pidfile:="/var/run/bbackupd.pid"}
-. /etc/rc.subr
+. %%RC_SUBR%%
name="bbackupd"
rcvar=`set_rcvar`
-command="/usr/local/bin/bbackupd"
+command="%%PREFIX%%/bin/bbackupd"
extra_commands="reload"
load_rc_config $name
diff --git a/sysutils/boxbackup/files/bbstored.sh b/sysutils/boxbackup/files/bbstored.sh.in
index 8cd64ffa860a..396344dc7f6e 100644
--- a/sysutils/boxbackup/files/bbstored.sh
+++ b/sysutils/boxbackup/files/bbstored.sh.in
@@ -1,5 +1,6 @@
#!/bin/sh
#
+# $FreeBSD$
#
# PROVIDE: bbstored
# REQUIRE: NETWORKING
@@ -11,15 +12,15 @@
#bbstored_enable="YES"
#
-bbstored_enable=${bbstored_enable-"NO"}
-bbstored_flags=${bbstored_flags-"/usr/local/etc/box/bbstored.conf"}
-bbstored_pidfile=${bbstored_pidfile-"/var/run/bbstored.pid"}
+: ${bbstored_enable:="NO"}
+: ${bbstored_flags:="%%PREFIX%%/etc/box/bbstored.conf"}
+: ${bbstored_pidfile:="/var/run/bbstored.pid"}
-. /etc/rc.subr
+. %%RC_SUBR%%
name="bbstored"
rcvar=`set_rcvar`
-command="/usr/local/bin/bbstored"
+command="%%PREFIX%%/bin/bbstored"
extra_commands="reload"
load_rc_config $name
diff --git a/sysutils/boxbackup/pkg-plist b/sysutils/boxbackup/pkg-plist
index 6f178e2c6653..a2e5a682355f 100644
--- a/sysutils/boxbackup/pkg-plist
+++ b/sysutils/boxbackup/pkg-plist
@@ -7,8 +7,8 @@
%%SERVER%%bin/bbstored-certs
%%SERVER%%bin/bbstored-config
%%SERVER%%bin/raidfile-config
-%%CLIENT%%etc/rc.d/bbackupd.sh
-%%SERVER%%etc/rc.d/bbstored.sh
+%%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