]> git.draconx.ca Git - gentoo-draconx.git/blob - net-im/bitlbee/bitlbee-3.0.1.ebuild
xf86-video-intel: Remove ebuild.
[gentoo-draconx.git] / net-im / bitlbee / bitlbee-3.0.1.ebuild
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 $
4
5 EAPI="3"
6 inherit eutils toolchain-funcs confutils multilib
7
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"
11
12 LICENSE="GPL-2"
13 SLOT="0"
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
16
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 ) ) )
24                 )
25         jabber? ( gnutls? ( net-libs/gnutls )
26                 !gnutls? ( nss? ( dev-libs/nss ) )
27                 !gnutls? ( !nss? ( ssl? ( dev-libs/openssl ) ) )
28                 )"
29         # ldap? ( net-nds/openldap )"
30 DEPEND="${COMMON_DEPEND}
31         dev-util/pkgconfig
32         test? ( dev-libs/check )"
33
34 RDEPEND="${COMMON_DEPEND}
35         virtual/logger
36         xinetd? ( sys-apps/xinetd )"
37
38 pkg_setup() {
39         if use purple ; then
40                 elog "You have enabled libpurple support. This disables all the other"
41                 elog "    protocol modules, since everything is handled by libpurple."
42                 elog
43         else
44                 elog "Support for all IM protocols are controlled by use flags."
45                 elog "    Make sure you've enabled the flags you want."
46                 elog
47         fi
48
49         confutils_require_any jabber msn oscar twitter yahoo purple
50
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
54
55         if use jabber && ! use gnutls && ! use ssl ; then
56                 if use nss ; then
57                         ewarn ""
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"
62                         ewarn ""
63                         die "nss with jabber doesn't work"
64                 fi
65                 elog ""
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"
71                 elog ""
72         fi
73
74         enewgroup bitlbee
75         enewuser bitlbee -1 -1 /var/lib/bitlbee bitlbee
76 }
77
78 src_prepare() {
79         sed -i \
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"
84
85         sed -i \
86                 -e "s@mozilla-nss@nss@g" \
87                 configure || die "sed failed in configure"
88
89         epatch "${FILESDIR}"/${PN}-3.0-configure.patch
90         epatch "${FILESDIR}"/${P}-msn-unfuck.patch
91 }
92
93 src_configure() {
94         # ldap hard-disabled for now
95         local myconf="--ldap=0"
96
97         # setup plugins, protocol, ipv6 and debug
98         for flag in debug ipv6 msn jabber oscar plugins purple twitter yahoo ; do
99                 if use ${flag} ; then
100                         myconf="${myconf} --${flag}=1"
101                 else
102                         myconf="${myconf} --${flag}=0"
103                 fi
104         done
105
106         # set otr
107         if use otr && use plugins ; then
108                 myconf="${myconf} --otr=plugin"
109         else
110                 if use otr ; then
111                         ewarn "OTR support has been disabled automatically because it"
112                         ewarn "requires the plugins USE flag."
113                 fi
114                 myconf="${myconf} --otr=0"
115         fi
116
117         # setup ssl use flags
118         if use gnutls ; then
119                 myconf="${myconf} --ssl=gnutls"
120                 einfo "Using gnutls for SSL support"
121         elif use ssl ; then
122                 myconf="${myconf} --ssl=openssl"
123                 einfo "Using openssl for SSL support"
124         elif use nss ; then
125                 myconf="${myconf} --ssl=nss"
126                 einfo "Using nss for SSL support"
127         else
128                 myconf="${myconf} --ssl=bogus"
129                 einfo "You will not have any encryption support enabled."
130         fi
131
132         # set event handler
133         if use libevent ; then
134                 myconf="${myconf} --events=libevent"
135         else
136                 myconf="${myconf} --events=glib"
137         fi
138
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"
144
145         sed -i \
146                 -e "s/CFLAGS=.*$/CFLAGS=${CFLAGS}/" \
147                 -e "/^EFLAGS/s:=:&${LDFLAGS} :" \
148                 Makefile.settings || die "sed failed"
149 }
150
151 src_install() {
152         emake install install-etc install-doc install-dev DESTDIR="${D}" ||
153                 die "install failed"
154
155         keepdir /var/lib/bitlbee
156         fperms 700 /var/lib/bitlbee
157         fowners bitlbee:bitlbee /var/lib/bitlbee
158
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
164
165         doman doc/bitlbee.8 doc/bitlbee.conf.5
166
167         if use xinetd ; then
168                 insinto /etc/xinetd.d
169                 newins doc/bitlbee.xinetd bitlbee
170         fi
171
172         newinitd "${FILESDIR}"/bitlbee.initd bitlbee || die
173         newconfd "${FILESDIR}"/bitlbee.confd bitlbee || die
174
175         keepdir /var/run/bitlbee
176         fowners bitlbee:bitlbee /var/run/bitlbee
177
178         dodir /usr/share/bitlbee
179         insinto /usr/share/bitlbee
180         cd utils
181         doins convert_purple.py bitlbee-ctl.pl
182 }
183
184 pkg_postinst() {
185         chown -R bitlbee:bitlbee "${ROOT}"/var/lib/bitlbee
186         chown -R bitlbee:bitlbee "${ROOT}"/var/run/bitlbee
187
188         elog "The utils included in bitlbee are now located in /usr/share/bitlbee"
189         elog
190         elog "NOTE: The IRSSI script is no longer provided by BitlBee."
191         elog
192         elog "The bitlbeed init script has been replaced by bitlbee."
193         elog "You must update your configuration."
194 }