1 # Copyright 1999-2010 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/net-im/bitlbee/bitlbee-3.0.1.ebuild,v 1.1 2010/11/25 05:08:12 radhermit Exp $
6 inherit eutils toolchain-funcs confutils multilib
8 DESCRIPTION="irc to IM gateway that support multiple IM protocols"
9 HOMEPAGE="http://www.bitlbee.org/"
10 SRC_URI="http://get.bitlbee.org/src/${P}.tar.gz"
14 KEYWORDS="~alpha ~amd64 ~ia64 ~ppc ~sparc ~x86 ~x86-fbsd"
15 IUSE="debug gnutls ipv6 +jabber libevent msn nss +oscar otr +plugins purple ssl test twitter +yahoo xinetd" # ldap - Bug 195758
17 COMMON_DEPEND="purple? ( net-im/pidgin )
18 libevent? ( dev-libs/libevent )
19 !libevent? ( >=dev-libs/glib-2.4 )
20 otr? ( net-libs/libotr )
21 msn? ( gnutls? ( net-libs/gnutls )
22 !gnutls? ( nss? ( dev-libs/nss ) )
23 !gnutls? ( !nss? ( ssl? ( dev-libs/openssl ) ) )
25 jabber? ( gnutls? ( net-libs/gnutls )
26 !gnutls? ( nss? ( dev-libs/nss ) )
27 !gnutls? ( !nss? ( ssl? ( dev-libs/openssl ) ) )
29 # ldap? ( net-nds/openldap )"
30 DEPEND="${COMMON_DEPEND}
32 test? ( dev-libs/check )"
34 RDEPEND="${COMMON_DEPEND}
36 xinetd? ( sys-apps/xinetd )"
40 elog "You have enabled libpurple support. This disables all the other"
41 elog " protocol modules, since everything is handled by libpurple."
44 elog "Support for all IM protocols are controlled by use flags."
45 elog " Make sure you've enabled the flags you want."
49 confutils_require_any jabber msn oscar twitter yahoo purple
51 # At the request of upstream, die if MSN Messenger support is enabled
52 # but no SSL support has been enabled
53 confutils_use_depend_any msn gnutls nss ssl
55 if use jabber && ! use gnutls && ! use ssl ; then
58 ewarn "You have enabled nss and jabber"
59 ewarn "but nss doesn't work with jabber"
60 ewarn "Enable ONE of the following use instead"
61 ewarn "flags: gnutls or ssl"
63 die "nss with jabber doesn't work"
66 elog "You have enabled support for Jabber but do not have SSL"
67 elog "support enabled. This *will* prevent bitlbee from being"
68 elog "able to connect to SSL enabled Jabber servers. If you need to"
69 elog "connect to Jabber over SSL, enable ONE of the following use"
70 elog "flags: gnutls or ssl"
75 enewuser bitlbee -1 -1 /var/lib/bitlbee bitlbee
80 -e "s@/usr/local/sbin/bitlbee@/usr/sbin/bitlbee@" \
81 -e "s/nobody/bitlbee/" \
82 -e "s/}/ disable = yes\n}/" \
83 doc/bitlbee.xinetd || die "sed failed in xinetd"
86 -e "s@mozilla-nss@nss@g" \
87 configure || die "sed failed in configure"
89 epatch "${FILESDIR}"/${PN}-3.0-configure.patch
90 epatch "${FILESDIR}"/${P}-msn-unfuck.patch
94 # ldap hard-disabled for now
95 local myconf="--ldap=0"
97 # setup plugins, protocol, ipv6 and debug
98 for flag in debug ipv6 msn jabber oscar plugins purple twitter yahoo ; do
100 myconf="${myconf} --${flag}=1"
102 myconf="${myconf} --${flag}=0"
107 if use otr && use plugins ; then
108 myconf="${myconf} --otr=plugin"
111 ewarn "OTR support has been disabled automatically because it"
112 ewarn "requires the plugins USE flag."
114 myconf="${myconf} --otr=0"
117 # setup ssl use flags
119 myconf="${myconf} --ssl=gnutls"
120 einfo "Using gnutls for SSL support"
122 myconf="${myconf} --ssl=openssl"
123 einfo "Using openssl for SSL support"
125 myconf="${myconf} --ssl=nss"
126 einfo "Using nss for SSL support"
128 myconf="${myconf} --ssl=bogus"
129 einfo "You will not have any encryption support enabled."
133 if use libevent ; then
134 myconf="${myconf} --events=libevent"
136 myconf="${myconf} --events=glib"
139 # NOTE: bitlbee's configure script is not an autotool creation,
140 # so that is why we don't use econf.
141 ./configure --prefix=/usr --datadir=/usr/share/bitlbee \
142 --etcdir=/etc/bitlbee --plugindir=/usr/$(get_libdir)/bitlbee \
143 --strip=0 ${myconf} || die "econf failed"
146 -e "s/CFLAGS=.*$/CFLAGS=${CFLAGS}/" \
147 -e "/^EFLAGS/s:=:&${LDFLAGS} :" \
148 Makefile.settings || die "sed failed"
152 emake install install-etc install-doc install-dev DESTDIR="${D}" ||
155 keepdir /var/lib/bitlbee
156 fperms 700 /var/lib/bitlbee
157 fowners bitlbee:bitlbee /var/lib/bitlbee
159 dodoc doc/{AUTHORS,CHANGES,CREDITS,FAQ,README}
160 dodoc doc/user-guide/user-guide.txt
161 dohtml -A xml doc/user-guide/*.xml
162 dohtml -A xsl doc/user-guide/*.xsl
163 dohtml doc/user-guide/*.html
165 doman doc/bitlbee.8 doc/bitlbee.conf.5
168 insinto /etc/xinetd.d
169 newins doc/bitlbee.xinetd bitlbee
172 newinitd "${FILESDIR}"/bitlbee.initd bitlbee || die
173 newconfd "${FILESDIR}"/bitlbee.confd bitlbee || die
175 keepdir /var/run/bitlbee
176 fowners bitlbee:bitlbee /var/run/bitlbee
178 dodir /usr/share/bitlbee
179 insinto /usr/share/bitlbee
181 doins convert_purple.py bitlbee-ctl.pl
185 chown -R bitlbee:bitlbee "${ROOT}"/var/lib/bitlbee
186 chown -R bitlbee:bitlbee "${ROOT}"/var/run/bitlbee
188 elog "The utils included in bitlbee are now located in /usr/share/bitlbee"
190 elog "NOTE: The IRSSI script is no longer provided by BitlBee."
192 elog "The bitlbeed init script has been replaced by bitlbee."
193 elog "You must update your configuration."