Changeset View
Standalone View
sysutils/backuppc/Makefile
# Created by: Alexander Moisseev <moiseev@mezonplus.ru> | # Created by: Alexander Moisseev <moiseev@mezonplus.ru> | ||||
# $FreeBSD$ | # $FreeBSD$ | ||||
PORTNAME= backuppc | PORTNAME= backuppc | ||||
PORTVERSION= 3.3.0 | PORTVERSION= 3.3.0 | ||||
PORTREVISION= 1 | |||||
CATEGORIES= sysutils | CATEGORIES= sysutils | ||||
MASTER_SITES= SF | MASTER_SITES= SF | ||||
MASTER_SITE_SUBDIR= ${PORTNAME}/${PORTNAME}/${PORTVERSION} | MASTER_SITE_SUBDIR= ${PORTNAME}/${PORTNAME}/${PORTVERSION} | ||||
DISTNAME= BackupPC-${PORTVERSION} | DISTNAME= BackupPC-${PORTVERSION} | ||||
MAINTAINER= moiseev@mezonplus.ru | MAINTAINER= moiseev@mezonplus.ru | ||||
COMMENT= System for backing PCs and laptops to a server | COMMENT= System for backing PCs and laptops to a server | ||||
LICENSE= GPLv2 | |||||
LICENSE_FILE= ${WRKSRC}/LICENSE | |||||
RUN_DEPENDS= p5-File-Listing>=0:${PORTSDIR}/sysutils/p5-File-Listing | RUN_DEPENDS= p5-File-Listing>=0:${PORTSDIR}/sysutils/p5-File-Listing | ||||
CONFLICTS= backuppc-devel-[0-9]* | |||||
USE_RC_SUBR= backuppc | USE_RC_SUBR= backuppc | ||||
USES= perl5 | USES= perl5 | ||||
NO_BUILD= yes | NO_BUILD= yes | ||||
USERS= backuppc | USERS= backuppc | ||||
GROUPS= backuppc | GROUPS= backuppc | ||||
BPC_CGIDIR?= ${PREFIX}/www/cgi-bin | CGIDIR?= ${PREFIX}/www/cgi-bin | ||||
BPC_DATADIR?= /var/db/BackupPC | |||||
PLIST_SUB= BPC_CGIDIR=${BPC_CGIDIR:S,^${PREFIX}/,,} BPC_DATADIR=${BPC_DATADIR} | SUB_FILES= pkg-deinstall pkg-message | ||||
PORTDOCS= ChangeLog LICENSE README BackupPC.html BackupPC.pod | PLIST_SUB+= CGIDIR=${CGIDIR:S,^${PREFIX}/,,} \ | ||||
DISTVERSION=${DISTVERSION} | |||||
MAN1= ${PORTNAME}.1 | PORTDOCS= ChangeLog LICENSE README | ||||
OPTIONS_DEFINE= ARCHIVE_ZIP COMPRESS_ZLIB DOCS FILE_RSYNCP NMBLOOKUP \ | OPTIONS_DEFINE= ARCHIVE_ZIP COMPRESS_ZLIB DOCS FILE_RSYNCP NMBLOOKUP \ | ||||
RRDTOOL SMBCLIENT XML_RSS | RRDTOOL SMBCLIENT XML_RSS DOCS | ||||
OPTIONS_DEFAULT= ARCHIVE_ZIP COMPRESS_ZLIB | OPTIONS_DEFAULT= ARCHIVE_ZIP COMPRESS_ZLIB | ||||
ARCHIVE_ZIP_DESC= Perl module for Zip archive files | ARCHIVE_ZIP_DESC= Perl module for Zip archive files | ||||
COMPRESS_ZLIB_DESC= Perl5 interface to zlib compression library | COMPRESS_ZLIB_DESC= Perl5 interface to zlib compression library | ||||
FILE_RSYNCP_DESC= Perl Rsync client | FILE_RSYNCP_DESC= Perl Rsync client | ||||
NMBLOOKUP_DESC= NetBIOS Name lookup tool | NMBLOOKUP_DESC= NetBIOS Name lookup tool | ||||
RRDTOOL_DESC= Use RRDTool to generate pool statistic graphs | RRDTOOL_DESC= Use RRDTool to generate pool statistic graphs | ||||
SMBCLIENT_DESC= Samba client | SMBCLIENT_DESC= Samba client | ||||
XML_RSS_DESC= Perl extension to manage RSS files | XML_RSS_DESC= Perl extension to manage RSS files | ||||
NO_STAGE= yes | |||||
.include <bsd.port.options.mk> | .include <bsd.port.options.mk> | ||||
.if ${PORT_OPTIONS:MARCHIVE_ZIP} | .if ${PORT_OPTIONS:MARCHIVE_ZIP} | ||||
RUN_DEPENDS+= p5-Archive-Zip>=0:${PORTSDIR}/archivers/p5-Archive-Zip | RUN_DEPENDS+= p5-Archive-Zip>=0:${PORTSDIR}/archivers/p5-Archive-Zip | ||||
.endif | .endif | ||||
.if ${PORT_OPTIONS:MCOMPRESS_ZLIB} | .if ${PORT_OPTIONS:MCOMPRESS_ZLIB} | ||||
RUN_DEPENDS+= p5-IO-Compress>=0:${PORTSDIR}/archivers/p5-IO-Compress | RUN_DEPENDS+= p5-IO-Compress>=0:${PORTSDIR}/archivers/p5-IO-Compress | ||||
.endif | .endif | ||||
Show All 12 Lines | |||||
RUN_DEPENDS+= smbclient:${PORTSDIR}/net/samba-smbclient | RUN_DEPENDS+= smbclient:${PORTSDIR}/net/samba-smbclient | ||||
.endif | .endif | ||||
.if ${PORT_OPTIONS:MXML_RSS} | .if ${PORT_OPTIONS:MXML_RSS} | ||||
RUN_DEPENDS+= p5-XML-RSS>=0:${PORTSDIR}/textproc/p5-XML-RSS | RUN_DEPENDS+= p5-XML-RSS>=0:${PORTSDIR}/textproc/p5-XML-RSS | ||||
.endif | .endif | ||||
post-patch: | post-patch: | ||||
@${REINPLACE_CMD} \ | @${REINPLACE_CMD} \ | ||||
-e 's,/etc/BackupPC/config.pl,${ETCDIR}/config.pl,' \ | -e 's|/etc/BackupPC\(/config.pl\)|${ETCDIR}\1|' \ | ||||
-e 's|Conf{ConfDir}/hosts", 0644)|Conf{ConfDir}/hosts.sample", 0644)|' \ | -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 | ||||
@${REINPLACE_CMD} \ | @${REINPLACE_CMD} \ | ||||
-e 's,"/doc/BackupPC.html","/${DOCSDIR_REL}/BackupPC.html",' \ | -e 's,"/doc/BackupPC.html","/${DOCSDIR_REL}/BackupPC.html",' \ | ||||
${WRKSRC}/lib/BackupPC/CGI/View.pm | ${WRKSRC}/lib/BackupPC/CGI/View.pm | ||||
@${REINPLACE_CMD} \ | @${REINPLACE_CMD} \ | ||||
-e 's,STDERR "Please su ,STDERR "Please su [-m] ,' \ | -e 's|STDERR "Please su |STDERR "Please su [-m] |' \ | ||||
${WRKSRC}/lib/BackupPC/Lib.pm | ${WRKSRC}/lib/BackupPC/Lib.pm | ||||
@${REINPLACE_CMD} \ | @${REINPLACE_CMD} \ | ||||
-e 's, you can use the -s, you can use the -m,' \ | -e 's| you can use the -s| you can use the -m|' \ | ||||
-e 's,option to su to explicitly run,option to su to run,' \ | -e 's|option to su to explicitly run|option to su to run|' \ | ||||
-e 's,su -s /bin/bash __BACKUPPCUSER__,su -m __BACKUPPCUSER__,' \ | -e 's|su -s /bin/bash __BACKUPPCUSER__|su -m __BACKUPPCUSER__|' \ | ||||
eadler: I'd prefer a patch rather than sed here, but up to you. | |||||
${WRKSRC}/doc/BackupPC.html ${WRKSRC}/doc/BackupPC.pod | ${WRKSRC}/doc/BackupPC.html ${WRKSRC}/doc/BackupPC.pod | ||||
pre-install: | |||||
@${ECHO_MSG} | |||||
@${ECHO_MSG} ">>> -----------------------------------------------------------------------" | |||||
@${ECHO_MSG} ">>> You can use the following variables to tweak installation-time options:" | |||||
@${ECHO_MSG} ">>> BPC_CGIDIR" | |||||
@${ECHO_MSG} ">>> BPC_DATADIR" | |||||
@${ECHO_MSG} ">>> -----------------------------------------------------------------------" | |||||
@${ECHO_MSG} ">>> If this is an upgrade make sure the full path of the existing BackupPC" | |||||
@${ECHO_MSG} ">>> configuration directory is ${ETCDIR}" | |||||
@${ECHO_MSG} ">>> -----------------------------------------------------------------------" | |||||
@${ECHO_MSG} | |||||
do-install: | do-install: | ||||
@cd ${WRKSRC} && ${PERL} configure.pl \ | if [ -f ${ETCDIR}/config.pl ]; then \ | ||||
Not Done Inline Actionsis this for WWW files? Does %%WWWDIR%% not work? eadler: is this for WWW files? Does %%WWWDIR%% not work? | |||||
Not Done Inline ActionsThe currently defined CGIDIR is in ${PREFIX}/www/cgi-bin. ${WWWDIR} would be in ${PREFIX}/www/${PORTNAME}, The location would change. These ports define a similar CGIDIR: http://svnweb.freebsd.org/ports/head/mail/mailgraph/Makefile?revision=356948&view=markup#l21 The backuppc wiki seems to suggest using ${WWWDIR} though. So if the maintainer wants it in www/cgi-bin instead of www/backuppc/cgi-bin, it seems like defining CGIDIR like this seems to be appropriate. milki: The currently defined CGIDIR is in ${PREFIX}/www/cgi-bin. ${WWWDIR} would be in… | |||||
${MKDIR} ${STAGEDIR}${ETCDIR}; \ | |||||
Not Done Inline ActionsWhy is this not %%DATADIR%%? Do users often want to tweak it? d eadler: Why is this not %%DATADIR%%? Do users often want to tweak it? d | |||||
${CP} -p ${ETCDIR}/config.pl ${STAGEDIR}${ETCDIR}/config.pl; \ | |||||
Not Done Inline ActionsDoesn't this overwrite a users config file? swills: Doesn't this overwrite a users config file? | |||||
fi | |||||
if [ -f ${ETCDIR}/hosts ]; then \ | |||||
${MKDIR} ${STAGEDIR}${ETCDIR}; \ | |||||
${CP} -p ${ETCDIR}/hosts ${STAGEDIR}${ETCDIR}/hosts; \ | |||||
fi | |||||
cd ${WRKSRC} && ${PERL} configure.pl \ | |||||
--batch \ | --batch \ | ||||
--backuppc-user ${USERS} \ | --backuppc-user ${USERS} \ | ||||
--config-dir ${ETCDIR} \ | --config-dir ${ETCDIR} \ | ||||
--cgi-dir ${BPC_CGIDIR} \ | --cgi-dir ${CGIDIR} \ | ||||
--data-dir ${BPC_DATADIR} \ | --data-dir /var/db/BackupPC \ | ||||
--dest-dir ${STAGEDIR} \ | |||||
--fhs \ | --fhs \ | ||||
--html-dir ${WWWDIR} \ | --html-dir ${WWWDIR} \ | ||||
--html-dir-url /${PORTNAME} \ | --html-dir-url /${PORTNAME} \ | ||||
--install-dir ${PREFIX} \ | --install-dir ${PREFIX} \ | ||||
--log-dir /var/log/BackupPC | --log-dir /var/log/BackupPC \ | ||||
--no-set-perms \ | |||||
--uid-ignore | |||||
post-install: | pod2man --section=1 --release=${PORTVERSION} \ | ||||
@${EXEC} pod2man --section=1 --release=${PORTVERSION} --name=BackupPC --center=BackupPC" user guide" ${WRKSRC}/BackupPC.pod ${WRKSRC}/${PORTNAME}.1 | --name=BackupPC --center="BackupPC user guide" \ | ||||
${INSTALL_MAN} ${WRKSRC}/${PORTNAME}.1 ${MANPREFIX}/man/man1 | ${WRKSRC}/doc/BackupPC.pod ${WRKSRC}/${PORTNAME}.1 | ||||
${INSTALL_MAN} ${WRKSRC}/${PORTNAME}.1 ${STAGEDIR}${MANPREFIX}/man/man1 | |||||
cd ${WRKSRC} && ${INSTALL_MAN} ${PORTDOCS} ${STAGEDIR}${DOCSDIR} | |||||
.if ${PORT_OPTIONS:MDOCS} | if [ ! -f ${STAGEDIR}${ETCDIR}/config.pl.pre-${DISTVERSION} ]; then \ | ||||
${MKDIR} ${DOCSDIR} | > ${STAGEDIR}${ETCDIR}/config.pl.pre-${DISTVERSION}; \ | ||||
@cd ${WRKSRC} && ${INSTALL_MAN} ${PORTDOCS} ${DOCSDIR} | |||||
.endif | |||||
@${MV} ${ETCDIR}/config.pl ${ETCDIR}/config.pl.sample | |||||
@${ECHO_MSG} | |||||
@${ECHO_MSG} ">>> ----------------------------------------------------------" | |||||
@${ECHO_MSG} ">>> You need to copy and customize" | |||||
@${ECHO_MSG} ">>> # cp -p ${ETCDIR}/config.pl.sample ${ETCDIR}/config.pl" | |||||
@if [ ! -f ${ETCDIR}/hosts ]; then \ | |||||
${ECHO_MSG} ">>> # cp -p ${ETCDIR}/hosts.sample ${ETCDIR}/hosts"; \ | |||||
fi | fi | ||||
${INSTALL} -d ${STAGEDIR}${PREFIX}/libexec/${PORTNAME} | |||||
@${ECHO_MSG} ">>>" | cd ${STAGEDIR}${ETCDIR} && \ | ||||
@${ECHO_MSG} ">>> Add the following line to /etc/rc.conf to enable BackupPC:" | ${CHGRP} wheel config.pl config.pl.pre-${DISTVERSION} && \ | ||||
@${ECHO_MSG} ">>> backuppc_enable=\"YES\"" | ${MV} config.pl hosts config.pl.pre-${DISTVERSION} \ | ||||
@${ECHO_MSG} ">>>" | ${STAGEDIR}${PREFIX}/libexec/${PORTNAME}/ | ||||
Not Done Inline ActionsI think we can use ${MKDIR} instead here? eadler: I think we can use ${MKDIR} instead here? | |||||
@${ECHO_MSG} ">>> Data directory is ${BPC_DATADIR}" | |||||
@${ECHO_MSG} ">>> This is where all the PC backup data is stored." | |||||
@${ECHO_MSG} ">>> This file system needs to be big enough" | |||||
@${ECHO_MSG} ">>> to accommodate all the PCs you expect to backup." | |||||
@${ECHO_MSG} ">>> ----------------------------------------------------------" | |||||
@${ECHO_MSG} | |||||
.include <bsd.port.mk> | .include <bsd.port.mk> |
I'd prefer a patch rather than sed here, but up to you.