tox-0.1.4.ebuild 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. # Copyright 1999-2017 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=6
  4. inherit autotools systemd unpacker user
  5. DESCRIPTION="Encrypted P2P, messaging, and audio/video calling platform"
  6. HOMEPAGE="https://tox.chat"
  7. SRC_URI="https://github.com/TokTok/c-toxcore/releases/download/v${PV}/c-toxcore-v${PV}.tar.lz -> ${P}.tar.lz"
  8. LICENSE="GPL-3+"
  9. SLOT="0/0.1"
  10. KEYWORDS="~amd64 ~arm ~x86"
  11. IUSE="+av daemon log-debug log-error log-info log-trace log-warn +no-log ntox static-libs test"
  12. REQUIRED_USE="^^ ( no-log log-trace log-debug log-info log-warn log-error )"
  13. RDEPEND="
  14. av? ( media-libs/libvpx:=
  15. media-libs/opus )
  16. daemon? ( dev-libs/libconfig )
  17. ntox? ( sys-libs/ncurses:0= )
  18. >=dev-libs/libsodium-0.6.1:=[asm,urandom]"
  19. DEPEND="${RDEPEND}
  20. $(unpacker_src_uri_depends)
  21. test? ( dev-libs/check )
  22. virtual/pkgconfig"
  23. S=${WORKDIR}
  24. src_prepare() {
  25. default
  26. eautoreconf
  27. }
  28. src_configure() {
  29. econf \
  30. $(usex log-trace "--enable-logging --with-log-level=TRACE" "") \
  31. $(usex log-debug "--enable-logging --with-log-level=DEBUG" "") \
  32. $(usex log-info "--enable-logging --with-log-level=INFO" "") \
  33. $(usex log-warn "--enable-logging --with-log-level=WARNING" "") \
  34. $(usex log-error "--enable-logging --with-log-level=ERROR" "") \
  35. $(use_enable av) \
  36. $(use_enable test tests) \
  37. $(use_enable ntox) \
  38. $(use_enable daemon) \
  39. $(use_enable static-libs static)
  40. }
  41. src_install() {
  42. default
  43. if use daemon; then
  44. newinitd "${FILESDIR}"/initd tox-dht-daemon
  45. newconfd "${FILESDIR}"/confd tox-dht-daemon
  46. insinto /etc
  47. doins "${FILESDIR}"/tox-bootstrapd.conf
  48. systemd_dounit "${FILESDIR}"/tox-bootstrapd.service
  49. fi
  50. find "${D}" -name '*.la' -delete || die
  51. }
  52. pkg_postinst() {
  53. if use daemon; then
  54. enewgroup ${PN}
  55. enewuser ${PN} -1 -1 -1 ${PN}
  56. if [[ -f ${EROOT%/}/var/lib/tox-dht-bootstrap/key ]]; then
  57. ewarn "Backwards compatability with the bootstrap daemon might have been"
  58. ewarn "broken a while ago. To resolve this issue, REMOVE the following files:"
  59. ewarn " ${EROOT%/}/var/lib/tox-dht-bootstrap/key"
  60. ewarn " ${EROOT%/}/etc/tox-bootstrapd.conf"
  61. ewarn " ${EROOT%/}/run/tox-dht-bootstrap/tox-dht-bootstrap.pid"
  62. ewarn "Then just re-emerge net-libs/tox"
  63. fi
  64. fi
  65. }