Index | Thread | Search

From:
Bryan Vyhmeister <bryan@bsdjournal.net>
Subject:
[PATCH] rsync add zstd,lz4,iconv options as default and -minimal flavor
To:
ports@openbsd.org
Date:
Mon, 1 Jul 2024 18:32:28 -0700

Download raw body.

Thread
I updated the title based on the discussion and what this patch actually
does now. I have a particular project that needs zstd compression with
rsync. I can modify the port in my own tree to build zstd into the port
but I would prefer not to have to maintain a private package repository.
Based on the information about zstd out there, it might be a benefit as
the compression in a lot of scenarios where rsync is used. The
discussion led to the suggestion of adding zstd, lz4, and iconv into the
standard rsync build and then adding a -minimal flavor that keeps those
options out. I have been running rsync this way and it works great. Any
feedback on this?

Bryan


Index: net/rsync/Makefile
===================================================================
RCS file: /cvs/ports/net/rsync/Makefile,v
retrieving revision 1.103
diff -u -p -u -r1.103 Makefile
--- net/rsync/Makefile	6 May 2024 12:23:48 -0000	1.103
+++ net/rsync/Makefile	26 Jun 2024 21:50:12 -0000
@@ -3,15 +3,15 @@ COMMENT =	mirroring/synchronization over
 DISTNAME =	rsync-3.3.0
 CATEGORIES =	net
 HOMEPAGE =	https://rsync.samba.org/
-REVISION =	0
+REVISION =	1
 
-FLAVORS =	iconv
+FLAVORS =	minimal
 FLAVOR ?=
 
 # GPLv3
 PERMIT_PACKAGE =	Yes
 
-WANTLIB =	c crypto
+WANTLIB =	c crypto iconv lz4 zstd
 
 SITES =		https://rsync.samba.org/ftp/rsync/src/ \
 		https://ftp.funet.fi/pub/mirrors/samba.org/pub/rsync/src/
@@ -25,9 +25,7 @@ BUILD_DEPENDS =	textproc/py-commonmark${
 
 SEPARATE_BUILD =Yes
 CONFIGURE_STYLE =gnu
-CONFIGURE_ARGS =--disable-lz4 \
-		--disable-zstd \
-		--with-included-popt \
+CONFIGURE_ARGS =--with-included-popt \
 		--with-included-zlib \
 		--with-rrsync \
 		--with-rsyncd-conf="${SYSCONFDIR}/rsyncd.conf" \
@@ -35,7 +33,10 @@ CONFIGURE_ARGS =--disable-lz4 \
 		--with-nobody-user=_rsync \
 		--with-nobody-group=_rsync
 CONFIGURE_ENV +=CPPFLAGS="-I${LOCALBASE}/include -DXXH_INLINE_ALL=1" \
-		ac_cv_search_XXH64_createState=""
+		LDFLAGS='-L${LOCALBASE}/lib' ac_cv_search_XXH64_createState=""
+LIB_DEPENDS +=	archivers/lz4 \
+		archivers/zstd \
+		converters/libiconv
 
 .include <bsd.port.arch.mk>
 
@@ -43,10 +44,11 @@ CONFIGURE_ENV +=CPPFLAGS="-I${LOCALBASE}
 CONFIGURE_ARGS +=--enable-md5-asm
 .endif
 
-.if ${FLAVOR:Miconv}
-CONFIGURE_ENV +=LDFLAGS='-L${LOCALBASE}/lib'
-LIB_DEPENDS +=	converters/libiconv
-WANTLIB +=	iconv
+.if ${FLAVOR:Mminimal}
+CONFIGURE_ARGS +=--disable-lz4 \
+		--disable-zstd
+WANTLIB =	c crypto
+LIB_DEPENDS =
 .endif
 
 DOCDIR =	${PREFIX}/share/doc/rsync
Index: net/rsync/pkg/DESCR
===================================================================
RCS file: /cvs/ports/net/rsync/pkg/DESCR,v
retrieving revision 1.6
diff -u -p -u -r1.6 DESCR
--- net/rsync/pkg/DESCR	26 Apr 2024 13:26:27 -0000	1.6
+++ net/rsync/pkg/DESCR	26 Jun 2024 21:50:12 -0000
@@ -7,11 +7,12 @@ its delta-transfer algorithm, which redu
 over the network by sending only the differences between the source
 files and the existing files in the destination. Rsync is widely
 used for backups and mirroring and as an improved copy command for
-everyday use.
+everyday use. This also includes options for lz4 and zstd compression
+as well as iconv for people wanting to bring files from other OSes 
+with more versatile filenames.
 
-Flavor: iconv
-    extra dependency, for people wanting to bring files from other OSes with
-    more versatile filenames.
+Flavor: minimal
+    without any extra dependencies of iconv, lz4, and zstd.
 
 To use the rrsync wrapper, python3 should be installed.