Gentoo Archives: gentoo-commits

From: Hans de Graaff <graaff@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: net-irc/rbot/, net-irc/rbot/files/
Date: Sun, 28 Aug 2016 06:34:02
Message-Id: 1472365090.c3ba47fc9c1ad63b2bd674684b4a392fccd86c75.graaff@gentoo
1 commit: c3ba47fc9c1ad63b2bd674684b4a392fccd86c75
2 Author: Hans de Graaff <graaff <AT> gentoo <DOT> org>
3 AuthorDate: Sun Aug 28 06:18:10 2016 +0000
4 Commit: Hans de Graaff <graaff <AT> gentoo <DOT> org>
5 CommitDate: Sun Aug 28 06:18:10 2016 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c3ba47fc
7
8 net-irc/rbot: add new upstream snapshot
9
10 Package-Manager: portage-2.2.28
11
12 net-irc/rbot/Manifest | 1 +
13 net-irc/rbot/files/rbot-rakefile-gettext.patch | 13 ++
14 net-irc/rbot/rbot-0.9.15_p20160325.ebuild | 190 +++++++++++++++++++++++++
15 3 files changed, 204 insertions(+)
16
17 diff --git a/net-irc/rbot/Manifest b/net-irc/rbot/Manifest
18 index c65965d..10d848f 100644
19 --- a/net-irc/rbot/Manifest
20 +++ b/net-irc/rbot/Manifest
21 @@ -1 +1,2 @@
22 DIST rbot-0.9.15_p20131020.tar.gz 773953 SHA256 74b4db6a2b24784a1779518cd070bbf8cb6d4a5059167579d8226a0fc69cef15 SHA512 3319031361f7ab23e43a997a94663790775047c50eb8eb51f3f579cf879ca822b48118060fdd9f2816d5d97c57de8f6fb7ce883457336f961ff25cf6c49a8d2a WHIRLPOOL 8e77fdeb290dae0c4932628e010768217df223e94a5ec902ed48e9db3a2c2985ef2df932e84048ab8721b8d4bb954852397974afa02f1bdfc1e1b8533b58d812
23 +DIST rbot-0.9.15_p20160325.tar.gz 762685 SHA256 ae638f53607ad0f1d365ff3c4408ef3c27c8e0f5e83ae355742185c1076ec96e SHA512 b0bc90ee2c6ddb3cdd92cdd5f3a45520d20bc97327b3d694235f7ba94f13ef3c884d4658b083f71bfee2cbeff3cbc7a57c251c4d28bfee293e2556f64e7b4160 WHIRLPOOL e2fbeb41c065ea8642bff49ffade38992c6ab7ccee107d1e140c1810daed869e6e378ac59f7453eeacf8f24e3a980dcb5b911f706475c6f2457a61e3b0483902
24
25 diff --git a/net-irc/rbot/files/rbot-rakefile-gettext.patch b/net-irc/rbot/files/rbot-rakefile-gettext.patch
26 new file mode 100644
27 index 00000000..4fc3735
28 --- /dev/null
29 +++ b/net-irc/rbot/files/rbot-rakefile-gettext.patch
30 @@ -0,0 +1,13 @@
31 +--- Rakefile.old 2013-08-20 01:00:05.000000000 +0200
32 ++++ Rakefile 2013-10-21 19:42:06.800019343 +0200
33 +@@ -125,8 +126,8 @@
34 + }) do |t|
35 + po_file, mo_file = t.source, t.name
36 + puts "#{po_file} => #{mo_file}"
37 +- require 'gettext/utils'
38 +- GetText.rmsgfmt po_file, mo_file
39 ++ require 'gettext/tools'
40 ++ GetText::Tools::MsgFmt.run po_file, mo_file
41 + end
42 +
43 + task :check_po_tools do
44
45 diff --git a/net-irc/rbot/rbot-0.9.15_p20160325.ebuild b/net-irc/rbot/rbot-0.9.15_p20160325.ebuild
46 new file mode 100644
47 index 00000000..e458c90
48 --- /dev/null
49 +++ b/net-irc/rbot/rbot-0.9.15_p20160325.ebuild
50 @@ -0,0 +1,190 @@
51 +# Copyright 1999-2016 Gentoo Foundation
52 +# Distributed under the terms of the GNU General Public License v2
53 +# $Id$
54 +
55 +EAPI=5
56 +USE_RUBY="ruby20 ruby21 ruby22"
57 +
58 +GITHUB_COMMIT="e358601cc521d8aced941eb928fae2d8c53cf0c2"
59 +inherit ruby-ng eutils user
60 +
61 +DESCRIPTION="A ruby IRC bot"
62 +HOMEPAGE="http://ruby-rbot.org/"
63 +SRC_URI="https://github.com/ruby-rbot/rbot/archive/${GITHUB_COMMIT}.tar.gz -> ${P}.tar.gz"
64 +
65 +LICENSE="|| ( feh GPL-2 )"
66 +SLOT="0"
67 +KEYWORDS="~amd64 ~ppc ~x86"
68 +IUSE="spell aspell timezone translator shorturl nls figlet
69 + fortune cal host toilet"
70 +ILINGUAS="zh_CN zh_TW ru nl de fi fr it ja"
71 +RUBY_S="${PN}-${GITHUB_COMMIT}"
72 +
73 +for lang in $ILINGUAS; do
74 + IUSE="${IUSE} linguas_${lang}"
75 +done
76 +
77 +RUBY_PATCHES=( rbot-rakefile-gettext.patch )
78 +
79 +RDEPEND+="
80 + spell? (
81 + aspell? ( app-text/aspell )
82 + !aspell? ( app-text/hunspell )
83 + )
84 + figlet? ( app-misc/figlet )
85 + toilet? ( app-misc/toilet )
86 + fortune? ( games-misc/fortune-mod )
87 + cal? ( || ( sys-apps/util-linux sys-freebsd/freebsd-ubin ) )
88 + host? ( net-dns/bind-tools )"
89 +
90 +ruby_add_bdepend "
91 + nls? (
92 + >=dev-ruby/ruby-gettext-2
93 + dev-ruby/rake
94 + )"
95 +
96 +ruby_add_rdepend "
97 + dev-ruby/tokyocabinet
98 + timezone? ( dev-ruby/tzinfo:* )
99 + translator? ( dev-ruby/mechanize )
100 + shorturl? ( dev-ruby/shorturl )
101 + nls? ( dev-ruby/ruby-gettext >=dev-ruby/locale-2.0.5-r2 )
102 +"
103 +
104 +pkg_setup() {
105 + enewuser rbot -1 -1 /var/lib/rbot nobody
106 +}
107 +
108 +all_ruby_prepare() {
109 + # Avoid tests that are only compatible with ruby22
110 + rm -f test/test_journal.rb || die
111 +
112 + # Fix deprecated code that was removed with ruby22
113 + sed -i -e 's/::Config/::RbConfig/' setup.rb || die
114 +}
115 +
116 +all_ruby_compile() {
117 + disable_rbot_plugin() {
118 + mv "${S}"/data/rbot/plugins/$1.rb{,.disabled}
119 + }
120 + use_rbot_plugin() {
121 + use $1 && return
122 + disable_rbot_plugin "$2"
123 + }
124 + rbot_conf() {
125 + echo "$1: $2" >> "${T}"/rbot.conf
126 + }
127 + use_rbot_conf_path() {
128 + use "$1" \
129 + && rbot_conf "$2" "$3" \
130 + || rbot_conf "$2" /bin/false
131 + }
132 +
133 + local spell_program="/usr/bin/hunspell -i"
134 + if use !spell; then
135 + disable_rbot_plugin spell
136 + spell_program="/bin/false"
137 + elif use aspell; then
138 + spell_program="/usr/bin/ispell-aspell"
139 + fi
140 +
141 + rbot_conf spell.program "${spell_program}"
142 +
143 + if use !figlet && use !toilet; then
144 + disable_rbot_plugin figlet
145 + fi
146 +
147 + use_rbot_conf_path figlet figlet.path /usr/bin/figlet
148 + use_rbot_conf_path toilet toilet.path /usr/bin/toilet
149 +
150 + use_rbot_plugin timezone time
151 + use_rbot_plugin translator translator
152 + use_rbot_plugin shorturl shortenurls
153 +
154 + use_rbot_plugin fortune fortune
155 + use_rbot_conf_path fortune fortune.path /usr/bin/fortune
156 +
157 + use_rbot_plugin cal cal
158 + use_rbot_conf_path cal cal.path /usr/bin/cal
159 +
160 + use_rbot_plugin host host
161 + use_rbot_conf_path host host.path /usr/bin/host
162 +
163 + local rbot_datadir="${D}"/usr/share/rbot
164 +
165 + # This is unfortunately pretty manual at the moment, but it's just
166 + # to avoid having to run special scripts to package new versions
167 + # of rbot. The default if new languages are added that are not
168 + # considered for an opt-out here is to install them, so you just
169 + # need to add them later.
170 + if use nls; then
171 + strip-linguas ${ILINGUAS}
172 + if [[ -n ${LINGUAS} ]]; then
173 + # As the the language name used by the rbot data files does
174 + # not correspond to the ISO codes we usually use for LINGUAS,
175 + # the following list of local varables will work as a
176 + # dictionary to get the name used by rbot from the ISO code.
177 + local lang_rbot_zh_CN="traditional_chinese"
178 + local lang_rbot_ru="russian"
179 + local lang_rbot_nl="dutch"
180 + local lang_rbot_de="german"
181 + local lang_rbot_fi="finnish"
182 + local lang_rbot_fr="french"
183 + local lang_rbot_it="italian"
184 + local lang_rbot_ja="japanese"
185 +
186 + for lang in ${ILINGUAS}; do
187 + use linguas_${lang} && continue
188 +
189 + lang_varname="lang_rbot_${lang}"
190 + lang_rbot=${!lang_varname}
191 +
192 + rm -r \
193 + "${S}"/data/rbot/languages/${lang_rbot}.lang \
194 + "${S}"/data/rbot/templates/lart/larts-${lang_rbot} \
195 + "${S}"/data/rbot/templates/lart/praises-${lang_rbot} \
196 + "${S}"/data/rbot/templates/salut/salut-${lang_rbot} \
197 + "${S}"/po/${lang} &>/dev/null
198 + done
199 + fi
200 +
201 + ${RUBY} /usr/bin/rake makemo || die "locale generation failed"
202 + fi
203 +}
204 +
205 +each_ruby_compile() {
206 + ${RUBY} setup.rb config --prefix="/usr" \
207 + || die "setup.rb install failed"
208 +}
209 +
210 +each_ruby_test() {
211 + pushd test || die
212 + ${RUBY} -Ilib:. -e "Dir['test_*'].each{|f| require f}" || die
213 + popd || die
214 +}
215 +
216 +each_ruby_install() {
217 + ${RUBY} setup.rb install --prefix="${D}" \
218 + || die "setup.rb install failed"
219 +}
220 +
221 +all_ruby_install() {
222 + diropts -o rbot -g nobody -m 0700
223 + keepdir /var/lib/rbot
224 +
225 + insinto /etc
226 + doins "${T}"/rbot.conf
227 +
228 + newinitd "${FILESDIR}/rbot.init2" rbot
229 + newconfd "${FILESDIR}/rbot.conf2" rbot
230 +}
231 +
232 +pkg_postinst() {
233 + elog "rbot can be started as a normal service."
234 + elog "Check /etc/conf.d/rbot file for more information about this feature."
235 + ewarn "DEPRECATION NOTICE:"
236 + ewarn "The bdb database backend is deprecated and only available on Ruby 1.8."
237 + ewarn "To migrate to the new tokyocabinet-based backend, change the core.db"
238 + ewarn "parameter in your bot's conf.yaml to 'tc' and restart rbot."
239 + ewarn "This procedure requires a Ruby version supporting both BDB and TC."
240 +}