tinc-1.1_pre14-r3.ebuild 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. # Copyright 1999-2016 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI="6"
  4. MY_PV=${PV/_/}
  5. MY_P=${PN}-${MY_PV}
  6. PYTHON_COMPAT=( python2_7 )
  7. inherit eutils multilib python-any-r1
  8. DESCRIPTION="tinc is an easy to configure VPN implementation"
  9. HOMEPAGE="http://www.tinc-vpn.org/"
  10. UPSTREAM_VER=1
  11. [[ -n ${UPSTREAM_VER} ]] && \
  12. UPSTREAM_PATCHSET_URI="https://dev.gentoo.org/~dlan/distfiles/${PN}-1.1-upstream-patches-${UPSTREAM_VER}.tar.xz"
  13. SRC_URI="http://www.tinc-vpn.org/packages/${MY_P}.tar.gz
  14. ${UPSTREAM_PATCHSET_URI}"
  15. LICENSE="GPL-2"
  16. SLOT="0"
  17. KEYWORDS="~amd64 ~arm ~arm64 ~mips ~ppc ~ppc64 ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x86-macos"
  18. IUSE="+lzo +ncurses gui libressl +readline +ssl uml vde upnp +zlib"
  19. DEPEND="
  20. ssl? (
  21. !libressl? ( dev-libs/openssl:0= )
  22. libressl? ( dev-libs/libressl:0= )
  23. )
  24. lzo? ( dev-libs/lzo:2 )
  25. ncurses? ( sys-libs/ncurses:= )
  26. readline? ( sys-libs/readline:= )
  27. upnp? ( net-libs/miniupnpc )
  28. zlib? ( sys-libs/zlib )"
  29. RDEPEND="${DEPEND}
  30. vde? ( net-misc/vde )
  31. ${PYTHON_DEPS}
  32. gui? ( $(python_gen_any_dep '
  33. dev-python/wxpython[${PYTHON_USEDEP}]
  34. ') )"
  35. S="${WORKDIR}/${MY_P}"
  36. src_prepare() {
  37. # Upstream's patchset
  38. if [[ -n ${UPSTREAM_VER} ]]; then
  39. einfo "Try to apply Tinc Upstream patch set"
  40. EPATCH_SUFFIX="patch" \
  41. EPATCH_FORCE="yes" \
  42. EPATCH_OPTS="-p1" \
  43. epatch "${WORKDIR}"/patches-upstream
  44. fi
  45. eapply "${FILESDIR}"/tinc-1.1-fix-paths.patch #560528
  46. eapply_user
  47. }
  48. src_configure() {
  49. econf \
  50. --enable-jumbograms \
  51. --disable-silent-rules \
  52. --enable-legacy-protocol \
  53. --disable-tunemu \
  54. --with-systemd=/usr/$(get_libdir)/systemd/system \
  55. $(use_enable lzo) \
  56. $(use_enable ncurses curses) \
  57. $(use_enable readline) \
  58. $(use_enable uml) \
  59. $(use_enable vde) \
  60. $(use_enable zlib) \
  61. $(use_enable upnp miniupnpc) \
  62. $(use_with ssl openssl)
  63. #--without-libgcrypt \
  64. }
  65. src_install() {
  66. emake DESTDIR="${D}" install
  67. dodir /etc/tinc
  68. dodoc AUTHORS NEWS README THANKS
  69. doconfd "${FILESDIR}"/tinc.networks
  70. newconfd "${FILESDIR}"/tincd.conf tincd
  71. newinitd "${FILESDIR}"/tincd-r2 tincd
  72. if use gui; then
  73. python_fix_shebang "${ED}"/usr/bin/tinc-gui
  74. else
  75. rm -f "${ED}"/usr/bin/tinc-gui || die
  76. fi
  77. }
  78. pkg_postinst() {
  79. elog "This package requires the tun/tap kernel device."
  80. elog "Look at http://www.tinc-vpn.org/ for how to configure tinc"
  81. }