logo

overlay

My own overlay for experimentations, use with caution, no support is provided git clone https://hacktivis.me/git/overlay.git

bitlbee-3.5.1.ebuild (3748B)


  1. # Copyright 1999-2017 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=6
  4. inherit user systemd toolchain-funcs
  5. if [[ ${PV} == "9999" ]]; then
  6. EGIT_REPO_URI="https://github.com/bitlbee/bitlbee.git"
  7. inherit git-r3
  8. else
  9. SRC_URI="https://get.bitlbee.org/src/${P}.tar.gz"
  10. KEYWORDS="~amd64 ~ppc ~ppc64 ~x86 "
  11. fi
  12. DESCRIPTION="irc to IM gateway that support multiple IM protocols"
  13. HOMEPAGE="https://www.bitlbee.org/"
  14. LICENSE="GPL-2"
  15. SLOT="0"
  16. IUSE_PROTOCOLS="msn oscar purple twitter +xmpp"
  17. IUSE="debug +gnutls ipv6 libevent nss otr +plugins selinux test xinetd
  18. ${IUSE_PROTOCOLS}"
  19. REQUIRED_USE="
  20. xmpp? ( !nss )
  21. test? ( plugins )
  22. "
  23. COMMON_DEPEND="
  24. >=dev-libs/glib-2.16
  25. purple? ( net-im/pidgin )
  26. libevent? ( dev-libs/libevent:= )
  27. otr? ( >=net-libs/libotr-4 )
  28. gnutls? ( net-libs/gnutls:= )
  29. !gnutls? (
  30. nss? ( dev-libs/nss )
  31. !nss? ( dev-libs/openssl:0= )
  32. )
  33. "
  34. DEPEND="${COMMON_DEPEND}
  35. virtual/pkgconfig
  36. selinux? ( sec-policy/selinux-bitlbee )
  37. test? ( dev-libs/check )"
  38. RDEPEND="${COMMON_DEPEND}
  39. virtual/logger
  40. xinetd? ( sys-apps/xinetd )"
  41. pkg_setup() {
  42. enewgroup bitlbee
  43. enewuser bitlbee -1 -1 /var/lib/bitlbee bitlbee
  44. }
  45. src_prepare() {
  46. if [[ ${PV} != "9999" ]]; then
  47. eapply \
  48. "${FILESDIR}"/${PN}-3.5-systemd-user.patch \
  49. "${FILESDIR}"/${PN}-3.5-verbose-build.patch
  50. fi
  51. eapply_user
  52. }
  53. src_configure() {
  54. local myconf
  55. # setup plugins, protocol, ipv6 and debug
  56. myconf+=( --jabber=$(usex xmpp 1 0) )
  57. for flag in debug ipv6 plugins ${IUSE_PROTOCOLS/+xmpp/} ; do
  58. myconf+=( --${flag}=$(usex ${flag} 1 0) )
  59. done
  60. # set otr
  61. if use otr && use plugins ; then
  62. myconf+=( --otr=plugin )
  63. else
  64. if use otr ; then
  65. ewarn "OTR support has been disabled automatically because it"
  66. ewarn "requires the plugins USE flag."
  67. fi
  68. myconf+=( --otr=0 )
  69. fi
  70. # setup ssl use flags
  71. if use gnutls ; then
  72. myconf+=( --ssl=gnutls )
  73. einfo "Using gnutls for SSL support"
  74. else
  75. ewarn "Only gnutls is officially supported by upstream."
  76. if use nss ; then
  77. myconf+=( --ssl=nss )
  78. einfo "Using nss for SSL support"
  79. else
  80. myconf+=( --ssl=openssl )
  81. einfo "Using openssl for SSL support"
  82. fi
  83. fi
  84. # set event handler
  85. if use libevent ; then
  86. myconf+=( --events=libevent )
  87. else
  88. myconf+=( --events=glib )
  89. fi
  90. # not autotools-based
  91. ./configure \
  92. --prefix=/usr \
  93. --datadir=/usr/share/bitlbee \
  94. --etcdir=/etc/bitlbee \
  95. --plugindir=/usr/$(get_libdir)/bitlbee \
  96. --systemdsystemunitdir=$(systemd_get_systemunitdir) \
  97. --doc=1 \
  98. --strip=0 \
  99. --verbose=1 \
  100. "${myconf[@]}" || die
  101. sed -i \
  102. -e "/^EFLAGS/s:=:&${LDFLAGS} :" \
  103. Makefile.settings || die
  104. }
  105. src_compile() {
  106. emake CC="$(tc-getCC)" LD="$(tc-getLD)"
  107. }
  108. src_install() {
  109. emake DESTDIR="${D}" install install-etc install-doc install-dev install-systemd
  110. keepdir /var/lib/bitlbee
  111. fperms 700 /var/lib/bitlbee
  112. fowners bitlbee:bitlbee /var/lib/bitlbee
  113. dodoc doc/{AUTHORS,CHANGES,CREDITS,FAQ,README}
  114. if use xinetd ; then
  115. insinto /etc/xinetd.d
  116. newins doc/bitlbee.xinetd bitlbee
  117. fi
  118. newinitd "${FILESDIR}"/bitlbee.initd-r1 bitlbee
  119. newconfd "${FILESDIR}"/bitlbee.confd-r1 bitlbee
  120. exeinto /usr/share/bitlbee
  121. doexe utils/{convert_purple.py,bitlbee-ctl.pl}
  122. }
  123. pkg_postinst() {
  124. chown -R bitlbee:bitlbee "${ROOT}"/var/lib/bitlbee
  125. [[ -d "${ROOT}"/var/run/bitlbee ]] &&
  126. chown -R bitlbee:bitlbee "${ROOT}"/var/run/bitlbee
  127. if [[ -z ${REPLACING_VERSIONS} ]]; then
  128. einfo
  129. elog "The bitlbee init script will now attempt to stop all processes owned by the"
  130. elog "bitlbee user, including per-client forks."
  131. elog
  132. elog "Tell the init script not to touch anything besides the main bitlbee process"
  133. elog "by changing the BITLBEE_STOP_ALL variable in"
  134. elog " /etc/conf.d/bitlbee"
  135. einfo
  136. fi
  137. }