1 # Copyright 1999-2014 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
7 inherit eutils flag-o-matic prefix systemd
9 DESCRIPTION="File transfer program to keep remote files into sync"
10 HOMEPAGE="http://rsync.samba.org/"
11 SRC_URI="http://rsync.samba.org/ftp/rsync/src/${P/_/}.tar.gz"
15 KEYWORDS="alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~ppc-aix ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~x64-freebsd ~x86-freebsd ~hppa-hpux ~ia64-hpux ~x86-interix ~amd64-linux ~arm-linux ~ia64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
16 IUSE="acl iconv ipv6 static xattr"
18 LIB_DEPEND="acl? ( virtual/acl[static-libs(+)] )
19 xattr? ( kernel_linux? ( sys-apps/attr[static-libs(+)] ) )
20 >=dev-libs/popt-1.5[static-libs(+)]"
21 RDEPEND="!static? ( ${LIB_DEPEND//\[static-libs(+)]} )
22 iconv? ( virtual/libiconv )"
24 static? ( ${LIB_DEPEND} )"
33 use static && append-ldflags -static
35 --without-included-popt \
36 $(use_enable acl acl-support) \
37 $(use_enable xattr xattr-support) \
40 --with-rsyncd-conf="${EPREFIX}"/etc/rsyncd.conf
41 touch proto.h-tstamp #421625
45 emake DESTDIR="${D}" install
46 newconfd "${FILESDIR}"/rsyncd.conf.d rsyncd
47 newinitd "${FILESDIR}"/rsyncd.init.d-r1 rsyncd
48 dodoc NEWS OLDNEWS README TODO tech_report.tex
50 newins "${FILESDIR}"/rsyncd.conf-3.0.9-r1 rsyncd.conf
52 insinto /etc/logrotate.d
53 newins "${FILESDIR}"/rsyncd.logrotate rsyncd
56 newins "${FILESDIR}"/rsyncd.xinetd-3.0.9-r1 rsyncd
58 # Install the useful contrib scripts
59 exeinto /usr/share/rsync
61 rm -f "${ED}"/usr/share/rsync/{Makefile*,*.c}
63 eprefixify "${ED}"/etc/{,xinetd.d}/rsyncd*
65 systemd_dounit "${FILESDIR}/rsyncd.service"
69 if egrep -qis '^[[:space:]]use chroot[[:space:]]*=[[:space:]]*(no|0|false)' \
70 "${EROOT}"/etc/rsyncd.conf "${EROOT}"/etc/rsync/rsyncd.conf ; then
71 ewarn "You have disabled chroot support in your rsyncd.conf. This"
72 ewarn "is a security risk which you should fix. Please check your"
73 ewarn "/etc/rsyncd.conf file and fix the setting 'use chroot'."