1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
6 inherit systemd toolchain-funcs
8 if [[ ${PV} == "9999" ]]; then
9 EGIT_REPO_URI="https://github.com/bitlbee/bitlbee.git"
12 SRC_URI="https://get.bitlbee.org/src/${P}.tar.gz"
13 KEYWORDS="~amd64 ~ppc ~ppc64 ~x86"
16 DESCRIPTION="irc to IM gateway that support multiple IM protocols"
17 HOMEPAGE="https://www.bitlbee.org/"
21 IUSE_PROTOCOLS="msn oscar purple twitter +xmpp"
22 IUSE="debug +gnutls ipv6 libevent libressl nss otr +plugins selinux test xinetd
24 RESTRICT="!test? ( test )"
27 || ( purple xmpp msn oscar )
36 purple? ( net-im/pidgin )
37 libevent? ( dev-libs/libevent:= )
38 otr? ( >=net-libs/libotr-4 )
39 gnutls? ( net-libs/gnutls:= )
43 libressl? ( dev-libs/libressl:= )
44 !libressl? ( dev-libs/openssl:0= )
48 DEPEND="${COMMON_DEPEND}
50 selinux? ( sec-policy/selinux-bitlbee )
51 test? ( dev-libs/check )"
53 RDEPEND="${COMMON_DEPEND}
54 xinetd? ( sys-apps/xinetd )"
57 "${FILESDIR}"/${PN}-3.5-systemd-user.patch
58 "${FILESDIR}"/${PN}-3.5-libcheck.patch
59 "${FILESDIR}"/${PN}-3.5-libevent.patch
65 # setup plugins, protocol, ipv6 and debug
66 myconf+=( --jabber=$(usex xmpp 1 0) )
67 for flag in debug ipv6 plugins ${IUSE_PROTOCOLS/+xmpp/} ; do
68 myconf+=( --${flag}=$(usex ${flag} 1 0) )
72 if use otr && use plugins ; then
73 myconf+=( --otr=plugin )
76 ewarn "OTR support has been disabled automatically because it"
77 ewarn "requires the plugins USE flag."
84 myconf+=( --ssl=gnutls )
85 einfo "Using gnutls for SSL support"
87 ewarn "Only gnutls is officially supported by upstream."
90 einfo "Using nss for SSL support"
92 myconf+=( --ssl=openssl )
93 einfo "Using openssl for SSL support"
98 if use libevent ; then
99 myconf+=( --events=libevent )
101 myconf+=( --events=glib )
104 # not autotools-based
107 --datadir=/usr/share/bitlbee \
108 --etcdir=/etc/bitlbee \
109 --plugindir=/usr/$(get_libdir)/bitlbee \
110 --pcdir=/usr/$(get_libdir)/pkgconfig \
111 --systemdsystemunitdir=$(systemd_get_systemunitdir) \
115 "${myconf[@]}" || die
118 -e "/^EFLAGS/s:=:&${LDFLAGS} :" \
119 Makefile.settings || die
123 emake CC="$(tc-getCC)" LD="$(tc-getLD)"
127 emake DESTDIR="${D}" install install-etc install-doc install-dev install-systemd
129 keepdir /var/lib/bitlbee
130 fperms 700 /var/lib/bitlbee
131 fowners bitlbee:bitlbee /var/lib/bitlbee
133 dodoc doc/{AUTHORS,CHANGES,CREDITS,FAQ,README}
136 insinto /etc/xinetd.d
137 newins doc/bitlbee.xinetd bitlbee
140 newinitd "${FILESDIR}"/bitlbee.initd-r2 bitlbee
141 newconfd "${FILESDIR}"/bitlbee.confd-r2 bitlbee
143 exeinto /usr/share/bitlbee
144 doexe utils/{convert_purple.py,bitlbee-ctl.pl}
148 chown -R bitlbee:bitlbee "${ROOT}"/var/lib/bitlbee