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
62 if ! use gtk && ! use ncurses && ! use readline && ! use remote && ! use web; then
63 ewarn 'ekg2 is being compiled without any frontend, you should consider'
64 ewarn 'enabling at least one of following USEflags:'
65 ewarn ' gtk, ncurses, readline, remote, web.'
70 use $1 && echo -n ,${2:-$1}
73 # Build comma-separated plugin list based on USE
74 # We can put the same plugin few times if it's referenced by more than one flag
79 $(use_plug extra autoresponder,polchat,rivchat,rot13,xmsg) \
86 $(use_plug jabber jabber) \
87 $(use_plug jogger jogger) \
89 $(use_plug !minimal ioctld,logs,rc) \
91 $(use_plug nntp feed) \
92 $(use_plug oracle logsoracle) \
93 $(use_plug oss oss,pcm) \
94 $(use_plug pcap sniff) \
97 $(use_plug readline) \
99 $(use_plug rss feed) \
103 $(use_plug sqlite logsqlite) \
104 $(use_plug sqlite3 logsqlite) \
105 $(use_plug web httprc_xajax) \
107 | tr -d '[[:space:]]'
110 # create DEPS list for plugin
111 # + means dep forced (fail if unavailable, prioritize over other one-of)
112 # - means dep disabled (don't even check for it)
113 # use:opt maps USEflag to specified opt
114 # usea|useb|usec makes one-of opt
117 local spls spll flag fopt out
122 # loop over different opts
123 while [ -n "$1" ]; do
126 # loop over one-of opts
128 # get next one-of, make sure spls gets empty if last
130 spls=${spls:$(( ${#spll} + 1 ))}
131 # parse use:opt, if no :opt specified fopt=flag
135 # if one of one-of opt matches, we output only it
136 # else we need to output all of them disabled
137 use ${flag} && out=+ || out=${out}-
140 # got more one-of opts? parse them only if this didn't match
141 if [ -n "${spls}" ] && ! use ${flag}; then
148 [ -n "$1" ] && echo -n ,
154 # create all DEPS lists
156 build_addopts_list() {
157 use extra && make_deps XMSG inotify
158 use gadu && make_deps GG gif jpeg
159 use jabber && make_deps JABBER zlib 'gnutls|ssl:openssl'
160 use mail && make_deps MAIL inotify
161 use !minimal && make_deps LOGS zlib
162 use ncurses && make_deps NCURSES gpm spell:aspell
163 use rss || use nntp && make_deps FEED rss:expat
164 use sqlite3 || use sqlite && make_deps LOGSQLITE 'sqlite3|sqlite'
167 # SCons doesn't build perl modules, perl-module.eclass does it better
169 foreach_perl_module() {
171 cd plugins/perl || die 'cd plugins/perl failed'
173 cd "${DIR}" || die "cd ${DIR} (perl module) failed"
177 # workaround perl-module.eclass
185 echo -n "${2:-$1}=" | tr 'a-z' 'A-Z'
186 use $1 && echo -n '1' || echo -n '0'
190 # HARDDEPS -> build should fail if some dep is unsatisfied
191 # DISTNOTES -> are displayed with /version, helpful for upstream bug reports
193 scons PLUGINS=$(build_plugin_list) $(build_addopts_list) \
194 HARDDEPS=1 $(use_var unicode) $(use_var nls) \
195 $(use_var static) $(use_var idn) $(use_var srv RESOLV) \
196 PREFIX=/usr LIBDIR="\$EPREFIX/$(get_libdir)" \
197 DOCDIR="\$DATAROOTDIR/doc/${PF}" \
198 DISTNOTES="emdzientoo ebuild ${PVR}, USE=${USE}" \
199 ${MAKEOPTS} conf || die "scons conf failed"
201 foreach_perl_module perl-module_src_configure
205 # SKIPCONF -> no need to reconfigure
207 scons SKIPCONF=1 ${MAKEOPTS} || die "scons failed"
209 foreach_perl_module perl-module_src_compile
213 foreach_perl_module perl-module_src_test
217 scons DESTDIR="${D}" ${MAKEOPTS} install || die "scons install failed"
219 foreach_perl_module perl-module_src_install
221 use perl && fixlocalpod
226 elog "EKG2 is still considered very experimental. Please do report all issues"
227 elog "to mailing list ekg2-users@lists.ziew.org (you can write in English)."
228 elog "Please do not file bugs to Gentoo Bugzilla."
230 elog "Before reporting a bug, please check if it's reproducible and get"
231 elog "complete backtrace of it. Even if you can't reproduce it, you may let us"
232 elog "know that something like that happened."
234 elog "How to get backtraces:"
235 elog " http://www.gentoo.org/proj/en/qa/backtraces.xml"
237 elog "Thank you and have fun."