1 # Copyright 1999-2009 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
6 ESVN_REPO_URI="http://toxygen.net/svn/ekg2/trunk"
8 inherit multilib perl-module subversion
10 DESCRIPTION="Text-based, multi-protocol instant messenger"
11 HOMEPAGE="http://www.ekg2.org"
16 IUSE="dbus extra gadu gif gnutls gpg gpm gsm gtk icq idn inotify irc
17 jabber jogger jpeg mail minimal ncurses nls nntp oracle oss pcap
18 perl python readline remote rss ruby sim sms spell
19 sqlite sqlite3 srv ssl static unicode web xosd zlib"
21 # -- non-obvious plugin mappings --
22 # extra -> autoresponder, polchat, rivchat, rot13, xmsg
23 # !minimal -> ioctld, logs, rc
28 dbus? ( sys-apps/dbus )
29 gpg? ( app-crypt/gpgme )
30 gsm? ( media-sound/gsm )
31 gtk? ( x11-libs/gtk+:2 )
32 idn? ( net-dns/libidn )
33 nls? ( virtual/libintl )
34 oracle? ( dev-db/oracle-instantclient-basic )
35 pcap? ( net-libs/libpcap )
36 perl? ( dev-lang/perl )
37 python? ( dev-lang/python )
38 readline? ( sys-libs/readline )
39 rss? ( dev-libs/expat )
40 ruby? ( dev-lang/ruby )
41 sim? ( dev-libs/openssl )
42 xosd? ( x11-libs/xosd )
43 gadu? ( net-libs/libgadu
44 gif? ( media-libs/giflib )
45 jpeg? ( media-libs/jpeg ) )
46 jabber? ( dev-libs/expat
47 gnutls? ( net-libs/gnutls )
48 !gnutls? ( ssl? ( dev-libs/openssl ) )
49 zlib? ( sys-libs/zlib ) )
51 zlib? ( sys-libs/zlib ) )
52 ncurses? ( sys-libs/ncurses[unicode?]
54 spell? ( app-text/aspell ) )
55 sqlite3? ( dev-db/sqlite:3 )
56 !sqlite3? ( sqlite? ( dev-db/sqlite:0 ) )"
58 DEPEND="dev-util/scons
59 nls? ( sys-devel/gettext )
63 if ! use gtk && ! use ncurses && ! use readline && ! use remote && ! use web; then
64 ewarn 'ekg2 is being compiled without any frontend, you should consider'
65 ewarn 'enabling at least one of following USEflags:'
66 ewarn ' gtk, ncurses, readline, remote, web.'
71 use $1 && echo -n ,${2:-$1}
74 # Build comma-separated plugin list based on USE
75 # We can put the same plugin few times if it's referenced by more than one flag
80 $(use_plug extra autoresponder,polchat,rivchat,rot13,xmsg) \
87 $(use_plug jabber jabber) \
88 $(use_plug jogger jogger) \
90 $(use_plug !minimal ioctld,logs,rc) \
92 $(use_plug nntp feed) \
93 $(use_plug oracle logsoracle) \
94 $(use_plug oss oss,pcm) \
95 $(use_plug pcap sniff) \
98 $(use_plug readline) \
100 $(use_plug rss feed) \
104 $(use_plug sqlite logsqlite) \
105 $(use_plug sqlite3 logsqlite) \
106 $(use_plug web httprc_xajax) \
108 | tr -d '[[:space:]]'
111 # create DEPS list for plugin
112 # + means dep forced (fail if unavailable, prioritize over other one-of)
113 # - means dep disabled (don't even check for it)
114 # use:opt maps USEflag to specified opt
115 # usea|useb|usec makes one-of opt
118 local spls spll flag fopt out
123 # loop over different opts
124 while [ -n "$1" ]; do
127 # loop over one-of opts
129 # get next one-of, make sure spls gets empty if last
131 spls=${spls:$(( ${#spll} + 1 ))}
132 # parse use:opt, if no :opt specified fopt=flag
136 # if one of one-of opt matches, we output only it
137 # else we need to output all of them disabled
138 use ${flag} && out=+ || out=${out}-
141 # got more one-of opts? parse them only if this didn't match
142 if [ -n "${spls}" ] && ! use ${flag}; then
149 [ -n "$1" ] && echo -n ,
155 # create all DEPS lists
157 build_addopts_list() {
158 use extra && make_deps XMSG inotify
159 use gadu && make_deps GG gif jpeg
160 use jabber && make_deps JABBER zlib 'gnutls|ssl:openssl'
161 use mail && make_deps MAIL inotify
162 use !minimal && make_deps LOGS zlib
163 use ncurses && make_deps NCURSES gpm spell:aspell
164 use rss || use nntp && make_deps FEED rss:expat
165 use sqlite3 || use sqlite && make_deps LOGSQLITE 'sqlite3|sqlite'
168 # SCons doesn't build perl modules, perl-module.eclass does it better
170 foreach_perl_module() {
172 cd plugins/perl || die 'cd plugins/perl failed'
174 cd "${DIR}" || die "cd ${DIR} (perl module) failed"
178 # workaround perl-module.eclass
186 echo -n "${2:-$1}=" | tr 'a-z' 'A-Z'
187 use $1 && echo -n '1' || echo -n '0'
191 # HARDDEPS -> build should fail if some dep is unsatisfied
192 # DISTNOTES -> are displayed with /version, helpful for upstream bug reports
194 scons PLUGINS=$(build_plugin_list) $(build_addopts_list) \
195 HARDDEPS=1 SKIPCHECKS=1 $(use_var unicode) $(use_var nls) \
196 $(use_var static) $(use_var idn) $(use_var srv RESOLV) \
197 PREFIX=/usr LIBDIR="\$EPREFIX/$(get_libdir)" \
198 DOCDIR="\$DATAROOTDIR/doc/${PF}" \
199 DISTNOTES="emdzientoo ebuild ${PVR}, USE=${USE}" \
200 ${MAKEOPTS} conf || die "scons conf failed"
202 foreach_perl_module perl-module_src_configure
206 # SKIPCONF -> no need to reconfigure
208 scons SKIPCONF=1 ${MAKEOPTS} || die "scons failed"
210 foreach_perl_module perl-module_src_compile
214 foreach_perl_module perl-module_src_test
218 scons DESTDIR="${D}" ${MAKEOPTS} install || die "scons install failed"
220 foreach_perl_module perl-module_src_install
222 use perl && fixlocalpod
227 elog "EKG2 is still considered very experimental. Please do report all issues"
228 elog "to mailing list ekg2-users@lists.ziew.org (you can write in English)."
229 elog "Please do not file bugs to Gentoo Bugzilla."
231 elog "Before reporting a bug, please check if it's reproducible and get"
232 elog "complete backtrace of it. Even if you can't reproduce it, you may let us"
233 elog "know that something like that happened."
235 elog "How to get backtraces:"
236 elog " http://www.gentoo.org/proj/en/qa/backtraces.xml"
238 elog "Thank you and have fun."