Gentoo Archives: gentoo-commits

From: "Diego Petteno (flameeyes)" <flameeyes@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in net-irc/rbot: ChangeLog metadata.xml rbot-9999-r7.ebuild rbot-9999-r6.ebuild
Date: Thu, 27 Dec 2007 13:46:15
Message-Id: E1J7t3l-0007AG-He@stork.gentoo.org
1 flameeyes 07/12/27 13:46:05
2
3 Modified: ChangeLog metadata.xml
4 Added: rbot-9999-r7.ebuild
5 Removed: rbot-9999-r6.ebuild
6 Log:
7 Always depend on ruby-gettext when building the gem, so that the data is properly added to the gem. Add a dict USE flag for the dictclient plugin, depending on the new ruby-dict ebuild.
8 (Portage version: 2.1.4_rc11)
9
10 Revision Changes Path
11 1.26 net-irc/rbot/ChangeLog
12
13 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-irc/rbot/ChangeLog?rev=1.26&view=markup
14 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-irc/rbot/ChangeLog?rev=1.26&content-type=text/plain
15 diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-irc/rbot/ChangeLog?r1=1.25&r2=1.26
16
17 Index: ChangeLog
18 ===================================================================
19 RCS file: /var/cvsroot/gentoo-x86/net-irc/rbot/ChangeLog,v
20 retrieving revision 1.25
21 retrieving revision 1.26
22 diff -u -r1.25 -r1.26
23 --- ChangeLog 26 Dec 2007 20:25:18 -0000 1.25
24 +++ ChangeLog 27 Dec 2007 13:46:04 -0000 1.26
25 @@ -1,6 +1,14 @@
26 # ChangeLog for net-irc/rbot
27 # Copyright 2000-2007 Gentoo Foundation; Distributed under the GPL v2
28 -# $Header: /var/cvsroot/gentoo-x86/net-irc/rbot/ChangeLog,v 1.25 2007/12/26 20:25:18 flameeyes Exp $
29 +# $Header: /var/cvsroot/gentoo-x86/net-irc/rbot/ChangeLog,v 1.26 2007/12/27 13:46:04 flameeyes Exp $
30 +
31 +*rbot-9999-r7 (27 Dec 2007)
32 +
33 + 27 Dec 2007; Diego Pettenò <flameeyes@g.o> metadata.xml,
34 + -rbot-9999-r6.ebuild, +rbot-9999-r7.ebuild:
35 + Always depend on ruby-gettext when building the gem, so that the data is
36 + properly added to the gem. Add a dict USE flag for the dictclient plugin,
37 + depending on the new ruby-dict ebuild.
38
39 *rbot-9999-r6 (26 Dec 2007)
40
41
42
43
44 1.7 net-irc/rbot/metadata.xml
45
46 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-irc/rbot/metadata.xml?rev=1.7&view=markup
47 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-irc/rbot/metadata.xml?rev=1.7&content-type=text/plain
48 diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-irc/rbot/metadata.xml?r1=1.6&r2=1.7
49
50 Index: metadata.xml
51 ===================================================================
52 RCS file: /var/cvsroot/gentoo-x86/net-irc/rbot/metadata.xml,v
53 retrieving revision 1.6
54 retrieving revision 1.7
55 diff -u -r1.6 -r1.7
56 --- metadata.xml 17 Dec 2007 22:13:09 -0000 1.6
57 +++ metadata.xml 27 Dec 2007 13:46:04 -0000 1.7
58 @@ -31,5 +31,14 @@
59 to enable the "shortenurl" plugin for rbot. If the USE flag is
60 disabled the plugin is also disabled by default.
61 </flag>
62 + <flag name="nls">
63 + Add dependency over <pkg>dev-ruby/ruby-gettext</pkg>, which is
64 + needed for the translation of the bot's messages to work.
65 + </flag>
66 + <flag name="dict">
67 + Add dependency over <pkg>dev-ruby/ruby-dict</pkg>, which is needed
68 + to enable the "dict" plugin for rbot. If the USE flag is disabled
69 + the plugin is also disabled by default.
70 + </flag>
71 </use>
72 </pkgmetadata>
73
74
75
76 1.1 net-irc/rbot/rbot-9999-r7.ebuild
77
78 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-irc/rbot/rbot-9999-r7.ebuild?rev=1.1&view=markup
79 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-irc/rbot/rbot-9999-r7.ebuild?rev=1.1&content-type=text/plain
80
81 Index: rbot-9999-r7.ebuild
82 ===================================================================
83 # Copyright 1999-2007 Gentoo Foundation
84 # Distributed under the terms of the GNU General Public License v2
85 # $Header: /var/cvsroot/gentoo-x86/net-irc/rbot/rbot-9999-r7.ebuild,v 1.1 2007/12/27 13:46:04 flameeyes Exp $
86
87 inherit ruby gems eutils
88
89 [[ ${PV} == "9999" ]] && inherit subversion
90
91 DESCRIPTION="rbot is a ruby IRC bot"
92 HOMEPAGE="http://www.linuxbrit.co.uk/rbot/"
93
94 LICENSE="as-is"
95 SLOT="0"
96 KEYWORDS=""
97 IUSE="spell aspell timezone translator shorturl nls dict"
98 ILINGUAS="zh ru nl de fr it en ja"
99
100 for lang in $ILINGUAS; do
101 IUSE="${IUSE} linguas_${lang}"
102 done
103
104 RDEPEND=">=virtual/ruby-1.8
105 dev-ruby/ruby-bdb
106 timezone? ( dev-ruby/tzinfo )
107 spell? (
108 aspell? ( app-text/aspell )
109 !aspell? ( app-text/ispell )
110 )
111 translator? ( dev-ruby/mechanize )
112 shorturl? ( dev-ruby/shorturl )
113 nls? ( dev-ruby/ruby-gettext )
114 dict? ( dev-ruby/ruby-dict )"
115 DEPEND=""
116
117 if [[ ${PV} == "9999" ]]; then
118 SRC_URI=""
119 ESVN_REPO_URI="svn://linuxbrit.co.uk/giblet/rbot/trunk"
120
121 DEPEND="${DEPEND}
122 dev-ruby/rake
123 app-arch/zip
124 dev-ruby/ruby-gettext"
125
126 IUSE="${IUSE} snapshot"
127 else
128 SRC_URI="http://www.linuxbrit.co.uk/downloads/${P}.gem"
129 fi
130
131 pkg_setup() {
132 enewuser rbot -1 -1 /var/lib/rbot nobody
133 }
134
135 svn_gem_version() {
136 use snapshot && \
137 echo 9998.${ESVN_WC_REVISION} || \
138 echo 9999
139 }
140
141 src_unpack() {
142 [[ ${PV} == "9999" ]] || return 0
143 subversion_src_unpack
144
145 cd "${S}"
146 sed -i -e "/s.version =/s:'.\+':'$(svn_gem_version)':" Rakefile \
147 || die "Unable to fix Rakefile version."
148 sed -i -e '/\$version=/s:".\+":"'$(svn_gem_version)'":' bin/rbot \
149 || die "Unable to fix rbot script version."
150 }
151
152 src_compile() {
153 [[ ${PV} == "9999" ]] || return 0
154 rake makemo || die "locale generation failed"
155 rake || die "Gem generation failed"
156 }
157
158 src_install() {
159 if [[ ${PV} == "9999" ]]; then
160 GEM_SRC="${S}/pkg/rbot-$(svn_gem_version).gem"
161 MY_P="${PN}-$(svn_gem_version)"
162 else
163 MY_P="${P}"
164 fi
165 gems_src_install
166
167 diropts -o rbot -g nobody -m 0700
168 keepdir /var/lib/rbot
169
170 newinitd "${FILESDIR}/rbot.init" rbot
171 newconfd "${FILESDIR}/rbot.conf" rbot
172
173 local rbot_datadir="${D}/${GEMSDIR}"/gems/${MY_P}/data/rbot
174
175 disable_rbot_plugin() {
176 mv "${rbot_datadir}"/plugins/$1.rb{,.disabled}
177 }
178
179 if ! use spell; then
180 disable_rbot_plugin spell || die "Unable to disable spell plugin"
181 elif use aspell; then
182 # This is not officially supported, but as ispell is quite a
183 # bad piece of code, at least give an opportunity to use
184 # something that works a bit better.
185 sed -i -e 's:ispell:ispell-aspell:' \
186 "${rbot_datadir}"/plugins/spell.rb \
187 || die "Unable to replace ispell with aspell."
188 fi
189
190 use translator || disable_rbot_plugin translator
191 use shorturl || disable_rbot_plugin shortenurls
192 use dict || disable_rbot_plugin dictclient
193
194 # This is unfortunately pretty manual at the moment, but it's just
195 # to avoid having to run special scripts to package new versions
196 # of rbot. The default if new languages are added that are not
197 # considered for an opt-out here is to install them, so you just
198 # need to add them later.
199 strip-linguas ${ILINGUAS}
200 if [[ -n ${LINGUAS} ]]; then
201 # As the the language name used by the rbot data files does
202 # not correspond to the ISO codes we usually use for LINGUAS,
203 # the following list of local varables will work as a
204 # dictionary to get the name used by rbot from the ISO code.
205 local lang_rbot_zh="traditional_chinese"
206 local lang_rbot_ru="russian"
207 local lang_rbot_nl="dutch"
208 local lang_rbot_de="german"
209 local lang_rbot_fr="french"
210 local lang_rbot_it="italian"
211 local lang_rbot_en="english"
212 local lang_rbot_ja="japanese"
213
214 for lang in ${ILINGUAS}; do
215 use linguas_${lang} && continue
216
217 lang="lang_rbot_${lang}"
218 lang_rbot=${!lang}
219
220 rm \
221 ${rbot_datadir}/languages/${lang_rbot}.lang \
222 ${rbot_datadir}/templates/lart/larts-${lang_rbot} \
223 ${rbot_datadir}/templates/lart/praises-${lang_rbot} \
224 ${rbot_datadir}/templates/salut/salut-${lang_rbot}
225 done
226 fi
227 }
228
229 pkg_postinst() {
230 einfo
231 elog "rbot now can be started as a normal service."
232 elog "Check /etc/conf.d/rbot file for more information about this feature."
233 einfo
234 }
235
236
237
238 --
239 gentoo-commits@g.o mailing list