rsync-3.1.2.ebuild 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. # Copyright 1999-2017 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI="5"
  4. inherit eutils flag-o-matic prefix systemd
  5. DESCRIPTION="File transfer program to keep remote files into sync"
  6. HOMEPAGE="http://rsync.samba.org/"
  7. SRC_URI="http://rsync.samba.org/ftp/rsync/src/${P}.tar.gz"
  8. [[ "${PV}" = *_pre* ]] && SRC_URI="http://rsync.samba.org/ftp/rsync/src-previews/${P/_/}.tar.gz"
  9. LICENSE="GPL-3"
  10. SLOT="0"
  11. if [[ ${PV} != *_pre ]] ; then
  12. KEYWORDS="alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~ppc-aix ~x64-cygwin ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~amd64-linux ~arm-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
  13. fi
  14. IUSE="acl iconv ipv6 static stunnel xattr"
  15. LIB_DEPEND="acl? ( virtual/acl[static-libs(+)] )
  16. xattr? ( kernel_linux? ( sys-apps/attr[static-libs(+)] ) )
  17. >=dev-libs/popt-1.5[static-libs(+)]"
  18. RDEPEND="!static? ( ${LIB_DEPEND//\[static-libs(+)]} )
  19. iconv? ( virtual/libiconv )"
  20. DEPEND="${RDEPEND}
  21. static? ( ${LIB_DEPEND} )"
  22. S=${WORKDIR}/${P/_/}
  23. src_prepare() {
  24. epatch_user
  25. }
  26. src_configure() {
  27. use static && append-ldflags -static
  28. econf \
  29. --without-included-popt \
  30. $(use_enable acl acl-support) \
  31. $(use_enable xattr xattr-support) \
  32. $(use_enable ipv6) \
  33. $(use_enable iconv) \
  34. --with-rsyncd-conf="${EPREFIX}"/etc/rsyncd.conf
  35. touch proto.h-tstamp #421625
  36. }
  37. src_install() {
  38. emake DESTDIR="${D}" install
  39. newconfd "${FILESDIR}"/rsyncd.conf.d rsyncd
  40. newinitd "${FILESDIR}"/rsyncd.init.d-r1 rsyncd
  41. dodoc NEWS OLDNEWS README TODO tech_report.tex
  42. insinto /etc
  43. newins "${FILESDIR}"/rsyncd.conf-3.0.9-r1 rsyncd.conf
  44. insinto /etc/logrotate.d
  45. newins "${FILESDIR}"/rsyncd.logrotate rsyncd
  46. insinto /etc/xinetd.d
  47. newins "${FILESDIR}"/rsyncd.xinetd-3.0.9-r1 rsyncd
  48. # Install stunnel helpers
  49. if use stunnel ; then
  50. emake DESTDIR="${D}" install-ssl-client
  51. emake DESTDIR="${D}" install-ssl-daemon
  52. fi
  53. # Install the useful contrib scripts
  54. exeinto /usr/share/rsync
  55. doexe support/*
  56. rm -f "${ED}"/usr/share/rsync/{Makefile*,*.c}
  57. eprefixify "${ED}"/etc/{,xinetd.d}/rsyncd*
  58. systemd_dounit "${FILESDIR}/rsyncd.service"
  59. }
  60. pkg_postinst() {
  61. if egrep -qis '^[[:space:]]use chroot[[:space:]]*=[[:space:]]*(no|0|false)' \
  62. "${EROOT}"/etc/rsyncd.conf "${EROOT}"/etc/rsync/rsyncd.conf ; then
  63. ewarn "You have disabled chroot support in your rsyncd.conf. This"
  64. ewarn "is a security risk which you should fix. Please check your"
  65. ewarn "/etc/rsyncd.conf file and fix the setting 'use chroot'."
  66. fi
  67. if use stunnel ; then
  68. einfo "Please install \">=net-misc/stunnel-4\" in order to use stunnel feature."
  69. einfo
  70. einfo "You maybe have to update the certificates configured in"
  71. einfo "${EROOT}/etc/stunnel/rsync.conf"
  72. fi
  73. }