]> Pileus Git - ~andy/sunrise/blob - net-im/ekg2-remote/ekg2-remote-99999999.ebuild
net-im/ekg2-remote: Live ebuild for EKG2 IM remote client (additional ebuild for...
[~andy/sunrise] / net-im / ekg2-remote / ekg2-remote-99999999.ebuild
1 # Copyright 1999-2009 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: $
4
5 EAPI="2"
6 ESVN_REPO_URI="http://toxygen.net/svn/ekg2/trunk"
7
8 inherit multilib subversion
9
10 DESCRIPTION="Remote UI client for EKG2 instant messenger"
11 HOMEPAGE="http://www.ekg2.org"
12 SRC_URI=""
13
14 LICENSE="GPL-2"
15 SLOT="0"
16 KEYWORDS=""
17 IUSE="gnutls gpm gtk ncurses readline spell ssl static unicode"
18
19 RDEPEND="
20         gtk?    ( >=x11-libs/gtk+-2.4 )
21         readline? ( sys-libs/readline )
22         gnutls? ( >=net-libs/gnutls-1.0.17 )
23         !gnutls? ( ssl? ( >=dev-libs/openssl-0.9.6m ) )
24
25         ncurses? ( sys-libs/ncurses[unicode?]
26                 gpm? ( >=sys-libs/gpm-1.20.1 )
27                 spell? ( >=app-text/aspell-0.50.5 ) )"
28
29 DEPEND=">=dev-util/scons-0.97
30         ${RDEPEND}"
31
32 pkg_setup() {
33         # ekg2-remote supports less frontends than ekg2 due to stripped down API
34
35         if ! use gtk && ! use ncurses && ! use readline; then
36                 ewarn 'ekg2-remote is being compiled without any frontend, you should consider'
37                 ewarn 'enabling either ncurses, readline or gtk USEflag.'
38         fi
39 }
40
41 use_plug() {
42         use $1 && echo -n ,${2:-$1}
43 }
44
45 # Build comma-separated plugin list based on USE
46
47 build_plugin_list() {
48         echo '@none' \
49         $(use_plug gtk) \
50         $(use_plug ncurses) \
51         $(use_plug readline) \
52                 | tr -d '[[:space:]]'
53 }
54
55 # create DEPS list for plugin
56 # + means dep forced (fail if unavailable)
57 # - means dep disabled (don't even check for it)
58 # use:opt maps USEflag to specified opt
59
60 make_deps() {
61         local flag fopt out
62
63         echo -n " $1_DEPS="
64         shift
65
66         # loop over different opts
67         while [ -n "$1" ]; do
68                 # parse use:opt, if no :opt specified fopt=flag
69                 flag=${1%:*}
70                 fopt=${1#*:}
71
72                 use ${flag} && out=+ || out=-
73                 echo -n ${out}${fopt}
74
75                 shift
76                 [ -n "$1" ] && echo -n ,
77         done
78 }
79
80 # REMOTE_SSL option
81
82 make_rssl() {
83         if use gnutls; then
84                 echo -n gnutls
85         elif use openssl; then
86                 echo -n openssl
87         else
88                 echo -n none
89         fi
90 }
91
92 use_var() {
93         echo -n $1= | tr a-z A-Z
94         use $1 && echo -n 1 || echo -n 0
95 }
96
97 src_configure() {
98         # HARDDEPS -> build should fail if some dep is unsatisfied
99         # DISTNOTES -> are displayed with /version, helpful for upstream bug reports
100
101         scons PLUGINS=$(build_plugin_list) REMOTE=only REMOTE_SSL=$(make_rssl) \
102                 $(use ncurses && make_deps NCURSES gpm spell:aspell) \
103                 HARDDEPS=1 $(use_var unicode) $(use_var static) \
104                 PREFIX=/usr LIBDIR="\$EPREFIX/$(get_libdir)" \
105                 PLUGINDIR='$LIBDIR/ekg2-remote/plugins' DOCDIR="\$DATAROOTDIR/doc/${PF}" \
106                 DISTNOTES="emdzientoo ebuild ${PVR}, USE=${USE}" \
107                 ${MAKEOPTS} conf || die "scons conf failed"
108 }
109
110 src_compile() {
111         # SKIPCONF -> no need to reconfigure
112
113         scons SKIPCONF=1 ${MAKEOPTS} || die "scons failed"
114 }
115
116 src_install() {
117         scons DESTDIR="${D}" ${MAKEOPTS} install || die "scons install failed"
118 }
119
120 pkg_postinst() {
121         elog "EKG2 is still considered very experimental. Please do report all issues"
122         elog "to mailing list ekg2-users@lists.ziew.org (you can write in English)."
123         elog "Please do not file bugs to Gentoo Bugzilla."
124         elog
125         elog "Before reporting a bug, please check if it's reproducible and get"
126         elog "complete backtrace of it. Even if you can't reproduce it, you may let us"
127         elog "know that something like that happened."
128         elog
129         elog "How to get backtraces:"
130         elog "  http://www.gentoo.org/proj/en/qa/backtraces.xml"
131         elog
132         elog "Thank you and have fun."
133 }