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

(-)backuppc/Makefile (-25 / +31 lines)
Lines 1-12 Link Here
1
# New ports collection makefile for:	BackupPC
1
# Created by: Alexander Moisseev <moiseev@mezonplus.ru>
2
# Date created:				19 Aug 2010
2
# $FreeBSD$
3
# Whom:					Alexander Moisseev <moiseev@mezonplus.ru>
4
#
5
# $FreeBSD: ports/sysutils/backuppc/Makefile,v 1.9 2012/12/16 06:16:58 svnexp Exp $
6
#
7
3
8
PORTNAME=	backuppc
4
PORTNAME=	backuppc
9
PORTVERSION=	3.2.1
5
PORTVERSION=	3.3.0
10
CATEGORIES=	sysutils
6
CATEGORIES=	sysutils
11
MASTER_SITES=	SF
7
MASTER_SITES=	SF
12
MASTER_SITE_SUBDIR=	${PORTNAME}/${PORTNAME}/${PORTVERSION}
8
MASTER_SITE_SUBDIR=	${PORTNAME}/${PORTNAME}/${PORTVERSION}
Lines 15-21 Link Here
15
MAINTAINER=	moiseev@mezonplus.ru
11
MAINTAINER=	moiseev@mezonplus.ru
16
COMMENT=	System for backing PCs and laptops to a server
12
COMMENT=	System for backing PCs and laptops to a server
17
13
18
RUN_DEPENDS=	p5-libwww>=0:${PORTSDIR}/www/p5-libwww
14
RUN_DEPENDS=	p5-File-Listing>=0:${PORTSDIR}/sysutils/p5-File-Listing
19
15
20
NO_BUILD=	yes
16
NO_BUILD=	yes
21
17
Lines 34-64 Link Here
34
30
35
MAN1=		${PORTNAME}.1
31
MAN1=		${PORTNAME}.1
36
32
37
OPTIONS=	COMPRESS_ZLIB "Perl5 interface to zlib compression library"	on \
33
OPTIONS_DEFINE=		ARCHIVE_ZIP COMPRESS_ZLIB DOCS FILE_RSYNCP NMBLOOKUP \
38
		ARCHIVE_ZIP "Perl module for Zip archive files"			on \
34
			RRDTOOL SMBCLIENT XML_RSS
39
		FILE_RSYNCP "Perl Rsync client"					off \
35
OPTIONS_DEFAULT=	ARCHIVE_ZIP COMPRESS_ZLIB
40
		SMBCLIENT "Samba client"					off \
36
41
		NMBLOOKUP "NetBIOS Name lookup tool"				off \
37
ARCHIVE_ZIP_DESC=	Perl module for Zip archive files
42
		XML_RSS "Perl extension to manage RSS files"			off
38
COMPRESS_ZLIB_DESC=	Perl5 interface to zlib compression library
39
FILE_RSYNCP_DESC=	Perl Rsync client
40
NMBLOOKUP_DESC=		NetBIOS Name lookup tool
41
RRDTOOL_DESC=		Use RRDTool to generate pool statistic graphs
42
SMBCLIENT_DESC=		Samba client
43
XML_RSS_DESC=		Perl extension to manage RSS files
43
44
44
.include <bsd.port.options.mk>
45
.include <bsd.port.options.mk>
45
46
46
.if defined(WITH_COMPRESS_ZLIB)
47
.if ${PORT_OPTIONS:MARCHIVE_ZIP}
47
RUN_DEPENDS+=	p5-IO-Compress>=0:${PORTSDIR}/archivers/p5-IO-Compress
48
.endif
49
.if defined(WITH_ARCHIVE_ZIP)
50
RUN_DEPENDS+=	p5-Archive-Zip>=0:${PORTSDIR}/archivers/p5-Archive-Zip
48
RUN_DEPENDS+=	p5-Archive-Zip>=0:${PORTSDIR}/archivers/p5-Archive-Zip
51
.endif
49
.endif
52
.if defined(WITH_FILE_RSYNCP)
50
.if ${PORT_OPTIONS:MCOMPRESS_ZLIB}
53
RUN_DEPENDS+=	p5-File-RsyncP>=0:${PORTSDIR}/net/p5-File-RsyncP
51
RUN_DEPENDS+=	p5-IO-Compress>=0:${PORTSDIR}/archivers/p5-IO-Compress
54
.endif
52
.endif
55
.if defined(WITH_SMBCLIENT)
53
.if ${PORT_OPTIONS:MFILE_RSYNCP}
56
RUN_DEPENDS+=	smbclient:${PORTSDIR}/net/samba-smbclient
54
RUN_DEPENDS+=	p5-File-RsyncP>=0:${PORTSDIR}/net/p5-File-RsyncP
57
.endif
55
.endif
58
.if defined(WITH_NMBLOOKUP)
56
.if ${PORT_OPTIONS:MNMBLOOKUP}
59
RUN_DEPENDS+=	nmblookup:${PORTSDIR}/net/samba-nmblookup
57
RUN_DEPENDS+=	nmblookup:${PORTSDIR}/net/samba-nmblookup
60
.endif
58
.endif
61
.if defined(WITH_XML_RSS)
59
.if ${PORT_OPTIONS:MRRDTOOL}
60
RUN_DEPENDS+=	rrdtool:${PORTSDIR}/databases/rrdtool
61
EXTRA_PATCHES+=	${FILESDIR}/extra-patch-bin-BackupPC \
62
		${FILESDIR}/extra-patch-lib-BackupPC-CGI-GeneralInfo.pm
63
.endif
64
.if ${PORT_OPTIONS:MSMBCLIENT}
65
RUN_DEPENDS+=	smbclient:${PORTSDIR}/net/samba-smbclient
66
.endif
67
.if ${PORT_OPTIONS:MXML_RSS}
62
RUN_DEPENDS+=	p5-XML-RSS>=0:${PORTSDIR}/textproc/p5-XML-RSS
68
RUN_DEPENDS+=	p5-XML-RSS>=0:${PORTSDIR}/textproc/p5-XML-RSS
63
.endif
69
.endif
64
70
Lines 108-114 Link Here
108
	@${EXEC} pod2man --section=1 --release=${PORTVERSION} --name=BackupPC --center=BackupPC" user guide" ${WRKSRC}/BackupPC.pod ${WRKSRC}/${PORTNAME}.1
114
	@${EXEC} pod2man --section=1 --release=${PORTVERSION} --name=BackupPC --center=BackupPC" user guide" ${WRKSRC}/BackupPC.pod ${WRKSRC}/${PORTNAME}.1
109
	${INSTALL_MAN} ${WRKSRC}/${PORTNAME}.1 ${MANPREFIX}/man/man1
115
	${INSTALL_MAN} ${WRKSRC}/${PORTNAME}.1 ${MANPREFIX}/man/man1
110
116
111
.if !defined(NOPORTDOCS)
117
.if ${PORT_OPTIONS:MDOCS}
112
	${MKDIR} ${DOCSDIR}
118
	${MKDIR} ${DOCSDIR}
113
	@cd ${WRKSRC} && ${INSTALL_MAN} ${PORTDOCS} ${DOCSDIR}
119
	@cd ${WRKSRC} && ${INSTALL_MAN} ${PORTDOCS} ${DOCSDIR}
114
.endif
120
.endif
(-)backuppc/distinfo (-2 / +2 lines)
Lines 1-2 Link Here
1
SHA256 (BackupPC-3.2.1.tar.gz) = 59b09c9ba5236e78cf183153b64ba348820c312275eddcf615d610673b7df054
1
SHA256 (BackupPC-3.3.0.tar.gz) = 8a9c1b6faa4502b4c40617be97e806813815d9e22544854d99983c3da7c1f69b
2
SIZE (BackupPC-3.2.1.tar.gz) = 511896
2
SIZE (BackupPC-3.3.0.tar.gz) = 554155
(-)backuppc/files/extra-patch-bin-BackupPC (+50 lines)
Line 0 Link Here
1
--- bin/BackupPC.orig	2011-04-25 07:31:54.000000000 +0400
2
+++ bin/BackupPC	2013-02-17 16:51:18.000000000 +0400
3
@@ -1198,6 +1198,47 @@
4
 				     $Info{"${p}FileRepMax"},
5
 				     $Info{"${p}FileLinkMax"}, $Info{"${p}DirCnt"});
6
 			}
7
+
8
+			#
9
+			# RRDTool Graphing stuff
10
+			#
11
+			if ( -x "$BinDir/rrdtool" ) {
12
+			    my $date = time() + (24 * 3600);
13
+			    if ( ! -f "$LogDir/pool.rrd" ) {
14
+				system("$BinDir/rrdtool create $LogDir/pool.rrd"
15
+				  . " --step 86400"
16
+				  . " DS:ckb:GAUGE:172800:0:U"
17
+				  . " DS:tps:GAUGE:172800:0:U"
18
+				  . " RRA:AVERAGE:0.5:1:1400"
19
+				);
20
+			    }
21
+
22
+			    #
23
+			    # Generate size totals prior to poolng and compression
24
+			    #
25
+			    my $sizeTot;
26
+			    foreach my $host ( sort(keys(%{$bpc->HostInfoRead()})) ) {
27
+				my @Backups = $bpc->BackupInfoRead($host);
28
+				for ( my $i = 0 ; $i < @Backups ; $i++ ) {
29
+				    $sizeTot += $Backups[$i]{size};
30
+				}
31
+			    }
32
+
33
+			    $sizeTot = $sizeTot / 1024;
34
+
35
+			    system("$BinDir/rrdtool update $LogDir/pool.rrd"
36
+			      . " $date:"
37
+			      . ( $Info{"cpoolKb"} + $Info{"poolKb"} )
38
+			      . ":$sizeTot"
39
+			    );
40
+
41
+			    printf(LOG "%sRRD Data: %s:%f:%f\n",
42
+			      $bpc->timeStamp,
43
+			      $date,
44
+			      $Info{"cpoolKb"} + $Info{"poolKb"},
45
+			      $sizeTot);
46
+			}
47
+
48
                     }
49
                 } else {
50
                     $CmdJob = "";
(-)backuppc/files/extra-patch-lib-BackupPC-CGI-GeneralInfo.pm (+73 lines)
Line 0 Link Here
1
--- lib/BackupPC/CGI/GeneralInfo.pm.orig	2011-04-25 07:31:55.000000000 +0400
2
+++ lib/BackupPC/CGI/GeneralInfo.pm	2013-02-17 16:52:16.000000000 +0400
3
@@ -44,6 +44,47 @@
4
     GetStatusInfo("info jobs hosts queueLen");
5
     my $Privileged = CheckPermission();
6
 
7
+    #
8
+    # Generate pool size RRDtool graph image
9
+    #
10
+    if ( $In{image} ne "" ) {
11
+        $In{image} =~ /([0-9]+)/;
12
+        my $weeks = $1;
13
+        my $real = $<; ### SUID
14
+        $< = $>; ### SUID
15
+
16
+        my $poolSizeGraph = "$BinDir/rrdtool graph -"
17
+          . " --start=end-${weeks}w --end=-300"
18
+          . ' --title="BackupPC Pool Size (' . ${weeks} . ' weeks)"'
19
+          . ' --vertical-label=""'
20
+          . ' --width=600 --height=100 --rigid --alt-autoscale-max'
21
+          . ' --base=1024 --logarithmic --units=si'
22
+          . ' --color BACK#FFFFFF --slope-mode --imgformat=PNG'
23
+          . ' --font TITLE:10: --font AXIS:8: --font LEGEND:8: --font UNIT:8:'
24
+          . ' --font-render-mode mono'
25
+
26
+          . ' DEF:ao="'  . "$LogDir" . '/pool.rrd":ckb:AVERAGE'
27
+          . ' DEF:aob="' . "$LogDir" . '/pool.rrd":tps:AVERAGE'
28
+          . ' CDEF:a=ao,1024,*'
29
+          . ' CDEF:b=aob,1024,*'
30
+
31
+          . ' AREA:a#95B8DB:"CPool in bytes                  "'
32
+          . ' GPRINT:a:LAST:"Current\\:%8.2lf %s"'
33
+          . ' GPRINT:a:AVERAGE:"Average\\:%8.2lf %s"'
34
+          . ' GPRINT:a:MAX:"Maximum\\:%8.2lf %s\n"'
35
+
36
+          . ' LINE1:b#FF0000:"Prior to pooling and compression"'
37
+          . ' GPRINT:b:LAST:"Current\\:%8.2lf %s"'
38
+          . ' GPRINT:b:AVERAGE:"Average\\:%8.2lf %s"'
39
+          . ' GPRINT:b:MAX:"Maximum\\:%8.2lf %s\\n"';
40
+
41
+        print "Content-type: image/png\n\n";
42
+        print `$poolSizeGraph`;
43
+
44
+        $< = $real; ### SUID
45
+        return;
46
+    }
47
+
48
     my($jobStr, $statusStr);
49
     foreach my $host ( sort(keys(%Jobs)) ) {
50
         my $startTime = timeStamp2($Jobs{$host}{startTime});
51
@@ -126,8 +167,20 @@
52
     } elsif ( $Info{cpoolFileCnt} > 0 ) {
53
         $poolInfo = $cpoolInfo;
54
     }
55
-    my $generalInfo = eval("qq{$Lang->{BackupPC_Server_Status_General_Info}}")
56
-                                if ( $Privileged );
57
+
58
+    my $generalInfo = "";
59
+    if ( $Privileged ) {
60
+        $generalInfo  = eval("qq{$Lang->{BackupPC_Server_Status_General_Info}}");
61
+        $generalInfo .= '
62
+<ul>
63
+    <ul>
64
+        <p><img src="' . $MyURL . '?image=4">
65
+        <p><img src="' . $MyURL . '?image=52">
66
+    </ul>
67
+</ul>'
68
+                                if ( -r "$LogDir/pool.rrd" );
69
+    }
70
+
71
     my $content = eval("qq{$Lang->{BackupPC_Server_Status}}");
72
     Header($Lang->{H_BackupPC_Server_Status}, $content);
73
     Trailer();
(-)backuppc/pkg-plist (-7 / +10 lines)
Lines 48-56 Link Here
48
lib/BackupPC/Lang/es.pm
48
lib/BackupPC/Lang/es.pm
49
lib/BackupPC/Lang/fr.pm
49
lib/BackupPC/Lang/fr.pm
50
lib/BackupPC/Lang/it.pm
50
lib/BackupPC/Lang/it.pm
51
lib/BackupPC/Lang/ja.pm
51
lib/BackupPC/Lang/nl.pm
52
lib/BackupPC/Lang/nl.pm
52
lib/BackupPC/Lang/pl.pm
53
lib/BackupPC/Lang/pl.pm
53
lib/BackupPC/Lang/pt_br.pm
54
lib/BackupPC/Lang/pt_br.pm
55
lib/BackupPC/Lang/ru.pm
56
lib/BackupPC/Lang/uk.pm
54
lib/BackupPC/Lang/zh_CN.pm
57
lib/BackupPC/Lang/zh_CN.pm
55
lib/BackupPC/Lib.pm
58
lib/BackupPC/Lib.pm
56
lib/BackupPC/PoolWrite.pm
59
lib/BackupPC/PoolWrite.pm
Lines 133-143 Link Here
133
@unexec echo "If you are permanently removing BackupPC, you should manually delete:"
136
@unexec echo "If you are permanently removing BackupPC, you should manually delete:"
134
@unexec echo
137
@unexec echo
135
@unexec echo "	- the backuppc user/group:	pw userdel backuppc"
138
@unexec echo "	- the backuppc user/group:	pw userdel backuppc"
136
@unexec rmdir %D/%%ETCDIR%% 2>/dev/null || echo "	- BackupPC configuration:	rm -rf %D/%%ETCDIR%%"
139
@unexec rmdir %D/%%ETCDIR%% 2>/dev/null || echo "	- BackupPC configuration:	rm -r %D/%%ETCDIR%%"
137
@unexec rmdir %%BPC_DATADIR%%/cpool 2>/dev/null || true
140
@dirrmtry %%BPC_DATADIR%%/cpool
138
@unexec rmdir %%BPC_DATADIR%%/pc 2>/dev/null || true
141
@dirrmtry %%BPC_DATADIR%%/pc
139
@unexec rmdir %%BPC_DATADIR%%/pool 2>/dev/null || true
142
@dirrmtry %%BPC_DATADIR%%/pool
140
@unexec rmdir %%BPC_DATADIR%%/trash 2>/dev/null || true
143
@dirrmtry %%BPC_DATADIR%%/trash
141
@unexec rmdir %%BPC_DATADIR%% 2>/dev/null || echo "	- BackupPC data directory:	rm -rf %%BPC_DATADIR%%"
144
@unexec rmdir %%BPC_DATADIR%% 2>/dev/null || echo "	- BackupPC data directory:	rm -r %%BPC_DATADIR%%"
142
@unexec rmdir /var/log/BackupPC 2>/dev/null || echo "	- BackupPC logs directory:	rm -rf /var/log/BackupPC"
145
@unexec rmdir /var/log/BackupPC 2>/dev/null || echo "	- BackupPC logs directory:	rm -r /var/log/BackupPC"
143
@unexec echo
146
@unexec echo

Return to bug 178047