diff options
author | eik <eik@FreeBSD.org> | 2003-11-17 07:08:12 +0800 |
---|---|---|
committer | eik <eik@FreeBSD.org> | 2003-11-17 07:08:12 +0800 |
commit | 493dc05eb5924bc4656b31bd42e9d15ba6edc7d0 (patch) | |
tree | 574904cfdd9acdbbec796c694dbf877e0c0bda0e /net/rsync | |
parent | 70f5ab0aeb3dd2ccc54c890e070795cdfb113a0d (diff) | |
download | freebsd-ports-gnome-493dc05eb5924bc4656b31bd42e9d15ba6edc7d0.tar.gz freebsd-ports-gnome-493dc05eb5924bc4656b31bd42e9d15ba6edc7d0.tar.zst freebsd-ports-gnome-493dc05eb5924bc4656b31bd42e9d15ba6edc7d0.zip |
- add rc.subr(8) start/stop script
- assume maintainership, I don't speak Haskell .-P
- install some additional documentation
- USE_SSH => !WITHOUT_SSH, no extra warning
since this is default for OSVERSION >= 400016
- added a test target
- bumped PORTREVISION
Approved by: marcus (mentor)
Diffstat (limited to 'net/rsync')
-rw-r--r-- | net/rsync/Makefile | 41 | ||||
-rw-r--r-- | net/rsync/files/patch-test.sh | 11 | ||||
-rw-r--r-- | net/rsync/files/rsyncd.sh | 34 | ||||
-rw-r--r-- | net/rsync/files/rsyncd.sh.sample | 16 | ||||
-rw-r--r-- | net/rsync/pkg-plist | 8 |
5 files changed, 77 insertions, 33 deletions
diff --git a/net/rsync/Makefile b/net/rsync/Makefile index 2c07f7770cae..e18a259c951d 100644 --- a/net/rsync/Makefile +++ b/net/rsync/Makefile @@ -8,14 +8,14 @@ PORTNAME= rsync PORTVERSION= 2.5.6 -PORTREVISION= 1 +PORTREVISION= 2 CATEGORIES= net ipv6 MASTER_SITES= ftp://samba.anu.edu.au/pub/rsync/ \ ftp://sunsite.auc.dk/pub/unix/rsync/ \ ftp://ftp.sunet.se/pub/unix/admin/rsync/ \ ftp://ftp.fu-berlin.de/pub/unix/network/rsync/ -MAINTAINER= ports@FreeBSD.org +MAINTAINER= eik@FreeBSD.org COMMENT= A network file distribution/synchronization utility .if defined(WITH_POPT_PORT) @@ -25,6 +25,7 @@ LIB_DEPENDS= popt.0:${PORTSDIR}/devel/popt USE_REINPLACE= yes GNU_CONFIGURE= yes CONFIGURE_ARGS= --disable-debug +CONFIGURE_TARGET= --build=${MACHINE_ARCH}-portbld-freebsd${OSREL} .if defined(WITH_POPT_PORT) CONFIGURE_ENV= CFLAGS="-I${LOCALBASE}/include" \ @@ -33,15 +34,26 @@ CONFIGURE_ENV= CFLAGS="-I${LOCALBASE}/include" \ CONFIGURE_ARGS+= --with-included-popt .endif +.if !defined(NOPORTDOCS) +PORTDOCS= NEWS README csprotocol.txt tech_report.tex +.endif + .include <bsd.port.pre.mk> -.if ${OSVERSION} >= 400016 -USE_SSH?= yes +.if ${OSVERSION} >= 500038 +RC_SUBR?= /etc/rc.subr .else -USE_SSH?= no +USE_RC_SUBR= yes +.endif + +SED_SCRIPT+= -e 's,%%PREFIX%%,${PREFIX},g' \ + -e 's,%%RC_SUBR%%,${RC_SUBR},g' + +.if ${OSVERSION} < 400016 +WITHOUT_SSH?= yes .endif -.if ${USE_SSH:U} == YES +.if !defined(WITHOUT_SSH) CONFIGURE_ARGS+= --with-rsh=ssh .endif @@ -71,18 +83,23 @@ pre-configure: @${REINPLACE_CMD} -e 's|malloc.h|stdlib.h|g' \ ${WRKSRC}/rsync.h ${WRKSRC}/zlib/zutil.h +post-build: + @${SED} ${SED_SCRIPT} <${FILESDIR}/rsyncd.sh >${WRKDIR}/rsyncd.sh + post-install: @${STRIP_CMD} ${PREFIX}/bin/rsync - ${INSTALL_DATA} ${FILESDIR}/rsyncd.conf.sample ${PREFIX}/etc/ - ${INSTALL_SCRIPT} ${FILESDIR}/rsyncd.sh.sample ${PREFIX}/etc/rc.d/ + @${INSTALL_DATA} ${FILESDIR}/rsyncd.conf.sample ${PREFIX}/etc/ + @[ -f ${PREFIX}/etc/rsyncd.conf ] || cp ${PREFIX}/etc/rsyncd.conf.sample ${PREFIX}/etc/rsyncd.conf + @${INSTALL_SCRIPT} ${WRKDIR}/rsyncd.sh ${PREFIX}/etc/rc.d/ .if !defined(NOPORTDOCS) @${MKDIR} ${DOCSDIR} - ${INSTALL_DATA} ${WRKSRC}/README ${DOCSDIR} - ${INSTALL_DATA} ${WRKSRC}/COPYING ${DOCSDIR} - ${INSTALL_DATA} ${WRKSRC}/tech_report.tex ${DOCSDIR} + @${INSTALL_DATA} ${PORTDOCS:S,^,${WRKSRC}/,} ${DOCSDIR} .endif -.if ${USE_SSH:U} == YES +.if !defined(WITHOUT_SSH) @${CAT} ${PKGMESSAGE} .endif +test: build + @cd ${WRKSRC}; ${SH} -c 'umask 0; ./test.sh' + .include <bsd.port.post.mk> diff --git a/net/rsync/files/patch-test.sh b/net/rsync/files/patch-test.sh new file mode 100644 index 000000000000..8059f85388b1 --- /dev/null +++ b/net/rsync/files/patch-test.sh @@ -0,0 +1,11 @@ +--- test.sh.orig Sun Nov 16 20:30:24 2003 ++++ test.sh Sun Nov 16 20:30:40 2003 +@@ -165,7 +165,7 @@ + + rm -rf ${TO} + mkdir -p ${FROM}2/dir/subdir +-cp -a ${FROM}/dir/subdir/subsubdir ${FROM}2/dir/subdir ++cp -pR ${FROM}/dir/subdir/subsubdir ${FROM}2/dir/subdir + cp ${FROM}/dir/* ${FROM}2/dir 2>/dev/null + runtest "excludes" 'checkit "$RSYNC -vv -Hlrt --delete --include /dir/ --include /dir/\* --include /dir/\*/subsubdir --include /dir/\*/subsubdir/\*\* --exclude \*\* ${FROM}/dir ${TO}" ${FROM}2/ ${TO}' + rm -r ${FROM}2 diff --git a/net/rsync/files/rsyncd.sh b/net/rsync/files/rsyncd.sh new file mode 100644 index 000000000000..28a85e8bef02 --- /dev/null +++ b/net/rsync/files/rsyncd.sh @@ -0,0 +1,34 @@ +#!/bin/sh +# +# $FreeBSD$ +# + +# PROVIDE: rsyncd +# REQUIRE: LOGIN +# KEYWORD: FreeBSD shutdown + +# +# Add the following lines to /etc/rc.conf to enable rsyncd: +# +#rsyncd_enable="YES" +# +# See rsync(1) for flags +# + +. %%RC_SUBR%% + +name=rsyncd +rcvar=`set_rcvar` + +command=%%PREFIX%%/bin/rsync +command_args="--daemon" +pidfile=/var/run/${name}.pid +required_files=%%PREFIX%%/etc/${name}.conf + +# set defaults + +rsyncd_enable=${rsyncd_enable:-"NO"} +rsyncd_flags=${rsyncd_flags:-""} + +load_rc_config ${name} +run_rc_command "$1" diff --git a/net/rsync/files/rsyncd.sh.sample b/net/rsync/files/rsyncd.sh.sample deleted file mode 100644 index 7ec945a7dc5f..000000000000 --- a/net/rsync/files/rsyncd.sh.sample +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/sh - -case "$1" in -start) - [ -x /usr/local/bin/rsync ] && [ -f /usr/local/etc/rsyncd.conf ] && \ - /usr/local/bin/rsync --daemon > /dev/null && echo -n ' rsyncd' - ;; -stop) - [ -r /var/run/rsyncd.pid ] && /bin/kill -9 `cat /var/run/rsyncd.pid` > /dev/null && echo -n ' rsyncd' - ;; -*) - echo "Usage: `basename $0` {start|stop}" >&2 - ;; -esac - -exit 0 diff --git a/net/rsync/pkg-plist b/net/rsync/pkg-plist index b95b6cfcddb4..d85fc82adbfb 100644 --- a/net/rsync/pkg-plist +++ b/net/rsync/pkg-plist @@ -1,8 +1,6 @@ @comment $FreeBSD$ bin/rsync +@unexec if cmp -s %D/etc/rsyncd.conf.sample %D/etc/rsyncd.conf; then rm -f %D/etc/rsyncd.conf; fi etc/rsyncd.conf.sample -etc/rc.d/rsyncd.sh.sample -%%PORTDOCS%%share/doc/rsync/README -%%PORTDOCS%%share/doc/rsync/COPYING -%%PORTDOCS%%share/doc/rsync/tech_report.tex -%%PORTDOCS%%@dirrm share/doc/rsync +@exec [ -f %B/rsyncd.conf ] || cp %B/%f %B/rsyncd.conf +etc/rc.d/rsyncd.sh |