View | Details | Raw Unified | Return to bug 94752
Collapse All | Expand All

(-)boxbackup/Makefile (-13 / +34 lines)
Lines 6-12 Link Here
6
#
6
#
7
7
8
PORTNAME=	boxbackup
8
PORTNAME=	boxbackup
9
PORTVERSION=	0.09
9
PORTVERSION=	0.10
10
CATEGORIES=	sysutils
10
CATEGORIES=	sysutils
11
MASTER_SITES=	${MASTER_SITE_SOURCEFORGE}
11
MASTER_SITES=	${MASTER_SITE_SOURCEFORGE}
12
MASTER_SITE_SUBDIR=	${PORTNAME}
12
MASTER_SITE_SUBDIR=	${PORTNAME}
Lines 16-34 Link Here
16
COMMENT=	An open source, completely automatic on-line backup system for UNIX
16
COMMENT=	An open source, completely automatic on-line backup system for UNIX
17
17
18
USE_OPENSSL=	yes
18
USE_OPENSSL=	yes
19
HAS_CONFIGURE=	yes
19
GNU_CONFIGURE=	yes
20
CONFIGURE_ARGS=	openssl:${OPENSSLBASE}
21
USE_REINPLACE=	yes
20
USE_REINPLACE=	yes
22
USE_PERL5=	yes
21
USE_PERL5=	yes
22
USE_AUTOTOOLS=	autoconf:259 aclocal:19 autoheader:259
23
ACLOCAL_ARGS+=	-I ${WRKSRC}/infrastructure/m4
23
24
24
PKGMESSAGE=	${WRKDIR}/pkg-message
25
PKGMESSAGE=	${WRKDIR}/pkg-message
25
26
26
OPTIONS=	CLIENT "Install the bbackupd client" On \
27
OPTIONS=	CLIENT "Install the bbackupd client" On \
27
		SERVER "Install the bbstored server" On \
28
		SERVER "Install the bbstored server" On \
28
		TESTS  "Allows use of a 'check' target to run tests" Off
29
		GNUREADLINE "Enable the use of GNU readline" Off \
30
		TESTS  "Allows use of a 'test' target to run tests" Off
29
31
30
.include <bsd.port.pre.mk>
32
.include <bsd.port.pre.mk>
31
33
34
TARGETOS!=	${ECHO_CMD} `${UNAME} -s``${UNAME} -r | ${SED} -e 's/[-(].*//'` | ${TR} A-Z a-z
35
36
.if defined(WITH_GNUREADLINE)
37
CONFIGURE_ARGS+=--enable-gnu-readline
38
NO_PACKAGE=	GNU GPL prevents distributing binaries linked against GNU readline
39
.endif
40
32
.if defined(WITHOUT_CLIENT) && defined(WITHOUT_SERVER)
41
.if defined(WITHOUT_CLIENT) && defined(WITHOUT_SERVER)
33
IGNORE=		requires at least CLIENT or SERVER to be defined.\
42
IGNORE=		requires at least CLIENT or SERVER to be defined.\
34
		Please \`make config\` again
43
		Please \`make config\` again
Lines 39-45 Link Here
39
.else
48
.else
40
USE_RC_SUBR+=	bbackupd.sh
49
USE_RC_SUBR+=	bbackupd.sh
41
PLIST_SUB+=	CLIENT=""
50
PLIST_SUB+=	CLIENT=""
42
ALL_TARGET+=	parcels/${DISTNAME}-backup-client-FreeBSD.tgz
51
ALL_TARGET+=	parcels/${DISTNAME}-backup-client-${TARGETOS}.tgz
43
INSTALL_TARGET+=install-backup-client
52
INSTALL_TARGET+=install-backup-client
44
.endif
53
.endif
45
54
Lines 48-73 Link Here
48
.else
57
.else
49
USE_RC_SUBR+=	bbstored.sh
58
USE_RC_SUBR+=	bbstored.sh
50
PLIST_SUB+=	SERVER=""
59
PLIST_SUB+=	SERVER=""
51
ALL_TARGET+=	parcels/${DISTNAME}-backup-server-FreeBSD.tgz
60
ALL_TARGET+=	parcels/${DISTNAME}-backup-server-${TARGETOS}.tgz
52
INSTALL_TARGET+=install-backup-server
61
INSTALL_TARGET+=install-backup-server
53
.endif
62
.endif
54
63
55
CONFLICTS=	boxbackup-server-[0-9]* boxbackup-client-[0-9]*
64
CONFLICTS=	boxbackup-server-[0-9]* boxbackup-client-[0-9]*
56
.if defined(WITHOUT_CLIENT)
65
.if defined(WITHOUT_CLIENT)
57
CONFLICTS=	boxbackup[0-9]*
66
CONFLICTS=	boxbackup-client-[0-9]*
58
PKGNAMESUFFIX=	-server
67
PKGNAMESUFFIX=	-server
59
.elif defined(WITHOUT_SERVER)
68
.elif defined(WITHOUT_SERVER)
60
CONFLICTS=	boxbackup[0-9]*
69
CONFLICTS=	boxbackup-server-[0-9]*
61
PKGNAMESUFFIX=	-client
70
PKGNAMESUFFIX=	-client
62
.endif
71
.endif
63
72
64
post-patch:
73
post-patch:
65
	@${REINPLACE_CMD} -e 's,%%PREFIX%%,${PREFIX},' ${WRKSRC}/infrastructure/BoxPlatform.pm
74
# Replace hard-coded /etc/box with $PREFIX/etc/box
66
	@${REINPLACE_CMD} -e 's,%%PREFIX%%,${PREFIX},' ${WRKSRC}/lib/common/BoxPortsAndFiles.h
75
	@${REINPLACE_CMD} -e 's,%%PREFIX%%,${PREFIX},' \
76
		${WRKSRC}/lib/common/BoxPortsAndFiles.h
77
# Fix path to perl
67
	@${FIND} ${WRKSRC} -name "*.pl" -exec \
78
	@${FIND} ${WRKSRC} -name "*.pl" -exec \
68
		${REINPLACE_CMD} -e 's,/usr/bin/perl,${PERL},g' {} \;
79
		${REINPLACE_CMD} -e 's,/usr/bin/perl,${PERL},g' {} \;
69
	@${REINPLACE_CMD} -e 's, perl , ${PERL} ,' \
80
	@${REINPLACE_CMD} -e 's,/usr/bin/perl,${PERL},g' \
81
		${WRKSRC}/bin/bbackupd/bbackupd-config \
82
		${WRKSRC}/bin/bbstored/bbstored-certs \
83
		${WRKSRC}/bin/bbstored/bbstored-config \
84
		${WRKSRC}/lib/raidfile/raidfile-config
85
	@${FIND} ${WRKSRC} -name "Makefile.extra" -exec \
86
		${REINPLACE_CMD} -e 's,perl,${PERL},g' {} \;
87
	@${REINPLACE_CMD} -e 's,perl ,${PERL} ,g' \
88
		${WRKSRC}/test/bbackupd/testfiles/bbackupd.conf \
70
		${WRKSRC}/infrastructure/makebuildenv.pl
89
		${WRKSRC}/infrastructure/makebuildenv.pl
90
	@${REINPLACE_CMD} -e 's,"perl ,PERL_EXECUTABLE " ,g' \
91
		${WRKSRC}/test/backupstorefix/testbackupstorefix.cpp
71
.if !defined(WITHOUT_CLIENT)
92
.if !defined(WITHOUT_CLIENT)
72
	@${CAT} ${FILESDIR}/pkg-message.client >> ${PKGMESSAGE}
93
	@${CAT} ${FILESDIR}/pkg-message.client >> ${PKGMESSAGE}
73
.endif
94
.endif
Lines 78-84 Link Here
78
.if !defined(WITHOUT_SERVER)
99
.if !defined(WITHOUT_SERVER)
79
pre-install:
100
pre-install:
80
	@${SETENV} PKG_PREFIX=${PREFIX} \
101
	@${SETENV} PKG_PREFIX=${PREFIX} \
81
			${SH} ${PKGINSTALL} ${PKGNAME} PRE-INSTALL
102
		${SH} ${PKGINSTALL} ${PKGNAME} PRE-INSTALL
82
.endif
103
.endif
83
104
84
post-install:
105
post-install:
Lines 91-97 Link Here
91
	@${CAT} ${PKGMESSAGE}
112
	@${CAT} ${PKGMESSAGE}
92
113
93
.if defined(WITH_TESTS)
114
.if defined(WITH_TESTS)
94
check:
115
test:
95
	 @${ECHO_CMD} "===> Running tests"
116
	 @${ECHO_CMD} "===> Running tests"
96
	 @${MAKE} -C ${WRKSRC} test
117
	 @${MAKE} -C ${WRKSRC} test
97
.endif
118
.endif
(-)boxbackup/distinfo (-3 / +3 lines)
Lines 1-3 Link Here
1
MD5 (boxbackup-0.09.tgz) = b4fced539ed72855383f25609de9e6da
1
MD5 (boxbackup-0.10.tgz) = 2dc02d87932fdb222ed019443ddcf444
2
SHA256 (boxbackup-0.09.tgz) = e77ecb2514c976a8e59e7588bb9bf3d09a4d1b612748b1b63ef532f1c43f1e86
2
SHA256 (boxbackup-0.10.tgz) = 09e88f4ee26b76b3d6e6a0cf3fc374e55d79dd84e9884dfc6a7635593862d361
3
SIZE (boxbackup-0.09.tgz) = 505088
3
SIZE (boxbackup-0.10.tgz) = 842450
(-)boxbackup/files/patch-configure.ac (+35 lines)
Line 0 Link Here
1
--- configure.ac.orig	Thu Mar 16 22:26:39 2006
2
+++ configure.ac	Thu Mar 16 22:28:31 2006
3
@@ -2,7 +2,7 @@
4
 # Process this file with autoconf to produce a configure script.
5
 
6
 AC_PREREQ(2.59)
7
-AC_INIT([Box Backup], 0.09, [box@fluffy.co.uk])
8
+AC_INIT([Box Backup], 0.10, [box@fluffy.co.uk])
9
 AC_CONFIG_SRCDIR([lib/common/Box.h])
10
 AC_CONFIG_HEADERS([lib/common/BoxConfig.h])
11
 
12
@@ -26,6 +26,12 @@
13
   # Use -rdynamic if we have gcc. This is needed for backtrace
14
   AC_SUBST([LDADD_RDYNAMIC], ['-rdynamic'])
15
 fi
16
+AC_PATH_PROG([PERL], [perl], [no])
17
+if test "x$PERL" != "xno"; then
18
+  AC_DEFINE_UNQUOTED([PERL_EXECUTABLE], ["$PERL"], [Location of the perl executable])
19
+else
20
+  AC_MSG_ERROR([[perl executable was not found]])
21
+fi
22
 
23
 
24
 ### Checks for libraries.
25
@@ -208,8 +214,8 @@
26
 
27
 # Configure the Box build system
28
 echo
29
-perl ./infrastructure/makebuildenv.pl &&
30
-  perl ./infrastructure/makeparcels.pl
31
+$PERL ./infrastructure/makebuildenv.pl &&
32
+  $PERL ./infrastructure/makeparcels.pl
33
 
34
 # Write summary of important info
35
 cat <<EOC
(-)boxbackup/files/patch-infrastrcture-BoxPlatform.pm (-11 lines)
Lines 1-11 Link Here
1
--- infrastructure/BoxPlatform.pm.orig	Sat Jan  8 13:27:12 2005
2
+++ infrastructure/BoxPlatform.pm	Sat Jan  8 13:27:33 2005
3
@@ -78,7 +78,7 @@
4
 	close VERSION;
5
 	
6
 	# where to put the files
7
-	$install_into_dir = '/usr/local/bin';
8
+	$install_into_dir = '%%PREFIX%%/bin';
9
 	
10
 	# if it's Darwin,
11
 	if($build_os eq 'Darwin')
(-)boxbackup/files/patch-lib-common-BoxPortsAndFiles.h (-8 / +11 lines)
Lines 1-6 Link Here
1
--- lib/common/BoxPortsAndFiles.h.orig	Sat Jan  8 13:30:04 2005
1
--- lib/common/BoxPortsAndFiles.h.orig	Thu Mar 16 19:28:09 2006
2
+++ lib/common/BoxPortsAndFiles.h	Sat Jan  8 13:31:40 2005
2
+++ lib/common/BoxPortsAndFiles.h	Thu Mar 16 19:28:38 2006
3
@@ -54,16 +54,16 @@
3
@@ -53,7 +53,7 @@
4
 
4
 
5
 // Backup store daemon
5
 // Backup store daemon
6
 #define BOX_PORT_BBSTORED					(BOX_PORT_BASE+1)
6
 #define BOX_PORT_BBSTORED					(BOX_PORT_BASE+1)
Lines 9-22 Link Here
9
 // directory within the RAIDFILE root for the backup store daemon
9
 // directory within the RAIDFILE root for the backup store daemon
10
 #define BOX_RAIDFILE_ROOT_BBSTORED			"backup"
10
 #define BOX_RAIDFILE_ROOT_BBSTORED			"backup"
11
 
11
 
12
 // Backup client daemon
12
@@ -61,11 +61,11 @@
13
 #ifdef WIN32
14
 #define BOX_FILE_BBACKUPD_DEFAULT_CONFIG	"C:\\Program Files\\Box Backup\\bbackupd.conf"
15
 #else
13
-#define BOX_FILE_BBACKUPD_DEFAULT_CONFIG	"/etc/box/bbackupd.conf"
16
-#define BOX_FILE_BBACKUPD_DEFAULT_CONFIG	"/etc/box/bbackupd.conf"
14
+#define BOX_FILE_BBACKUPD_DEFAULT_CONFIG	"%%PREFIX%%/etc/box/bbackupd.conf"
17
+#define BOX_FILE_BBACKUPD_DEFAULT_CONFIG	"%%PREFIX%%/etc/box/bbackupd.conf"
18
 #endif
15
 
19
 
16
 
20
 // RaidFile conf location default
17
 // RaidFile conf location efault
18
-#define BOX_FILE_RAIDFILE_DEFAULT_CONFIG	"/etc/box/raidfile.conf"
21
-#define BOX_FILE_RAIDFILE_DEFAULT_CONFIG	"/etc/box/raidfile.conf"
19
+#define BOX_FILE_RAIDFILE_DEFAULT_CONFIG	"%%PREFIX%%/etc/box/raidfile.conf"
22
+#define BOX_FILE_RAIDFILE_DEFAULT_CONFIG	"%%PREFIX%%/etc/box/raidfile.conf"
20
 
23
 
21
 
24
 // Default name of the named pipe
22
 #endif // BOXPORTSANDFILES__H
25
 #define BOX_NAMED_PIPE_NAME L"\\\\.\\pipe\\boxbackup"
(-)boxbackup/pkg-deinstall (+69 lines)
Line 0 Link Here
1
#! /bin/sh
2
#
3
# ex:ts=4
4
5
ask() {
6
	local question default answer
7
8
	question=$1
9
	default=$2
10
	if [ -z "${PACKAGE_BUILDING}" -a -z "${BATCH}" ]; then
11
		read -p "${question} [${default}]? " answer
12
	fi
13
	echo ${answer:-${default}}
14
}
15
16
yesno() {
17
	local question default answer
18
19
	question=$1
20
	default=$2
21
	while :; do
22
		answer=$(ask "${question}" "${default}")
23
		case "${answer}" in
24
		[Yy]*)	return 0;;
25
		[Nn]*)	return 1;;
26
		esac
27
		echo "Please answer yes or no."
28
	done
29
}
30
31
delete_account() {
32
	local u pw
33
34
	u=$1
35
	pw=`pw usershow ${u} >/dev/null 2>&1`
36
	if [ $? -eq 0 ]; then
37
		if yesno "Do you want me to remove user \"${u}\"" n; then
38
			pw userdel -n ${u}
39
			echo "Done."
40
		fi
41
	fi
42
}
43
44
case $2 in
45
46
DEINSTALL)
47
	if ps -axc | grep -qw bbstored; then
48
		if yesno "bbstored is still running. Shall I stop it?" y; then
49
			killall bbstored
50
			sleep 2
51
		else
52
			echo "OK ... I hope you know what you are doing."
53
		fi
54
	fi
55
56
	if ps -axc | grep -qw bbackupd; then
57
		if yesno "bbackupd is still running. Shall I stop it?" y; then
58
			killall bbackupd
59
			sleep 2
60
		else
61
			echo "OK ... I hope you know what you are doing."
62
		fi
63
	fi
64
65
	delete_account _bbstored
66
67
	;;
68
69
esac
(-)boxbackup/pkg-install (-1 / +1 lines)
Lines 24-30 Link Here
24
		echo "You already have a user \"${USER}\", so I will use it."
24
		echo "You already have a user \"${USER}\", so I will use it."
25
	else
25
	else
26
		if pw useradd ${USER} -u ${UID} -g ${GROUP} -h - \
26
		if pw useradd ${USER} -u ${UID} -g ${GROUP} -h - \
27
			-d /nonexistent -c "BoxBackup Store Daemon"
27
			-d /nonexistent -c "Box Backup Store Daemon"
28
		then
28
		then
29
			echo "Added user \"${USER}\"."
29
			echo "Added user \"${USER}\"."
30
		else
30
		else
(-)boxbackup/pkg-plist (-3 / +3 lines)
Lines 9-14 Link Here
9
%%SERVER%%bin/raidfile-config
9
%%SERVER%%bin/raidfile-config
10
%%CLIENT%%@exec mkdir -p -m 0700 %D/etc/box/bbackupd
10
%%CLIENT%%@exec mkdir -p -m 0700 %D/etc/box/bbackupd
11
%%SERVER%%@exec mkdir -p -m 0700 %D/etc/box/bbstored
11
%%SERVER%%@exec mkdir -p -m 0700 %D/etc/box/bbstored
12
%%CLIENT%%@dirrm etc/box/bbackupd
12
%%CLIENT%%@dirrmtry etc/box/bbackupd
13
%%SERVER%%@dirrm etc/box/bbstored
13
%%SERVER%%@dirrmtry etc/box/bbstored
14
@dirrm etc/box
14
@dirrmtry etc/box

Return to bug 94752