clsync-0.4.1.ebuild 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. # Copyright 1999-2016 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=5
  4. if [[ ${PV} == "9999" ]] ; then
  5. inherit git-r3
  6. EGIT_REPO_URI="https://github.com/xaionaro/${PN}.git"
  7. else
  8. PVER="20150524-v2"
  9. SRC_URI="
  10. https://github.com/xaionaro/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz
  11. https://dev.gentoo.org/~bircoph/patches/${P}-${PVER}.patch.xz
  12. "
  13. KEYWORDS="~amd64 ~x86"
  14. fi
  15. inherit autotools eutils linux-info
  16. DESCRIPTION="Live sync tool based on inotify, written in GNU C"
  17. HOMEPAGE="https://github.com/xaionaro/clsync http://ut.mephi.ru/oss/clsync"
  18. LICENSE="GPL-3+"
  19. SLOT="0"
  20. IUSE="+caps cluster control-socket cgroups debug extra-debug
  21. extra-hardened gio hardened +highload-locks +inotify mhash
  22. namespaces seccomp"
  23. REQUIRED_USE="
  24. || ( gio inotify )
  25. extra-debug? ( debug )
  26. extra-hardened? ( hardened )
  27. mhash? ( cluster )
  28. seccomp? ( caps )
  29. "
  30. CDEPEND="
  31. dev-libs/glib:2
  32. cgroups? ( dev-libs/libcgroup )
  33. mhash? ( app-crypt/mhash )
  34. "
  35. DEPEND="${CDEPEND}
  36. virtual/pkgconfig
  37. "
  38. RDEPEND="${CDEPEND}
  39. ~app-doc/clsync-docs-${PV}
  40. "
  41. pkg_pretend() {
  42. use namespaces && CONFIG_CHECK="~NAMESPACES ~UTS_NS ~IPC_NS ~USER_NS ~PID_NS ~NET_NS"
  43. use seccomp && CONFIG_CHECK+=" ~SECCOMP"
  44. check_extra_config
  45. }
  46. src_prepare() {
  47. # upstream fixes for 0.4.1
  48. epatch "${WORKDIR}/${P}-${PVER}.patch"
  49. eautoreconf
  50. }
  51. src_configure() {
  52. local harden_level=0
  53. use hardened && harden_level=1
  54. use extra-hardened && harden_level=2
  55. local debug_level=0
  56. use debug && debug_level=1
  57. use extra-debug && debug_level=2
  58. econf \
  59. --docdir="${EPREFIX}/usr/share/doc/${PF}" \
  60. --disable-socket-library \
  61. --enable-clsync \
  62. --enable-debug=${debug_level} \
  63. --enable-paranoid=${harden_level} \
  64. --without-bsm \
  65. --without-kqueue \
  66. $(use_enable caps capabilities) \
  67. $(use_enable cluster) \
  68. $(use_enable control-socket socket) \
  69. $(use_enable highload-locks) \
  70. $(use_enable namespaces unshare) \
  71. $(use_enable seccomp) \
  72. $(use_with cgroups libcgroup) \
  73. $(use_with gio gio lib) \
  74. $(use_with inotify inotify native) \
  75. $(use_with mhash)
  76. }
  77. src_install() {
  78. emake DESTDIR="${D}" install
  79. # docs go into clsync-docs
  80. rm -rf "${ED}/usr/share/doc" || die
  81. newinitd "${FILESDIR}/${PN}.initd" "${PN}"
  82. newconfd "${FILESDIR}/${PN}.confd" "${PN}"
  83. # filter rules and sync scripts are supposed to be here
  84. keepdir "${EPREFIX}/etc/${PN}"
  85. insinto "/etc/${PN}"
  86. newins "${FILESDIR}/${PN}.conf" "${PN}.conf"
  87. }
  88. pkg_postinst() {
  89. einfo "${PN} is just a convenient way to run synchronization tools on live data,"
  90. einfo "it doesn't copy data itself, so you need to install software to do actual"
  91. einfo "data transfer. Usually net-misc/rsync is a good choise, but ${PN} is"
  92. einfo "is flexible enough to use any user tool, see manual page for details."
  93. einfo
  94. einfo "${PN} init script can be multiplexed, to use symlink init script to"
  95. einfo "othername and use conf.d/othername to configure it."
  96. einfo
  97. einfo "If you're interested in improved security, enable"
  98. einfo "USE=\"caps cgroups hardened namespaces seccomp\""
  99. }