1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
6 inherit flag-o-matic prefix systemd
8 DESCRIPTION="File transfer program to keep remote files into sync"
9 HOMEPAGE="https://rsync.samba.org/"
10 SRC_URI="https://rsync.samba.org/ftp/rsync/src/${P}.tar.gz"
11 [[ "${PV}" = *_pre* ]] && SRC_URI="https://rsync.samba.org/ftp/rsync/src-previews/${P/_/}.tar.gz"
15 [[ ${PV} = *_pre* ]] || \
16 KEYWORDS="~alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 ~riscv s390 sparc x86 ~ppc-aix ~x64-cygwin ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
17 IUSE="acl examples iconv ipv6 static stunnel xattr"
19 LIB_DEPEND="acl? ( virtual/acl[static-libs(+)] )
20 xattr? ( kernel_linux? ( sys-apps/attr[static-libs(+)] ) )
21 >=dev-libs/popt-1.5[static-libs(+)]"
22 RDEPEND="!static? ( ${LIB_DEPEND//\[static-libs(+)]} )
23 iconv? ( virtual/libiconv )"
25 static? ( ${LIB_DEPEND} )"
27 S="${WORKDIR}/${P/_/}"
30 use static && append-ldflags -static
32 --with-rsyncd-conf="${EPREFIX}"/etc/rsyncd.conf
33 --without-included-popt
34 $(use_enable acl acl-support)
37 $(use_enable xattr xattr-support)
39 econf "${myeconfargs[@]}"
40 touch proto.h-tstamp #421625
44 emake DESTDIR="${D}" install
46 newconfd "${FILESDIR}"/rsyncd.conf.d rsyncd
47 newinitd "${FILESDIR}"/rsyncd.init.d-r1 rsyncd
49 dodoc NEWS OLDNEWS README TODO tech_report.tex
52 newins "${FILESDIR}"/rsyncd.conf-3.0.9-r1 rsyncd.conf
54 insinto /etc/logrotate.d
55 newins "${FILESDIR}"/rsyncd.logrotate rsyncd
58 newins "${FILESDIR}"/rsyncd.xinetd-3.0.9-r1 rsyncd
60 # Install stunnel helpers
62 emake DESTDIR="${D}" install-ssl-client
63 emake DESTDIR="${D}" install-ssl-daemon
66 # Install the useful contrib scripts
67 if use examples ; then
68 exeinto /usr/share/rsync
70 rm -f "${ED%/}"/usr/share/rsync/{Makefile*,*.c}
73 eprefixify "${ED%/}"/etc/{,xinetd.d}/rsyncd*
75 systemd_dounit "${FILESDIR}/rsyncd.service"
79 if egrep -qis '^[[:space:]]use chroot[[:space:]]*=[[:space:]]*(no|0|false)' \
80 "${EROOT}"/etc/rsyncd.conf "${EROOT}"/etc/rsync/rsyncd.conf ; then
81 ewarn "You have disabled chroot support in your rsyncd.conf. This"
82 ewarn "is a security risk which you should fix. Please check your"
83 ewarn "/etc/rsyncd.conf file and fix the setting 'use chroot'."
86 einfo "Please install \">=net-misc/stunnel-4\" in order to use stunnel feature."
88 einfo "You maybe have to update the certificates configured in"
89 einfo "${EROOT}/etc/stunnel/rsync.conf"