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