/[gentoo-x86]/net-irc/rbot/rbot-0.9.11_rc2.ebuild
Gentoo

Contents of /net-irc/rbot/rbot-0.9.11_rc2.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.4 - (show annotations) (download)
Sat Nov 7 20:22:24 2009 UTC (8 years, 10 months ago) by a3li
Branch: MAIN
CVS Tags: HEAD
Changes since 1.3: +1 -1 lines
FILE REMOVED
Taking over maintenance; restrict ruby-gettext dependency to the 1.x versions, bug 292297; remove old version
(Portage version: 2.2_rc48/cvs/Linux x86_64)

1 # Copyright 1999-2008 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/net-irc/rbot/rbot-0.9.11_rc2.ebuild,v 1.3 2008/07/25 07:27:42 wormo Exp $
4
5 inherit ruby eutils
6
7 [[ ${PV} == *"9999" ]] && inherit git
8
9 DESCRIPTION="rbot is a ruby IRC bot"
10 HOMEPAGE="http://ruby-rbot.org/"
11
12 LICENSE="GPL-2 as-is"
13 SLOT="0"
14 KEYWORDS="~amd64 ~ppc ~sparc ~x86 ~x86-fbsd"
15 IUSE="spell aspell timezone translator shorturl nls dict figlet
16 fortune cal host toilet hunspell"
17 ILINGUAS="zh_CN zh_TW ru nl de fr it ja"
18
19 for lang in $ILINGUAS; do
20 IUSE="${IUSE} linguas_${lang}"
21 done
22
23 RDEPEND=">=virtual/ruby-1.8
24 dev-ruby/ruby-bdb
25 timezone? ( dev-ruby/tzinfo )
26 spell? (
27 aspell? ( app-text/aspell )
28 !aspell? (
29 hunspell? ( app-text/hunspell )
30 !hunspell? ( app-text/ispell )
31 )
32 )
33 translator? ( dev-ruby/mechanize )
34 shorturl? ( dev-ruby/shorturl )
35 nls? ( dev-ruby/ruby-gettext )
36 dict? ( dev-ruby/ruby-dict )
37 figlet? ( app-misc/figlet )
38 toilet? ( app-misc/toilet )
39 fortune? ( games-misc/fortune-mod )
40 cal? ( || ( sys-apps/util-linux sys-freebsd/freebsd-ubin ) )
41 host? ( net-dns/bind-tools )"
42 DEPEND="
43 nls? (
44 dev-ruby/ruby-gettext
45 dev-ruby/rake
46 )"
47
48 if [[ ${PV} == *"9999" ]]; then
49 SRC_URI=""
50 EGIT_REPO_URI="git://ruby-rbot.org/rbot.git"
51 else
52 MY_P="${P/_/-}"
53 S="${WORKDIR}/${P%_*}"
54 SRC_URI="http://ruby-rbot.org/download/${MY_P}.tgz"
55 fi
56
57 pkg_setup() {
58 enewuser rbot -1 -1 /var/lib/rbot nobody
59 }
60
61 src_unpack() {
62 if [[ ${PV} == *"9999" ]]; then
63 git_src_unpack
64
65 cd "${S}"
66 sed -i -e '/\$version=/s:".\+":"'${PV}'":' bin/rbot \
67 || die "Unable to fix rbot script version."
68 else
69 unpack ${A}
70 fi
71 }
72
73 src_compile() {
74 disable_rbot_plugin() {
75 mv "${S}"/data/rbot/plugins/$1.rb{,.disabled}
76 }
77 use_rbot_plugin() {
78 use $1 && return
79 disable_rbot_plugin "$2"
80 }
81 rbot_conf() {
82 echo "$1: $2" >> "${T}"/rbot.conf
83 }
84 use_rbot_conf_path() {
85 use "$1" \
86 && rbot_conf "$2" "$3" \
87 || rbot_conf "$2" /bin/false
88 }
89
90 local spell_program="/usr/bin/ispell"
91 if use !spell; then
92 disable_rbot_plugin spell
93 spell_program="/bin/false"
94 elif use aspell; then
95 spell_program="/usr/bin/ispell-aspell"
96 elif use hunspell; then
97 spell_program="/usr/bin/hunspell -i"
98 fi
99
100 rbot_conf spell.program "${spell_program}"
101
102 if use !figlet && use !toilet; then
103 disable_rbot_plugin figlet
104 fi
105
106 use_rbot_conf_path figlet figlet.path /usr/bin/figlet
107 use_rbot_conf_path toilet toilet.path /usr/bin/toilet
108
109 use_rbot_plugin timezone time
110 use_rbot_plugin translator translator
111 use_rbot_plugin shorturl shortenurls
112 use_rbot_plugin dict dictclient
113
114 use_rbot_plugin fortune fortune
115 use_rbot_conf_path fortune fortune.path /usr/bin/fortune
116
117 use_rbot_plugin cal cal
118 use_rbot_conf_path cal cal.path /usr/bin/cal
119
120 use_rbot_plugin host host
121 use_rbot_conf_path host host.path /usr/bin/host
122
123 local rbot_datadir="${D}"/usr/share/rbot
124
125 # This is unfortunately pretty manual at the moment, but it's just
126 # to avoid having to run special scripts to package new versions
127 # of rbot. The default if new languages are added that are not
128 # considered for an opt-out here is to install them, so you just
129 # need to add them later.
130 if use nls; then
131 strip-linguas ${ILINGUAS}
132 if [[ -n ${LINGUAS} ]]; then
133 # As the the language name used by the rbot data files does
134 # not correspond to the ISO codes we usually use for LINGUAS,
135 # the following list of local varables will work as a
136 # dictionary to get the name used by rbot from the ISO code.
137 local lang_rbot_zh_CN="traditional_chinese"
138 local lang_rbot_ru="russian"
139 local lang_rbot_nl="dutch"
140 local lang_rbot_de="german"
141 local lang_rbot_fr="french"
142 local lang_rbot_it="italian"
143 local lang_rbot_ja="japanese"
144
145 for lang in ${ILINGUAS}; do
146 use linguas_${lang} && continue
147
148 lang_varname="lang_rbot_${lang}"
149 lang_rbot=${!lang_varname}
150
151 rm -r \
152 "${S}"/data/rbot/languages/${lang_rbot}.lang \
153 "${S}"/data/rbot/templates/lart/larts-${lang_rbot} \
154 "${S}"/data/rbot/templates/lart/praises-${lang_rbot} \
155 "${S}"/data/rbot/templates/salut/salut-${lang_rbot} \
156 "${S}"/po/${lang}
157 done
158 fi
159
160 rake makemo || die "locale generation failed"
161 fi
162
163 ruby_econf || die "ruby_econf failed"
164 }
165
166 src_install() {
167 ${RUBY} setup.rb install --prefix="${D}" \
168 || die "setup.rb install failed"
169
170 diropts -o rbot -g nobody -m 0700
171 keepdir /var/lib/rbot
172
173 insinto /etc
174 doins "${T}"/rbot.conf
175
176 newinitd "${FILESDIR}/rbot.init" rbot
177 newconfd "${FILESDIR}/rbot.conf" rbot
178 }
179
180 pkg_postinst() {
181 einfo
182 elog "rbot now can be started as a normal service."
183 elog "Check /etc/conf.d/rbot file for more information about this feature."
184 einfo
185 }

  ViewVC Help
Powered by ViewVC 1.1.20