Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 26 Aug 2014 14:11:31 +0000 (UTC)
From:      William Grzybowski <wg@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r366216 - in head/sysutils/backuppc: . files
Message-ID:  <201408261411.s7QEBVI2013302@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: wg
Date: Tue Aug 26 14:11:30 2014
New Revision: 366216
URL: http://svnweb.freebsd.org/changeset/ports/366216
QAT: https://qat.redports.org/buildarchive/r366216/

Log:
  sysutils/backuppc: do not overwrite config files
  
  PR:		192403
  Submitted by:	maintainer

Deleted:
  head/sysutils/backuppc/files/patch-configure.pl
Modified:
  head/sysutils/backuppc/Makefile
  head/sysutils/backuppc/files/pkg-message.in
  head/sysutils/backuppc/pkg-plist

Modified: head/sysutils/backuppc/Makefile
==============================================================================
--- head/sysutils/backuppc/Makefile	Tue Aug 26 14:06:08 2014	(r366215)
+++ head/sysutils/backuppc/Makefile	Tue Aug 26 14:11:30 2014	(r366216)
@@ -3,7 +3,7 @@
 
 PORTNAME=	backuppc
 PORTVERSION=	3.3.0
-PORTREVISION=	4
+PORTREVISION=	5
 CATEGORIES=	sysutils
 MASTER_SITES=	SF
 MASTER_SITE_SUBDIR=	${PORTNAME}/${PORTNAME}/${PORTVERSION}
@@ -23,15 +23,14 @@ USE_RC_SUBR=	backuppc
 
 USES=		perl5
 NO_BUILD=	yes
-NO_PACKAGE=	Overwrites configuration files; set FORCE_PACKAGE if you want\
-		to build this package
 
 USERS=		backuppc
 GROUPS=		backuppc
 
 CGIDIR?=	${PREFIX}/www/cgi-bin
 
-SUB_FILES=	pkg-deinstall pkg-message
+SUB_FILES=	pkg-deinstall pkg-message update.sh
+SUB_LIST=	CGIDIR=${CGIDIR}
 
 PLIST_SUB+=	CGIDIR=${CGIDIR:S,^${PREFIX}/,,} \
 		DISTVERSION=${DISTVERSION}
@@ -39,13 +38,18 @@ PLIST_SUB+=	CGIDIR=${CGIDIR:S,^${PREFIX}
 PORTDOCS=	ChangeLog LICENSE README
 
 OPTIONS_DEFINE=		ARCHIVE_ZIP COMPRESS_ZLIB DOCS FILE_RSYNCP NMBLOOKUP \
-			RRDTOOL SMBCLIENT XML_RSS
-OPTIONS_DEFAULT=	ARCHIVE_ZIP COMPRESS_ZLIB
+			SMBCLIENT XML_RSS
+
+OPTIONS_RADIO=		GRAPHS
+OPTIONS_RADIO_GRAPHS=	RRD_GRAPHS RRDTOOL
+
+OPTIONS_DEFAULT=	ARCHIVE_ZIP COMPRESS_ZLIB RRD_GRAPHS
 
 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
+RRD_GRAPHS_DESC=	Apply graphs patch (but not install RRDTool)
 RRDTOOL_DESC=		Use RRDTool to generate pool statistic graphs
 SMBCLIENT_DESC=		Samba client
 XML_RSS_DESC=		Perl extension to manage RSS files
@@ -66,6 +70,8 @@ RUN_DEPENDS+=	nmblookup:${PORTSDIR}/net/
 .endif
 .if ${PORT_OPTIONS:MRRDTOOL}
 RUN_DEPENDS+=	rrdtool:${PORTSDIR}/databases/rrdtool
+.endif
+.if ${PORT_OPTIONS:MRRD_GRAPHS} || ${PORT_OPTIONS:MRRDTOOL}
 EXTRA_PATCHES+=	${FILESDIR}/extra-patch-bin-BackupPC \
 		${FILESDIR}/extra-patch-lib-BackupPC-CGI-GeneralInfo.pm
 .endif
@@ -76,12 +82,18 @@ RUN_DEPENDS+=	smbclient:${PORTSDIR}/net/
 RUN_DEPENDS+=	p5-XML-RSS>=0:${PORTSDIR}/textproc/p5-XML-RSS
 .endif
 
+pre-patch:
+	@${CP} ${WRKSRC}/configure.pl ${WRKSRC}/update.pl
+
 post-patch:
 	@${REINPLACE_CMD} \
 		-e 's|/etc/BackupPC\(/config.pl\)|${ETCDIR}\1|' \
 		-e 's|^\(foreach my $$dir ( qw(bin \)doc$$|\1${DOCSDIR_REL}|' \
 		-e 's|\($$DestDir$$Conf{InstallDir}/\)doc|\1${DOCSDIR_REL}|' \
-		${WRKSRC}/configure.pl
+		${WRKSRC}/configure.pl ${WRKSRC}/update.pl
+	@${REINPLACE_CMD} -E \
+		-e 's|^(use lib ")\.(/lib";)$$|\1${PREFIX}\2|' \
+		${WRKSRC}/update.pl
 	@${REINPLACE_CMD} \
 		-e 's,"/doc/BackupPC.html","/${DOCSDIR_REL}/BackupPC.html",' \
 		${WRKSRC}/lib/BackupPC/CGI/View.pm
@@ -95,15 +107,6 @@ post-patch:
 		${WRKSRC}/doc/BackupPC.html ${WRKSRC}/doc/BackupPC.pod
 
 do-install:
-	if [ -f ${ETCDIR}/config.pl ]; then \
-		${MKDIR} ${STAGEDIR}${ETCDIR}; \
-		${CP} -p ${ETCDIR}/config.pl ${STAGEDIR}${ETCDIR}/config.pl; \
-	fi
-	if [ -f ${ETCDIR}/hosts ]; then \
-		${MKDIR} ${STAGEDIR}${ETCDIR}; \
-		${CP} -p ${ETCDIR}/hosts ${STAGEDIR}${ETCDIR}/hosts; \
-	fi
-
 	cd ${WRKSRC} && ${PERL} configure.pl	\
 		--batch				\
 		--backuppc-user ${USERS}	\
@@ -124,14 +127,10 @@ do-install:
 		${WRKSRC}/doc/BackupPC.pod ${WRKSRC}/${PORTNAME}.1
 	${INSTALL_MAN} ${WRKSRC}/${PORTNAME}.1 ${STAGEDIR}${MANPREFIX}/man/man1
 	cd ${WRKSRC} && ${INSTALL_MAN} ${PORTDOCS} ${STAGEDIR}${DOCSDIR}
-
-	if [ ! -f ${STAGEDIR}${ETCDIR}/config.pl.pre-${DISTVERSION} ]; then \
-		> ${STAGEDIR}${ETCDIR}/config.pl.pre-${DISTVERSION}; \
-	fi
-	${INSTALL} -d ${STAGEDIR}${PREFIX}/libexec/${PORTNAME}
-	cd ${STAGEDIR}${ETCDIR} && \
-		${CHGRP} wheel config.pl config.pl.pre-${DISTVERSION} && \
-		${MV} config.pl hosts config.pl.pre-${DISTVERSION} \
-			${STAGEDIR}${PREFIX}/libexec/${PORTNAME}/
+	${CP} ${WRKSRC}/conf/config.pl ${STAGEDIR}${ETCDIR}/config.pl.sample
+	${CP} ${WRKSRC}/conf/hosts ${STAGEDIR}${ETCDIR}/hosts.sample
+	${CP} ${WRKDIR}/update.sh ${STAGEDIR}${ETCDIR}/update.sh
+	${MKDIR} ${STAGEDIR}${PREFIX}/libexec/backuppc
+	${CP} ${WRKSRC}/update.pl ${STAGEDIR}${PREFIX}/libexec/backuppc/update.pl
 
 .include <bsd.port.mk>

Modified: head/sysutils/backuppc/files/pkg-message.in
==============================================================================
--- head/sysutils/backuppc/files/pkg-message.in	Tue Aug 26 14:06:08 2014	(r366215)
+++ head/sysutils/backuppc/files/pkg-message.in	Tue Aug 26 14:11:30 2014	(r366216)
@@ -1,18 +1,16 @@
 ==========================================================================
- - You need to customize %%ETCDIR%%/config.pl .
+ - If this is a new installation or version upgrade,
+    to create/update configuration you should run
 
-     If this is an upgrade, install BackupPC from port (not from package)
-     and make sure the full path of the existing BackupPC
-     configuration directory is %%ETCDIR%% .
-     Otherwise you will need to make changes in config.pl by hand.
+     %%ETCDIR%%/update.sh
 
  - Add the following line to /etc/rc.conf to enable BackupPC:
 
      backuppc_enable="YES"
 
- - Data directory is /var/db/BackupPC .
+ - Data directory is /var/db/BackupPC
 
-     This is where all the PC backup data is stored.
+     This is where all the backup data is stored.
      This file system needs to be big enough
      to accommodate all the PCs you expect to backup.
 ==========================================================================

Modified: head/sysutils/backuppc/pkg-plist
==============================================================================
--- head/sysutils/backuppc/pkg-plist	Tue Aug 26 14:06:08 2014	(r366215)
+++ head/sysutils/backuppc/pkg-plist	Tue Aug 26 14:11:30 2014	(r366216)
@@ -1,8 +1,4 @@
 @stopdaemon backuppc
-@unexec if cmp -s %D/%%ETCDIR%%/config.pl %D/%%ETCDIR%%/config.pl.sample; then rm -f %D/%%ETCDIR%%/config.pl; fi
-@unexec if cmp -s %D/%%ETCDIR%%/hosts %D/%%ETCDIR%%/hosts.sample; then rm -f %D/%%ETCDIR%%/hosts; fi
-@rmtry %%ETCDIR%%/config.pl.sample
-@rmtry %%ETCDIR%%/hosts.sample
 @mode 0555
 bin/BackupPC
 bin/BackupPC_archive
@@ -80,7 +76,7 @@ lib/BackupPC/Zip/FileMember.pm
 lib/Net/FTP/AutoReconnect.pm
 lib/Net/FTP/RetrHandle.pm
 man/man1/backuppc.1.gz
-%%DOCSDIR%%/BackupPC.html
+%%PORTDOCS%%%%DOCSDIR%%/BackupPC.html
 %%PORTDOCS%%%%DOCSDIR%%/BackupPC.pod
 %%WWWDIR%%/0000000.gif
 %%WWWDIR%%/0000011.gif
@@ -143,7 +139,6 @@ man/man1/backuppc.1.gz
 @dirrm lib/BackupPC
 @dirrm lib/Net/FTP
 @dirrm lib/Net
-@dirrm %%DOCSDIR%%
 @dirrmtry %%WWWDIR%%
 @dirrmtry %%CGIDIR%%
 @exec install -d -o backuppc -g backuppc -m 0750 /var/log/BackupPC
@@ -162,16 +157,13 @@ man/man1/backuppc.1.gz
 @group backuppc
 @dirrmtry %%ETCDIR%%
 @mode 0640
-libexec/backuppc/config.pl.pre-%%DISTVERSION%%
-@exec if [ -s %D/%F -a ! -f %D/%%ETCDIR%%/%f ]; then cp -p %D/%F %D/%%ETCDIR%%/; fi
-libexec/backuppc/config.pl
-@exec if [ ! -f %D/%%ETCDIR%%/%f ]; then cp -p %D/%F %D/%%ETCDIR%%/config.pl.sample; fi
-@exec cp -p %D/%F %D/%%ETCDIR%%/
+@sample %%ETCDIR%%/config.pl.sample
 @mode 0644
-libexec/backuppc/hosts
-@exec if [ ! -f %D/%%ETCDIR%%/%f ]; then cp -p %D/%F %D/%%ETCDIR%%/hosts.sample; fi
-@exec cp -p %D/%F %D/%%ETCDIR%%/
+@sample %%ETCDIR%%/hosts.sample
 @owner
 @group
+@mode 0544
+%%ETCDIR%%/update.sh
+libexec/backuppc/update.pl
 @mode
 @dirrm libexec/backuppc



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201408261411.s7QEBVI2013302>