From 40aaaa64e86ba6710bbeb31c4615a6ce80e75e11 Mon Sep 17 00:00:00 2001
From: V3n3RiX <venerix@redcorelinux.org>
Date: Wed, 28 Apr 2021 20:21:43 +0100
Subject: gentoo resync : 28.04.2021

---
 net-misc/rsync/Manifest                            |   6 +-
 .../rsync/files/rsync-3.2.3-glibc-lchmod.patch     |  58 ++++++++
 net-misc/rsync/rsync-3.2.3-r2.ebuild               |   4 +-
 net-misc/rsync/rsync-3.2.3-r3.ebuild               | 147 +++++++++++++++++++++
 net-misc/rsync/rsync-9999.ebuild                   |  11 +-
 5 files changed, 214 insertions(+), 12 deletions(-)
 create mode 100644 net-misc/rsync/files/rsync-3.2.3-glibc-lchmod.patch
 create mode 100644 net-misc/rsync/rsync-3.2.3-r3.ebuild

(limited to 'net-misc/rsync')

diff --git a/net-misc/rsync/Manifest b/net-misc/rsync/Manifest
index 3ed28488183d..3f5a8324cb04 100644
--- a/net-misc/rsync/Manifest
+++ b/net-misc/rsync/Manifest
@@ -1,9 +1,11 @@
+AUX rsync-3.2.3-glibc-lchmod.patch 1836 BLAKE2B 14b2e4246c6c2d4623500e346bea3ad430defbb81de65ecb29672b390024e34e5116c660a87013f8d489a32d1841d535d03fa442cdc9e962d530355f389ad008 SHA512 76864a9002ef3e8c42a840906915de2bb8cfb1dea2597cbe657ee418b5d00b6d409a88cd441658f7a1ce3cab148a9889193ddd75d19b6ef2069379c728434231
 AUX rsyncd.conf-3.0.9-r1 462 BLAKE2B 45a7dde876368e7392ee7a05edf593f55cf6b3b4dc913745f4322ebd75f97bcdf1a24240a54e11469bd659fd565fc74cd8eeaa9490434d88444b5a076803cea7 SHA512 5c57f633aa3daa6513b5d35a1157a50308559ad993257374ce4eea0269f6bf384938f95bed749acb19538e8c4672355351fcee5cef9607153463b19227d343d7
 AUX rsyncd.conf.d 149 BLAKE2B fd2556d0c270c2baa83d4d474d44ab1d16e35f112279a339f179f9af693d977cc0863bf4cd7139363c58e4e6a1a18a24c06474ecc248167224261dbaf04ae0a8 SHA512 8ea9a2f1fea508fa132313fa16513eac84a9ed3ce75741c42769b56bbcd3f1bd2eb8bfdfe40a6c7f619e4281e8fc8d95d1bd84096d0b64aaacf606cd614ae5b3
 AUX rsyncd.init.d-r1 247 BLAKE2B ec4f7a875a51bae10cff7e15df18d285b01dddaa99a03127ba242ec535b7c8a3af3ad4489661ba7b5f6b074e2af38b12da394c0f8992bd28328d807a89757bb0 SHA512 df2ef4d9e65fa72daa9a7d91d69a06027d0e0fbc48f9ebd485e2d51990c8d00985b7ccf41314f984975e8073e2075bbdfe5543754718381497c334dc7d96451a
 AUX rsyncd.logrotate 105 BLAKE2B 82430036a5ca123ba20bc80040e98869734b3b397440968909e9ee0f109b9151de8157427b0aa8fb0ed89fa6cc4cab6ac6e0a9986c076531cd4aa87bea4e2d25 SHA512 b8d6c0bb467a5c963317dc55478d2c10874564cd264d943d4a42037e2fce134fe001fabc92af5c6b5775e84dc310b1c8da147afaa61c99e5663c36580d8651a5
 AUX rsyncd.xinetd-3.0.9-r1 194 BLAKE2B 8e3edf4831e020451ba1886e2e8ae86e576016aabcaaf8e84c48adb15ba6a2e8d8c58098af2757011ea4f84fbfd758029d905fb8f5ed21bcc5ac34c3baae2a9c SHA512 fc053fc4748950343e866cc95284d037156a953454e4294d775f01f059e96e805582688bf1de5c965836889192ce4a663ec740e6ec2265406e509c5c6d6c3215
 DIST rsync-3.2.3.tar.gz 1069784 BLAKE2B 085adb55d0d7e3d063fa198912fd09df67b63800a65baff5315ccb7dfc0e9d703eef30a7f2e72e3b271162c280abd9809b3f736704752c1663eed65ad8e0ac25 SHA512 48b68491f3ef644dbbbfcaec5ab90a1028593e02d50367ce161fd9d3d0bd0a3628bc57c5e5dec4be3a1d213f784f879b8a8fcdfd789ba0f99837cba16e1ae70e
-EBUILD rsync-3.2.3-r2.ebuild 4150 BLAKE2B 17a6902024b3debf7cb1fa369a7f598e2f8180f500c3d83f6ce18f61c4ffafa73c6235590e940048ed583d8f778c2fefbac74d42ee141195c4bdf1583900117a SHA512 bd452773826e5a598d3652399f12d8bcafc355571ea8d9150c9f41ce7cdc5bd7c900f3263a08774e16d540e90ed400059a8d8e9af9b60abbf2660f63f85d2073
-EBUILD rsync-9999.ebuild 4159 BLAKE2B 5af5cfa5f360d340dd5b700cf044a235780efb5138d274eff30bec433ef58fe3eac5dfada535ea3327f04bcda7d89cf71db853ffd9eea269f5e06381d5fccb1f SHA512 3a0a9a11e560ecf944f18c222bfe41bb1af2012ba80d02200d2dd1866755bbde493d1b9e0727157c08793d01d1efc5893fcff56307d1b8b2a188ae37bac60524
+EBUILD rsync-3.2.3-r2.ebuild 4138 BLAKE2B 7cc76942eed81767cf1b43a4c481bca9e6ed518b348f465158e9d619892914e13171d121a9beb3bf86b65df1f1717648688c31a49b361a014e33abf47402fff2 SHA512 b256ac623b72fca14bb06bedb62f62b33f1abac5ca0e8c153b9e9d30131f3604169fd7aa8d94ceb0fca8c0c235bc6ee70841483d5065ad5b04602a9b2d504a22
+EBUILD rsync-3.2.3-r3.ebuild 4027 BLAKE2B e6a19ccf523d52e0234f21959c8cc08cb1544b5c64b82b451d507060be0f3271baf0b888966cb48824d7e2056afe035d493970b3f01e5bc592f07476b5d72c69 SHA512 fcf5b2407a14dbeea2b8a7517be05095e1e25919214f2ce63fe082f6c2d2536c8475cf8673f157e2bd564027fb90778c2be2d965cf56afb0960df24b6703aadf
+EBUILD rsync-9999.ebuild 3968 BLAKE2B 8f8dfdc0f187f5ea9800ffe0f1b785751f67d43224629761754b5b966ec15c9f8899a4b910549b20f19a0f062f76beb4389b8a51b2b25afdb01884b1cc149a85 SHA512 c6b0882561f6110521f53a8a8a8363b96a6ecf3201a2d6041affb715f2beab78e1a15078ec05fc5011f77a573c22ce9b48213ef00ccff29eff3bdc35755fcd5d
 MISC metadata.xml 654 BLAKE2B 28ea5b4e47a5e420ab64c1b688425995d9ab4e556a27b56b27f512a15ec337aa6a1028449ae0a2f9fa313df2b5b5e98b6cf98a38dac82eb83ca3b4871f3b1514 SHA512 3e23d80d1c4fffdc38287e0f1a09f44040a53eb1b395dd8e9b47aa6d467ed4cf4a0b379ce578f1ecf6438a4f322375b633dc47fd2a50e7badd5f94054bfb558d
diff --git a/net-misc/rsync/files/rsync-3.2.3-glibc-lchmod.patch b/net-misc/rsync/files/rsync-3.2.3-glibc-lchmod.patch
new file mode 100644
index 000000000000..970d7af42bad
--- /dev/null
+++ b/net-misc/rsync/files/rsync-3.2.3-glibc-lchmod.patch
@@ -0,0 +1,58 @@
+From 9dd62525f3b98d692e031f22c02be8f775966503 Mon Sep 17 00:00:00 2001
+From: Wayne Davison <wayne@opencoder.net>
+Date: Sun, 29 Nov 2020 09:33:54 -0800
+Subject: [PATCH] Work around glibc's lchmod() issue a better way.
+
+diff --git a/syscall.c b/syscall.c
+index b9c3b4ef..11d10e4a 100644
+--- a/syscall.c
++++ b/syscall.c
+@@ -227,27 +227,35 @@ int do_open(const char *pathname, int flags, mode_t mode)
+ #ifdef HAVE_CHMOD
+ int do_chmod(const char *path, mode_t mode)
+ {
++	static int switch_step = 0;
+ 	int code;
+ 	if (dry_run) return 0;
+ 	RETURN_ERROR_IF_RO_OR_LO;
++	switch (switch_step) {
+ #ifdef HAVE_LCHMOD
+-	code = lchmod(path, mode & CHMOD_BITS);
+-#else
+-	if (S_ISLNK(mode)) {
++#include "case_N.h"
++		if ((code = lchmod(path, mode & CHMOD_BITS)) == 0 || errno != ENOTSUP)
++			break;
++		switch_step++;
++#endif
++
++#include "case_N.h"
++		if (S_ISLNK(mode)) {
+ # if defined HAVE_SETATTRLIST
+-		struct attrlist attrList;
+-		uint32_t m = mode & CHMOD_BITS; /* manpage is wrong: not mode_t! */
++			struct attrlist attrList;
++			uint32_t m = mode & CHMOD_BITS; /* manpage is wrong: not mode_t! */
+ 
+-		memset(&attrList, 0, sizeof attrList);
+-		attrList.bitmapcount = ATTR_BIT_MAP_COUNT;
+-		attrList.commonattr = ATTR_CMN_ACCESSMASK;
+-		code = setattrlist(path, &attrList, &m, sizeof m, FSOPT_NOFOLLOW);
++			memset(&attrList, 0, sizeof attrList);
++			attrList.bitmapcount = ATTR_BIT_MAP_COUNT;
++			attrList.commonattr = ATTR_CMN_ACCESSMASK;
++			code = setattrlist(path, &attrList, &m, sizeof m, FSOPT_NOFOLLOW);
+ # else
+-		code = 1;
++			code = 1;
+ # endif
+-	} else
+-		code = chmod(path, mode & CHMOD_BITS); /* DISCOURAGED FUNCTION */
+-#endif /* !HAVE_LCHMOD */
++		} else
++			code = chmod(path, mode & CHMOD_BITS); /* DISCOURAGED FUNCTION */
++		break;
++	}
+ 	if (code != 0 && (preserve_perms || preserve_executability))
+ 		return code;
+ 	return 0;
diff --git a/net-misc/rsync/rsync-3.2.3-r2.ebuild b/net-misc/rsync/rsync-3.2.3-r2.ebuild
index 3b73247a47c9..7915974ff39e 100644
--- a/net-misc/rsync/rsync-3.2.3-r2.ebuild
+++ b/net-misc/rsync/rsync-3.2.3-r2.ebuild
@@ -3,7 +3,7 @@
 
 EAPI=7
 
-inherit flag-o-matic prefix systemd
+inherit prefix systemd
 
 DESCRIPTION="File transfer program to keep remote files into sync"
 HOMEPAGE="https://rsync.samba.org/"
@@ -16,7 +16,7 @@ else
 		SRC_DIR="src-previews"
 	else
 		SRC_DIR="src"
-		KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~m68k ~mips ppc ppc64 ~riscv s390 sparc x86 ~x64-cygwin ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
+		KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86 ~x64-cygwin ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
 	fi
 	SRC_URI="https://rsync.samba.org/ftp/rsync/${SRC_DIR}/${P/_/}.tar.gz"
 	S="${WORKDIR}/${P/_/}"
diff --git a/net-misc/rsync/rsync-3.2.3-r3.ebuild b/net-misc/rsync/rsync-3.2.3-r3.ebuild
new file mode 100644
index 000000000000..4538ef6d0eee
--- /dev/null
+++ b/net-misc/rsync/rsync-3.2.3-r3.ebuild
@@ -0,0 +1,147 @@
+# Copyright 1999-2021 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit prefix systemd toolchain-funcs
+
+DESCRIPTION="File transfer program to keep remote files into sync"
+HOMEPAGE="https://rsync.samba.org/"
+if [[ "${PV}" == *9999 ]] ; then
+	PYTHON_COMPAT=( python3_{6,7,8} )
+	inherit autotools git-r3 python-any-r1
+	EGIT_REPO_URI="https://github.com/WayneD/rsync.git"
+else
+	if [[ "${PV}" == *_pre* ]] ; then
+		SRC_DIR="src-previews"
+	else
+		SRC_DIR="src"
+		KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86 ~x64-cygwin ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
+	fi
+	SRC_URI="https://rsync.samba.org/ftp/rsync/${SRC_DIR}/${P/_/}.tar.gz"
+	S="${WORKDIR}/${P/_/}"
+fi
+
+LICENSE="GPL-3"
+SLOT="0"
+IUSE="acl examples iconv ipv6 libressl lz4 ssl stunnel system-zlib xattr xxhash zstd"
+
+RDEPEND="acl? ( virtual/acl )
+	lz4? ( app-arch/lz4 )
+	ssl? (
+		!libressl? ( dev-libs/openssl:0= )
+		libressl? ( dev-libs/libressl:0= )
+	)
+	system-zlib? ( sys-libs/zlib )
+	xattr? ( kernel_linux? ( sys-apps/attr ) )
+	xxhash? ( dev-libs/xxhash )
+	zstd? ( >=app-arch/zstd-1.4 )
+	>=dev-libs/popt-1.5
+	iconv? ( virtual/libiconv )"
+DEPEND="${RDEPEND}"
+
+if [[ "${PV}" == *9999 ]] ; then
+	BDEPEND="${PYTHON_DEPS}
+		$(python_gen_any_dep '
+			dev-python/commonmark[${PYTHON_USEDEP}]
+		')"
+fi
+
+# Only required for live ebuild
+python_check_deps() {
+	has_version "dev-python/commonmark[${PYTHON_USEDEP}]"
+}
+
+src_prepare() {
+	local PATCHES=(
+		"${FILESDIR}/rsync-3.2.3-glibc-lchmod.patch"
+	)
+	default
+	if [[ "${PV}" == *9999 ]] ; then
+		eaclocal -I m4
+		eautoconf -o configure.sh
+		eautoheader && touch config.h.in
+	fi
+}
+
+src_configure() {
+	local myeconfargs=(
+		--with-rsyncd-conf="${EPREFIX}"/etc/rsyncd.conf
+		--without-included-popt
+		$(use_enable acl acl-support)
+		$(use_enable iconv)
+		$(use_enable ipv6)
+		$(use_enable lz4)
+		$(use_enable ssl openssl)
+		$(use_with !system-zlib included-zlib)
+		$(use_enable xattr xattr-support)
+		$(use_enable xxhash)
+		$(use_enable zstd)
+	)
+
+	if tc-is-cross-compiler; then
+		# configure check is broken when cross-compiling.
+		myeconfargs+=( --disable-simd )
+	fi
+
+	econf "${myeconfargs[@]}"
+}
+
+src_install() {
+	emake DESTDIR="${D}" install
+
+	newconfd "${FILESDIR}"/rsyncd.conf.d rsyncd
+	newinitd "${FILESDIR}"/rsyncd.init.d-r1 rsyncd
+
+	dodoc NEWS.md README.md TODO tech_report.tex
+
+	insinto /etc
+	newins "${FILESDIR}"/rsyncd.conf-3.0.9-r1 rsyncd.conf
+
+	insinto /etc/logrotate.d
+	newins "${FILESDIR}"/rsyncd.logrotate rsyncd
+
+	insinto /etc/xinetd.d
+	newins "${FILESDIR}"/rsyncd.xinetd-3.0.9-r1 rsyncd
+
+	# Install stunnel helpers
+	if use stunnel ; then
+		emake DESTDIR="${D}" install-ssl-daemon
+	fi
+
+	# Install the useful contrib scripts
+	if use examples ; then
+		exeinto /usr/share/rsync
+		doexe support/*
+		rm -f "${ED}"/usr/share/rsync/{Makefile*,*.c}
+	fi
+
+	eprefixify "${ED}"/etc/{,xinetd.d}/rsyncd*
+
+	systemd_newunit "packaging/systemd/rsync.service" "rsyncd.service"
+}
+
+pkg_postinst() {
+	if egrep -qis '^[[:space:]]use chroot[[:space:]]*=[[:space:]]*(no|0|false)' \
+		"${EROOT}"/etc/rsyncd.conf "${EROOT}"/etc/rsync/rsyncd.conf ; then
+		ewarn "You have disabled chroot support in your rsyncd.conf.  This"
+		ewarn "is a security risk which you should fix.  Please check your"
+		ewarn "/etc/rsyncd.conf file and fix the setting 'use chroot'."
+	fi
+	if use stunnel ; then
+		einfo "Please install \">=net-misc/stunnel-4\" in order to use stunnel feature."
+		einfo
+		einfo "You maybe have to update the certificates configured in"
+		einfo "${EROOT}/etc/stunnel/rsync.conf"
+	fi
+	if use system-zlib ; then
+		ewarn "Using system-zlib is incompatible with <rsync-3.1.1 when"
+		ewarn "using the --compress option."
+		ewarn
+		ewarn "When syncing with >=rsync-3.1.1 built with bundled zlib,"
+		ewarn "and the --compress option, add --new-compress (-zz)."
+		ewarn
+		ewarn "For syncing the portage tree, add:"
+		ewarn "PORTAGE_RSYNC_EXTRA_OPTS=\"--new-compress\" to make.conf"
+	fi
+}
diff --git a/net-misc/rsync/rsync-9999.ebuild b/net-misc/rsync/rsync-9999.ebuild
index c09292830a34..370fd32ffd2b 100644
--- a/net-misc/rsync/rsync-9999.ebuild
+++ b/net-misc/rsync/rsync-9999.ebuild
@@ -3,7 +3,7 @@
 
 EAPI=7
 
-inherit flag-o-matic prefix systemd
+inherit prefix systemd toolchain-funcs
 
 DESCRIPTION="File transfer program to keep remote files into sync"
 HOMEPAGE="https://rsync.samba.org/"
@@ -24,9 +24,7 @@ fi
 
 LICENSE="GPL-3"
 SLOT="0"
-IUSE_CPU_FLAGS_X86=" sse2"
 IUSE="acl examples iconv ipv6 libressl lz4 ssl stunnel system-zlib xattr xxhash zstd"
-IUSE+=" ${IUSE_CPU_FLAGS_X86// / cpu_flags_x86_}"
 
 RDEPEND="acl? ( virtual/acl )
 	lz4? ( app-arch/lz4 )
@@ -78,11 +76,8 @@ src_configure() {
 		$(use_enable zstd)
 	)
 
-	if use elibc_glibc && [[ "${ARCH}" == "amd64" ]] ; then
-		# SIMD is only available for x86_64 right now
-		# and only on glibc (#728868)
-		myeconfargs+=( $(use_enable cpu_flags_x86_sse2 simd) )
-	else
+	if tc-is-cross-compiler; then
+		# configure check is broken when cross-compiling.
 		myeconfargs+=( --disable-simd )
 	fi
 
-- 
cgit v1.2.3