Bug 178047 - [maintainer update] sysutils/backuppc: update to 3.3.0
Summary: [maintainer update] sysutils/backuppc: update to 3.3.0
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: Stefan Walter
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-04-22 11:50 UTC by Alexander Moisseev
Modified: 2013-04-28 10:50 UTC (History)
0 users

See Also:


Attachments
file.diff (10.06 KB, patch)
2013-04-22 11:50 UTC, Alexander Moisseev
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Alexander Moisseev 2013-04-22 11:50:00 UTC
- Update to 3.3.0
- Added rrdtool pool statistic graphs option
- Switch to sysutils/p5-File-Listing from www/p5-libwww dependency
- Convert to new options framework
- Trim Makefile header

Fix: Patch attached with submission follows:
Comment 1 Stefan Walter freebsd_committer freebsd_triage 2013-04-28 10:15:16 UTC
Responsible Changed
From-To: freebsd-ports-bugs->stefan

Take.
Comment 2 dfilter service freebsd_committer freebsd_triage 2013-04-28 10:40:41 UTC
Author: stefan
Date: Sun Apr 28 09:40:32 2013
New Revision: 316708
URL: http://svnweb.freebsd.org/changeset/ports/316708

Log:
  - Update to 3.3.0.
  - Added rrdtool pool statistic graphs option.
  - Switch to sysutils/p5-File-Listing from www/p5-libwww dependency.
  - Convert to new options framework.
  - Trim Makefile header.
  
  PR:		178047
  Submitted by:	Alexander Moisseev <moiseev@mezonplus.ru> (maintainer)

Added:
  head/sysutils/backuppc/files/extra-patch-bin-BackupPC   (contents, props changed)
  head/sysutils/backuppc/files/extra-patch-lib-BackupPC-CGI-GeneralInfo.pm   (contents, props changed)
Modified:
  head/sysutils/backuppc/Makefile   (contents, props changed)
  head/sysutils/backuppc/distinfo   (contents, props changed)
  head/sysutils/backuppc/pkg-plist   (contents, props changed)

Modified: head/sysutils/backuppc/Makefile
==============================================================================
--- head/sysutils/backuppc/Makefile	Sun Apr 28 09:25:08 2013	(r316707)
+++ head/sysutils/backuppc/Makefile	Sun Apr 28 09:40:32 2013	(r316708)
@@ -1,12 +1,8 @@
-# New ports collection makefile for:	BackupPC
-# Date created:				19 Aug 2010
-# Whom:					Alexander Moisseev <moiseev@mezonplus.ru>
-#
+# Created by: Alexander Moisseev <moiseev@mezonplus.ru>
 # $FreeBSD$
-#
 
 PORTNAME=	backuppc
-PORTVERSION=	3.2.1
+PORTVERSION=	3.3.0
 CATEGORIES=	sysutils
 MASTER_SITES=	SF
 MASTER_SITE_SUBDIR=	${PORTNAME}/${PORTNAME}/${PORTVERSION}
@@ -15,7 +11,7 @@ DISTNAME=	BackupPC-${PORTVERSION}
 MAINTAINER=	moiseev@mezonplus.ru
 COMMENT=	System for backing PCs and laptops to a server
 
-RUN_DEPENDS=	p5-libwww>=0:${PORTSDIR}/www/p5-libwww
+RUN_DEPENDS=	p5-File-Listing>=0:${PORTSDIR}/sysutils/p5-File-Listing
 
 NO_BUILD=	yes
 
@@ -34,31 +30,41 @@ PORTDOCS=	ChangeLog LICENSE README Backu
 
 MAN1=		${PORTNAME}.1
 
-OPTIONS=	COMPRESS_ZLIB "Perl5 interface to zlib compression library"	on \
-		ARCHIVE_ZIP "Perl module for Zip archive files"			on \
-		FILE_RSYNCP "Perl Rsync client"					off \
-		SMBCLIENT "Samba client"					off \
-		NMBLOOKUP "NetBIOS Name lookup tool"				off \
-		XML_RSS "Perl extension to manage RSS files"			off
+OPTIONS_DEFINE=		ARCHIVE_ZIP COMPRESS_ZLIB DOCS FILE_RSYNCP NMBLOOKUP \
+			RRDTOOL SMBCLIENT XML_RSS
+OPTIONS_DEFAULT=	ARCHIVE_ZIP COMPRESS_ZLIB
+
+ARCHIVE_ZIP_DESC=	Perl module for Zip archive files
+COMPRESS_ZLIB_DESC=	Perl5 interface to zlib compression library
+FILE_RSYNCP_DESC=	Perl Rsync client
+NMBLOOKUP_DESC=		NetBIOS Name lookup tool
+RRDTOOL_DESC=		Use RRDTool to generate pool statistic graphs
+SMBCLIENT_DESC=		Samba client
+XML_RSS_DESC=		Perl extension to manage RSS files
 
 .include <bsd.port.options.mk>
 
-.if defined(WITH_COMPRESS_ZLIB)
-RUN_DEPENDS+=	p5-IO-Compress>=0:${PORTSDIR}/archivers/p5-IO-Compress
-.endif
-.if defined(WITH_ARCHIVE_ZIP)
+.if ${PORT_OPTIONS:MARCHIVE_ZIP}
 RUN_DEPENDS+=	p5-Archive-Zip>=0:${PORTSDIR}/archivers/p5-Archive-Zip
 .endif
-.if defined(WITH_FILE_RSYNCP)
-RUN_DEPENDS+=	p5-File-RsyncP>=0:${PORTSDIR}/net/p5-File-RsyncP
+.if ${PORT_OPTIONS:MCOMPRESS_ZLIB}
+RUN_DEPENDS+=	p5-IO-Compress>=0:${PORTSDIR}/archivers/p5-IO-Compress
 .endif
-.if defined(WITH_SMBCLIENT)
-RUN_DEPENDS+=	smbclient:${PORTSDIR}/net/samba-smbclient
+.if ${PORT_OPTIONS:MFILE_RSYNCP}
+RUN_DEPENDS+=	p5-File-RsyncP>=0:${PORTSDIR}/net/p5-File-RsyncP
 .endif
-.if defined(WITH_NMBLOOKUP)
+.if ${PORT_OPTIONS:MNMBLOOKUP}
 RUN_DEPENDS+=	nmblookup:${PORTSDIR}/net/samba-nmblookup
 .endif
-.if defined(WITH_XML_RSS)
+.if ${PORT_OPTIONS:MRRDTOOL}
+RUN_DEPENDS+=	rrdtool:${PORTSDIR}/databases/rrdtool
+EXTRA_PATCHES+=	${FILESDIR}/extra-patch-bin-BackupPC \
+		${FILESDIR}/extra-patch-lib-BackupPC-CGI-GeneralInfo.pm
+.endif
+.if ${PORT_OPTIONS:MSMBCLIENT}
+RUN_DEPENDS+=	smbclient:${PORTSDIR}/net/samba-smbclient
+.endif
+.if ${PORT_OPTIONS:MXML_RSS}
 RUN_DEPENDS+=	p5-XML-RSS>=0:${PORTSDIR}/textproc/p5-XML-RSS
 .endif
 
@@ -108,7 +114,7 @@ post-install:
 	@${EXEC} pod2man --section=1 --release=${PORTVERSION} --name=BackupPC --center=BackupPC" user guide" ${WRKSRC}/BackupPC.pod ${WRKSRC}/${PORTNAME}.1
 	${INSTALL_MAN} ${WRKSRC}/${PORTNAME}.1 ${MANPREFIX}/man/man1
 
-.if !defined(NOPORTDOCS)
+.if ${PORT_OPTIONS:MDOCS}
 	${MKDIR} ${DOCSDIR}
 	@cd ${WRKSRC} && ${INSTALL_MAN} ${PORTDOCS} ${DOCSDIR}
 .endif

Modified: head/sysutils/backuppc/distinfo
==============================================================================
--- head/sysutils/backuppc/distinfo	Sun Apr 28 09:25:08 2013	(r316707)
+++ head/sysutils/backuppc/distinfo	Sun Apr 28 09:40:32 2013	(r316708)
@@ -1,2 +1,2 @@
-SHA256 (BackupPC-3.2.1.tar.gz) = 59b09c9ba5236e78cf183153b64ba348820c312275eddcf615d610673b7df054
-SIZE (BackupPC-3.2.1.tar.gz) = 511896
+SHA256 (BackupPC-3.3.0.tar.gz) = 8a9c1b6faa4502b4c40617be97e806813815d9e22544854d99983c3da7c1f69b
+SIZE (BackupPC-3.3.0.tar.gz) = 554155

Added: head/sysutils/backuppc/files/extra-patch-bin-BackupPC
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/sysutils/backuppc/files/extra-patch-bin-BackupPC	Sun Apr 28 09:40:32 2013	(r316708)
@@ -0,0 +1,50 @@
+--- bin/BackupPC.orig	2011-04-25 07:31:54.000000000 +0400
++++ bin/BackupPC	2013-02-17 16:51:18.000000000 +0400
+@@ -1198,6 +1198,47 @@
+ 				     $Info{"${p}FileRepMax"},
+ 				     $Info{"${p}FileLinkMax"}, $Info{"${p}DirCnt"});
+ 			}
++
++			#
++			# RRDTool Graphing stuff
++			#
++			if ( -x "$BinDir/rrdtool" ) {
++			    my $date = time() + (24 * 3600);
++			    if ( ! -f "$LogDir/pool.rrd" ) {
++				system("$BinDir/rrdtool create $LogDir/pool.rrd"
++				  . " --step 86400"
++				  . " DS:ckb:GAUGE:172800:0:U"
++				  . " DS:tps:GAUGE:172800:0:U"
++				  . " RRA:AVERAGE:0.5:1:1400"
++				);
++			    }
++
++			    #
++			    # Generate size totals prior to poolng and compression
++			    #
++			    my $sizeTot;
++			    foreach my $host ( sort(keys(%{$bpc->HostInfoRead()})) ) {
++				my @Backups = $bpc->BackupInfoRead($host);
++				for ( my $i = 0 ; $i < @Backups ; $i++ ) {
++				    $sizeTot += $Backups[$i]{size};
++				}
++			    }
++
++			    $sizeTot = $sizeTot / 1024;
++
++			    system("$BinDir/rrdtool update $LogDir/pool.rrd"
++			      . " $date:"
++			      . ( $Info{"cpoolKb"} + $Info{"poolKb"} )
++			      . ":$sizeTot"
++			    );
++
++			    printf(LOG "%sRRD Data: %s:%f:%f\n",
++			      $bpc->timeStamp,
++			      $date,
++			      $Info{"cpoolKb"} + $Info{"poolKb"},
++			      $sizeTot);
++			}
++
+                     }
+                 } else {
+                     $CmdJob = "";

Added: head/sysutils/backuppc/files/extra-patch-lib-BackupPC-CGI-GeneralInfo.pm
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/sysutils/backuppc/files/extra-patch-lib-BackupPC-CGI-GeneralInfo.pm	Sun Apr 28 09:40:32 2013	(r316708)
@@ -0,0 +1,73 @@
+--- lib/BackupPC/CGI/GeneralInfo.pm.orig	2011-04-25 07:31:55.000000000 +0400
++++ lib/BackupPC/CGI/GeneralInfo.pm	2013-02-17 16:52:16.000000000 +0400
+@@ -44,6 +44,47 @@
+     GetStatusInfo("info jobs hosts queueLen");
+     my $Privileged = CheckPermission();
+ 
++    #
++    # Generate pool size RRDtool graph image
++    #
++    if ( $In{image} ne "" ) {
++        $In{image} =~ /([0-9]+)/;
++        my $weeks = $1;
++        my $real = $<; ### SUID
++        $< = $>; ### SUID
++
++        my $poolSizeGraph = "$BinDir/rrdtool graph -"
++          . " --start=end-${weeks}w --end=-300"
++          . ' --title="BackupPC Pool Size (' . ${weeks} . ' weeks)"'
++          . ' --vertical-label=""'
++          . ' --width=600 --height=100 --rigid --alt-autoscale-max'
++          . ' --base=1024 --logarithmic --units=si'
++          . ' --color BACK#FFFFFF --slope-mode --imgformat=PNG'
++          . ' --font TITLE:10: --font AXIS:8: --font LEGEND:8: --font UNIT:8:'
++          . ' --font-render-mode mono'
++
++          . ' DEF:ao="'  . "$LogDir" . '/pool.rrd":ckb:AVERAGE'
++          . ' DEF:aob="' . "$LogDir" . '/pool.rrd":tps:AVERAGE'
++          . ' CDEF:a=ao,1024,*'
++          . ' CDEF:b=aob,1024,*'
++
++          . ' AREA:a#95B8DB:"CPool in bytes                  "'
++          . ' GPRINT:a:LAST:"Current\\:%8.2lf %s"'
++          . ' GPRINT:a:AVERAGE:"Average\\:%8.2lf %s"'
++          . ' GPRINT:a:MAX:"Maximum\\:%8.2lf %s\n"'
++
++          . ' LINE1:b#FF0000:"Prior to pooling and compression"'
++          . ' GPRINT:b:LAST:"Current\\:%8.2lf %s"'
++          . ' GPRINT:b:AVERAGE:"Average\\:%8.2lf %s"'
++          . ' GPRINT:b:MAX:"Maximum\\:%8.2lf %s\\n"';
++
++        print "Content-type: image/png\n\n";
++        print `$poolSizeGraph`;
++
++        $< = $real; ### SUID
++        return;
++    }
++
+     my($jobStr, $statusStr);
+     foreach my $host ( sort(keys(%Jobs)) ) {
+         my $startTime = timeStamp2($Jobs{$host}{startTime});
+@@ -126,8 +167,20 @@
+     } elsif ( $Info{cpoolFileCnt} > 0 ) {
+         $poolInfo = $cpoolInfo;
+     }
+-    my $generalInfo = eval("qq{$Lang->{BackupPC_Server_Status_General_Info}}")
+-                                if ( $Privileged );
++
++    my $generalInfo = "";
++    if ( $Privileged ) {
++        $generalInfo  = eval("qq{$Lang->{BackupPC_Server_Status_General_Info}}");
++        $generalInfo .= '
++<ul>
++    <ul>
++        <p><img src="' . $MyURL . '?image=4">
++        <p><img src="' . $MyURL . '?image=52">
++    </ul>
++</ul>'
++                                if ( -r "$LogDir/pool.rrd" );
++    }
++
+     my $content = eval("qq{$Lang->{BackupPC_Server_Status}}");
+     Header($Lang->{H_BackupPC_Server_Status}, $content);
+     Trailer();

Modified: head/sysutils/backuppc/pkg-plist
==============================================================================
--- head/sysutils/backuppc/pkg-plist	Sun Apr 28 09:25:08 2013	(r316707)
+++ head/sysutils/backuppc/pkg-plist	Sun Apr 28 09:40:32 2013	(r316708)
@@ -48,9 +48,12 @@ lib/BackupPC/Lang/en.pm
 lib/BackupPC/Lang/es.pm
 lib/BackupPC/Lang/fr.pm
 lib/BackupPC/Lang/it.pm
+lib/BackupPC/Lang/ja.pm
 lib/BackupPC/Lang/nl.pm
 lib/BackupPC/Lang/pl.pm
 lib/BackupPC/Lang/pt_br.pm
+lib/BackupPC/Lang/ru.pm
+lib/BackupPC/Lang/uk.pm
 lib/BackupPC/Lang/zh_CN.pm
 lib/BackupPC/Lib.pm
 lib/BackupPC/PoolWrite.pm
@@ -133,11 +136,11 @@ lib/Net/FTP/RetrHandle.pm
 @unexec echo "If you are permanently removing BackupPC, you should manually delete:"
 @unexec echo
 @unexec echo "	- the backuppc user/group:	pw userdel backuppc"
-@unexec rmdir %D/%%ETCDIR%% 2>/dev/null || echo "	- BackupPC configuration:	rm -rf %D/%%ETCDIR%%"
-@unexec rmdir %%BPC_DATADIR%%/cpool 2>/dev/null || true
-@unexec rmdir %%BPC_DATADIR%%/pc 2>/dev/null || true
-@unexec rmdir %%BPC_DATADIR%%/pool 2>/dev/null || true
-@unexec rmdir %%BPC_DATADIR%%/trash 2>/dev/null || true
-@unexec rmdir %%BPC_DATADIR%% 2>/dev/null || echo "	- BackupPC data directory:	rm -rf %%BPC_DATADIR%%"
-@unexec rmdir /var/log/BackupPC 2>/dev/null || echo "	- BackupPC logs directory:	rm -rf /var/log/BackupPC"
+@unexec rmdir %D/%%ETCDIR%% 2>/dev/null || echo "	- BackupPC configuration:	rm -r %D/%%ETCDIR%%"
+@dirrmtry %%BPC_DATADIR%%/cpool
+@dirrmtry %%BPC_DATADIR%%/pc
+@dirrmtry %%BPC_DATADIR%%/pool
+@dirrmtry %%BPC_DATADIR%%/trash
+@unexec rmdir %%BPC_DATADIR%% 2>/dev/null || echo "	- BackupPC data directory:	rm -r %%BPC_DATADIR%%"
+@unexec rmdir /var/log/BackupPC 2>/dev/null || echo "	- BackupPC logs directory:	rm -r /var/log/BackupPC"
 @unexec echo
_______________________________________________
svn-ports-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-ports-all
To unsubscribe, send any mail to "svn-ports-all-unsubscribe@freebsd.org"
Comment 3 Stefan Walter freebsd_committer freebsd_triage 2013-04-28 10:45:17 UTC
State Changed
From-To: open->closed

Committed, thanks!