Gentoo Archives: gentoo-commits

From: Alessandro Barbieri <lssndrbarbieri@×××××.com>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/proj/guru:dev commit in: app-i18n/canna/, app-i18n/canna/files/
Date: Sun, 26 Jun 2022 02:36:42
Message-Id: 1656210584.3a19c07b162cb1de41d98cf9d3b523a6397180d5.Alessandro-Barbieri@gentoo
1 commit: 3a19c07b162cb1de41d98cf9d3b523a6397180d5
2 Author: Alessandro Barbieri <lssndrbarbieri <AT> gmail <DOT> com>
3 AuthorDate: Wed Jun 22 02:34:24 2022 +0000
4 Commit: Alessandro Barbieri <lssndrbarbieri <AT> gmail <DOT> com>
5 CommitDate: Sun Jun 26 02:29:44 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=3a19c07b
7
8 app-i18n/canna: new package, add 3.7_p3-r4
9
10 Signed-off-by: Alessandro Barbieri <lssndrbarbieri <AT> gmail.com>
11
12 app-i18n/canna/Manifest | 2 +
13 app-i18n/canna/canna-3.7_p3-r4.ebuild | 207 +++++++++++++++++++++
14 .../canna/files/Canna-3.6-dont-grab-ctrl-o.patch | 11 ++
15 app-i18n/canna/files/Canna-3.6-fix-warnings.patch | 10 +
16 app-i18n/canna/files/Canna-3.6-wconv.patch | 18 ++
17 .../files/Canna-3.7p1-fix-duplicated-strings.patch | 93 +++++++++
18 app-i18n/canna/files/Canna-3.7p1-notimeout.patch | 12 ++
19 .../canna/files/Canna-3.7p3-fix-gcc4-warning.patch | 136 ++++++++++++++
20 app-i18n/canna/files/Canna-3.7p3-redecl.patch | 11 ++
21 app-i18n/canna/files/Canna-3.7p3-yenbs.patch | 11 ++
22 app-i18n/canna/files/Canna-oldsock.patch | 29 +++
23 .../canna/files/canna-05_fix_spelling_error.patch | 63 +++++++
24 .../canna/files/canna-06_fix_manpages_error.patch | 37 ++++
25 .../files/canna-07_fix_ftbfs_on_hurd-i386.patch | 16 ++
26 .../canna/files/canna-10_fix_configure.ac.patch | 19 ++
27 .../canna-11_fix_spelling_error_in_binary.patch | 91 +++++++++
28 ..._make_the_output_of_mkbindic_reproducible.patch | 61 ++++++
29 app-i18n/canna/files/canna-Wformat-security.patch | 199 ++++++++++++++++++++
30 app-i18n/canna/files/canna-Wformat.patch | 11 ++
31 app-i18n/canna/files/canna-canuum.patch | 34 ++++
32 app-i18n/canna/files/canna-gentoo.patch | 146 +++++++++++++++
33 app-i18n/canna/files/canna-kpdef.patch | 18 ++
34 app-i18n/canna/files/canna-overflow.patch | 20 ++
35 app-i18n/canna/files/canna-posix-sort.patch | 11 ++
36 app-i18n/canna/files/canna-respect-flags.patch | 29 +++
37 app-i18n/canna/files/canna-rundir.patch | 15 ++
38 app-i18n/canna/files/canna-tmpfiles.conf | 2 +
39 app-i18n/canna/files/canna.confd | 7 +
40 app-i18n/canna/files/canna.hosts | 1 +
41 app-i18n/canna/files/canna.initd | 31 +++
42 app-i18n/canna/files/canna.service | 12 ++
43 app-i18n/canna/files/cannaping.c | 46 +++++
44 app-i18n/canna/files/dot-canna | 195 +++++++++++++++++++
45 app-i18n/canna/files/update-canna-dics_dir | 36 ++++
46 app-i18n/canna/metadata.xml | 12 ++
47 35 files changed, 1652 insertions(+)
48
49 diff --git a/app-i18n/canna/Manifest b/app-i18n/canna/Manifest
50 new file mode 100644
51 index 000000000..56de9dcb2
52 --- /dev/null
53 +++ b/app-i18n/canna/Manifest
54 @@ -0,0 +1,2 @@
55 +DIST 09_fix_manpages_error.patch 35789 BLAKE2B 83765aef44cf459922b027d6ea5e083fc793da5cff422fd4aae68d4fd2b921553b32f0d5afb488141dd8b87ceeb3495f256b33a3bb55fcd6c959a117da5ea015 SHA512 6b80744743a0421fdac30d4d470f3e0cc53c5aedaa3b9ca0c7b12db587c2dd02333d166fabda428dd8618a36b5b559dfd6a64db44b98d490d8a920703c38f6b4
56 +DIST Canna37p3.tar.bz2 1263065 BLAKE2B b5fb496c0ef71dc57b2da1409eea2238ea62ece3286d498d694bc7a18cb0f5e052dca95d692b4302988acd2199d350b893ae4aedc91aab0b737c3e0675be9cba SHA512 82846f2393aa2654dd2c97a93178098b8bd11e5409b584447f1b6fdf303adacc9802e2293cafd98b68af8b69622625ed00aa9712bf270feaa119adfdf4211158
57
58 diff --git a/app-i18n/canna/canna-3.7_p3-r4.ebuild b/app-i18n/canna/canna-3.7_p3-r4.ebuild
59 new file mode 100644
60 index 000000000..16d07b2a7
61 --- /dev/null
62 +++ b/app-i18n/canna/canna-3.7_p3-r4.ebuild
63 @@ -0,0 +1,207 @@
64 +# Copyright 1999-2022 Gentoo Authors
65 +# Distributed under the terms of the GNU General Public License v2
66 +
67 +EAPI=8
68 +
69 +inherit autotools cannadic edo systemd tmpfiles toolchain-funcs
70 +
71 +MY_P="Canna${PV//[._]/}"
72 +MYPV="${PV/_/}"
73 +
74 +DESCRIPTION="A client-server based Kana-Kanji conversion system"
75 +HOMEPAGE="http://canna.osdn.jp/"
76 +SRC_URI="
77 + mirror://sourceforge.jp/${PN}/9565/${MY_P}.tar.bz2
78 + https://sources.debian.org/data/main/c/${PN}/${MYPV}-19/debian/patches/09_fix_manpages_error.patch
79 +"
80 +S="${WORKDIR}/${MY_P}"
81 +
82 +LICENSE="MIT GPL-2"
83 +SLOT="0"
84 +KEYWORDS="~amd64"
85 +IUSE="canuum doc ipv6"
86 +
87 +RDEPEND="
88 + acct-group/canna
89 + acct-user/canna
90 + canuum? (
91 + dev-libs/libspt
92 + sys-libs/ncurses:=
93 + )
94 +"
95 +DEPEND="${RDEPEND}"
96 +BDEPEND="
97 + x11-misc/gccmakedep
98 + x11-misc/imake
99 + canuum? ( virtual/pkgconfig )
100 + doc? (
101 + app-text/ghostscript-gpl
102 + dev-texlive/texlive-langjapanese
103 + dev-texlive/texlive-latexrecommended
104 + )
105 +"
106 +PATCHES=(
107 + "${FILESDIR}/Canna-3.6-dont-grab-ctrl-o.patch"
108 + "${FILESDIR}/Canna-oldsock.patch"
109 + "${FILESDIR}/Canna-3.6-fix-warnings.patch"
110 + "${FILESDIR}/Canna-3.6-wconv.patch"
111 + "${FILESDIR}/Canna-3.7p1-fix-duplicated-strings.patch"
112 + "${FILESDIR}/Canna-3.7p1-notimeout.patch"
113 + "${FILESDIR}/Canna-3.7p3-fix-gcc4-warning.patch"
114 + "${FILESDIR}/Canna-3.7p3-redecl.patch"
115 + "${FILESDIR}/Canna-3.7p3-yenbs.patch"
116 + "${FILESDIR}/${PN}-gentoo.patch"
117 + "${FILESDIR}/${PN}-05_fix_spelling_error.patch"
118 + "${FILESDIR}/${PN}-06_fix_manpages_error.patch"
119 + "${FILESDIR}/${PN}-07_fix_ftbfs_on_hurd-i386.patch"
120 + "${FILESDIR}/${PN}-Wformat.patch"
121 + "${FILESDIR}/${PN}-Wformat-security.patch"
122 + "${DISTDIR}/09_fix_manpages_error.patch"
123 + "${FILESDIR}/${PN}-10_fix_configure.ac.patch"
124 + "${FILESDIR}/${PN}-11_fix_spelling_error_in_binary.patch"
125 + "${FILESDIR}/${PN}-12_make_the_output_of_mkbindic_reproducible.patch"
126 + "${FILESDIR}/${PN}-canuum.patch"
127 + "${FILESDIR}/${PN}-kpdef.patch"
128 + "${FILESDIR}/${PN}-overflow.patch"
129 + "${FILESDIR}/${PN}-posix-sort.patch"
130 + "${FILESDIR}/${PN}-respect-flags.patch"
131 + "${FILESDIR}/${PN}-rundir.patch"
132 +)
133 +
134 +src_prepare() {
135 + tc-export CC LD AR
136 + export CDEBUGFLAGS="${CFLAGS}"
137 + export LOCAL_LDFLAGS="${LDFLAGS}"
138 + export SHLIBGLOBALSFLAGS="${LDFLAGS}"
139 + export LOCAL_LDFLAGS="${LDFLAGS}"
140 + export CCOPTIONS="${CFLAGS} ${CPPFLAGS}"
141 +
142 + default
143 +
144 + sed \
145 + -e "/DefLibCannaDir/s:/lib$:/$(get_libdir):" \
146 + -e "/UseInet6/s:0:$(usex ipv6 1 0):" \
147 + -i ${PN^c}.conf \
148 + || die
149 +
150 + eautoreconf
151 + rm -rf autom4te.cache || die
152 + if use canuum; then
153 + pushd canuum || die
154 + mv configure.{in,ac} || die
155 + eautoreconf
156 + rm -rf autom4te.cache || die
157 + popd || die
158 + fi
159 +}
160 +
161 +src_configure() {
162 + xmkmf -a || die
163 +
164 + if use canuum; then
165 + pushd canuum >/dev/null || die
166 + xmkmf -a || die
167 + # workaround for sys-libs/ncurses[tinfo]
168 + sed -i "/^TERMCAP_LIB/s:=.*:=$($(tc-getPKG_CONFIG) --libs ncurses):" Makefile || die
169 + popd >/dev/null || die
170 + fi
171 + if use doc; then
172 + pushd doc/man/guide/tex >/dev/null || die
173 + xmkmf -a || die
174 + popd >/dev/null || die
175 + fi
176 +}
177 +
178 +src_compile() {
179 + # bug #279706
180 + emake -j1 canna \
181 + CC="${CC}" \
182 + AR="${AR} -cq" \
183 + CDEBUGFLAGS="${CFLAGS}" \
184 + LOCAL_LDFLAGS="${LDFLAGS}" \
185 + SHLIBGLOBALSFLAGS="${LDFLAGS}" \
186 + CCOPTIONS="${CFLAGS} ${CPPFLAGS}"
187 +
188 + edo ${CC} ${CFLAGS} ${LDFLAGS} -fPIE "${FILESDIR}/cannaping.c" -o ./misc/cannaping -I./include -L./lib/canna -lcanna
189 +
190 + if use canuum; then
191 + einfo "Compiling canuum"
192 + emake -C canuum -j1 canuum \
193 + CC="${CC}" \
194 + AR="${AR} -cq" \
195 + CDEBUGFLAGS="${CFLAGS}" \
196 + LOCAL_LDFLAGS="${LDFLAGS}" \
197 + SHLIBGLOBALSFLAGS="${LDFLAGS}" \
198 + CCOPTIONS="${CFLAGS} ${CPPFLAGS}"
199 + fi
200 +
201 + if use doc; then
202 + # NOTE: build fails if infinality enabled in fontconfig
203 + einfo "Compiling DVI, PS, and PDF documents"
204 + # bug #223077
205 + export JLATEXCMD="platex -kanji=euc"
206 + export DVI2PSCMD="dvips"
207 + export VARTEXFONTS="${T}/fonts"
208 + emake -C doc/man/guide/tex -j1 canna.ps canna.pdf
209 + fi
210 +}
211 +
212 +src_install() {
213 + emake DESTDIR="${D}" install install.man
214 + einstalldocs
215 + dodoc *CHANGES* INSTALL* RKCCONF* WHATIS*
216 +
217 + if use canuum; then
218 + emake -C canuum DESTDIR="${D}" install install.man
219 + docinto canuum
220 + dodoc README.jp
221 + fi
222 +
223 + use doc && dodoc doc/man/guide/tex/canna.{dvi,ps,pdf}
224 +
225 + # for backward compatibility
226 + dosbin "${FILESDIR}/update-canna-dics_dir"
227 +
228 + dobin ./misc/cannaping
229 + exeinto /usr/libexec/canna
230 + doexe dic/ideo/pubdic/pod
231 +
232 + insinto /etc
233 + newins "${FILESDIR}/canna.hosts" hosts.canna
234 +
235 + insinto /etc/canna
236 + newins "${FILESDIR}/dot-canna" "default.canna"
237 + newins "${FILESDIR}/canna.hosts" "cannahosts"
238 +
239 + insinto /etc/canna/dics.dir.d
240 + newins "${ED}/var/lib/canna/dic/canna/dics.dir" 00canna.dics.dir
241 + rm -r "${ED}/var/lib/canna/dic/canna/dics.dir" || die
242 +
243 + keepdir /var/lib/canna/dic/{user,group}
244 + fowners canna:canna /var/lib/canna
245 + fperms 0775 /var/lib/canna/dic/{user,group}
246 +
247 + keepdir /var/log/canna
248 + fowners canna:canna /var/log/canna
249 +
250 + newconfd "${FILESDIR}/canna.confd" canna
251 + newinitd "${FILESDIR}/canna.initd" canna
252 +
253 + systemd_dounit "${FILESDIR}/canna.service"
254 + newtmpfiles "${FILESDIR}/canna-tmpfiles.conf" "canna.conf"
255 +
256 + find "${ED}" -type f -name "*.a" -delete || die
257 +}
258 +
259 +pkg_postinst() {
260 + tmpfiles_process canna.conf
261 + update-cannadic-dir
262 +
263 + if ! locale -a | grep -iq "ja_JP.eucjp"; then
264 + elog "Some dictionary tools in this package require ja_JP.EUC-JP locale."
265 + elog
266 + elog "# echo 'ja_JP.EUC-JP EUC-JP' >> ${EROOT}/etc/locale.gen"
267 + elog "# locale-gen"
268 + elog
269 + fi
270 +}
271
272 diff --git a/app-i18n/canna/files/Canna-3.6-dont-grab-ctrl-o.patch b/app-i18n/canna/files/Canna-3.6-dont-grab-ctrl-o.patch
273 new file mode 100644
274 index 000000000..c5fccdbd7
275 --- /dev/null
276 +++ b/app-i18n/canna/files/Canna-3.6-dont-grab-ctrl-o.patch
277 @@ -0,0 +1,11 @@
278 +--- a/lib/canna/alphamap.h
279 ++++ b/lib/canna/alphamap.h
280 +@@ -65,7 +65,7 @@
281 + /* C-l */ CANNA_FN_SelfInsert,
282 + /* C-m */ CANNA_FN_SelfInsert,
283 + /* C-n */ CANNA_FN_SelfInsert,
284 +-/* C-o */ CANNA_FN_JapaneseMode,
285 ++/* C-o */ CANNA_FN_SelfInsert,
286 + /* C-p */ CANNA_FN_SelfInsert,
287 + /* C-q */ CANNA_FN_SelfInsert,
288 + /* C-r */ CANNA_FN_SelfInsert,
289
290 diff --git a/app-i18n/canna/files/Canna-3.6-fix-warnings.patch b/app-i18n/canna/files/Canna-3.6-fix-warnings.patch
291 new file mode 100644
292 index 000000000..74f134eb1
293 --- /dev/null
294 +++ b/app-i18n/canna/files/Canna-3.6-fix-warnings.patch
295 @@ -0,0 +1,10 @@
296 +--- a/lib/canna/kctrl.c
297 ++++ b/lib/canna/kctrl.c
298 +@@ -27,6 +27,7 @@
299 + #include "canna.h"
300 +
301 + #include <errno.h>
302 ++#include <string.h>
303 + #include <sys/types.h>
304 + #include <canna/mfdef.h>
305 +
306
307 diff --git a/app-i18n/canna/files/Canna-3.6-wconv.patch b/app-i18n/canna/files/Canna-3.6-wconv.patch
308 new file mode 100644
309 index 000000000..90fa049f0
310 --- /dev/null
311 +++ b/app-i18n/canna/files/Canna-3.6-wconv.patch
312 @@ -0,0 +1,18 @@
313 +--- a/server/wconvert.c
314 ++++ b/server/wconvert.c
315 +@@ -2096,12 +2096,12 @@
316 + char *buf = (char *)0;
317 +
318 + if (validcontext(cxnum, client, wThrough)) {
319 +- buf = malloc((int)Request.type20.bufsize);
320 ++ content_size = Request.type20.datalen - (SIZEOFINT * 2 + SIZEOFSHORT);
321 ++ buf = malloc(content_size);
322 + if (buf) {
323 +- content_size = Request.type20.datalen - (SIZEOFINT * 2 + SIZEOFSHORT);
324 + bcopy(Request.type20.buf, buf, content_size);
325 + stat = size = RkThrough(cxnum, Request.type20.command,
326 +- buf, content_size, (int)Request.type20.bufsize);
327 ++ buf, content_size, content_size);
328 + }
329 + }
330 + retval = SendType6Reply(client, wThrough, EXTPROTO, stat, buf, size);
331
332 diff --git a/app-i18n/canna/files/Canna-3.7p1-fix-duplicated-strings.patch b/app-i18n/canna/files/Canna-3.7p1-fix-duplicated-strings.patch
333 new file mode 100644
334 index 000000000..303f79255
335 --- /dev/null
336 +++ b/app-i18n/canna/files/Canna-3.7p1-fix-duplicated-strings.patch
337 @@ -0,0 +1,93 @@
338 +--- a/lib/canna/romaji.c
339 ++++ b/lib/canna/romaji.c
340 +@@ -21,7 +21,7 @@
341 + */
342 +
343 + #if !defined(lint) && !defined(__CODECENTER__)
344 +-static char rcs_id[] = "@(#) 102.1 $Id: romaji.c,v 1.10 2003/09/17 08:50:53 aida_s Exp $";
345 ++static char rcs_id[] = "@(#) 102.1 $Id: romaji.c,v 1.11 2004/03/15 04:33:23 aida_s Exp $";
346 + #endif /* lint */
347 +
348 + #include "canna.h"
349 +@@ -2626,6 +2626,7 @@
350 + yc->englishtype = CANNA_ENG_KANA;
351 + yc->cStartp = yc->cRStartp = 0;
352 + yc->jishu_kEndp = 0;
353 ++ yc->n_susp_chars = 0;
354 + }
355 +
356 + static int
357 +@@ -2782,8 +2783,13 @@
358 + }
359 + yc->last_rule = 0;
360 + howManyDelete = howFarToGoBackward(yc);
361 +- if (howManyDelete > 0 && (yc->generalFlags & CANNA_YOMI_BREAK_ROMAN)) {
362 +- yc->generalFlags &= ~CANNA_YOMI_BREAK_ROMAN;
363 ++ if (howManyDelete > 0 && (yc->generalFlags & CANNA_YOMI_BREAK_ROMAN)
364 ++ && (yc->kAttr[yc->kCurs] & SENTOU)) {
365 ++ /*
366 ++ * ローマ字1文字に対応する仮名を消した時はローマ字、仮名とも
367 ++ * SENTOUフラグが1個減る。
368 ++ * そうでないときはSENTOUフラグの個数は変わらない
369 ++ */
370 + yc->rStartp = yc->rCurs - 1;
371 + while ( yc->rStartp > 0 && !(yc->rAttr[yc->rStartp] & SENTOU) ) {
372 + yc->rStartp--;
373 +@@ -2792,16 +2798,23 @@
374 + yc->kRStartp = yc->kCurs - 1;
375 + while ( yc->kRStartp > 0 && !(yc->kAttr[yc->kRStartp] & SENTOU) )
376 + yc->kRStartp--;
377 ++ /* これ必ず真では? */
378 + prevflag = (yc->kAttr[yc->kRStartp] & SENTOU);
379 + kanaReplace(yc->kRStartp - yc->kCurs,
380 + yc->romaji_buffer + yc->rStartp,
381 + yc->rCurs - yc->rStartp,
382 + 0);
383 ++ /* ローマ字1文字に対応する仮名を消したときは最初からSENTOUである */
384 + yc->kAttr[yc->kRStartp] |= prevflag;
385 + yc->n_susp_chars = 0; /* とりあえずクリアしておく */
386 + makePhonoOnBuffer(d, yc, (unsigned char)0, 0, 0);
387 ++ /* 以前は常にフラグを下げていたが、未変換ローマ字が残っているときは
388 ++ * フラグを下げないことにする */
389 ++ if (yc->kRStartp == yc->kCurs)
390 ++ yc->generalFlags &= ~CANNA_YOMI_BREAK_ROMAN;
391 + }
392 + else {
393 ++ yc->generalFlags &= ~CANNA_YOMI_BREAK_ROMAN;
394 + if ( yc->kAttr[yc->kCurs - howManyDelete] & HENKANSUMI ) {
395 + if (yc->kAttr[yc->kCurs - howManyDelete] & SENTOU) {
396 + /* ローマ字かな変換の先頭だったら */
397 +@@ -2821,6 +2834,12 @@
398 + yc->rEndp -= n;
399 + }
400 + else {
401 ++ /* 仮名のカーソル位置は先頭になるのでローマ字のカーソルも動かす*/
402 ++ while ( yc->rCurs > 0 && !(yc->rAttr[--yc->rCurs] & SENTOU) )
403 ++ ;
404 ++ if (yc->rCurs < yc->rStartp) {
405 ++ yc->rStartp = yc->rCurs;
406 ++ }
407 + yc->kAttr[yc->kCurs] |= SENTOU;
408 + }
409 + }
410 +@@ -2829,6 +2848,12 @@
411 + romajiReplace(-howManyDelete, (wchar_t *)NULL, 0, 0);
412 + }
413 + kanaReplace(-howManyDelete, (wchar_t *)NULL, 0, 0);
414 ++ if ((yc->rAttr[yc->rCurs] & SENTOU) && yc->kRStartp == yc->kCurs) {
415 ++ /* 未変換のローマ字を消してしまったので、次に入力したローマ字は
416 ++ * SENTOUになる方が自然だろう
417 ++ */
418 ++ yc->rStartp = yc->rCurs;
419 ++ }
420 + }
421 + debug_yomi(yc);
422 + return(0);
423 +@@ -2944,6 +2969,7 @@
424 + currentModeInfo(d);
425 + }
426 + makeYomiReturnStruct(d);
427 ++ debug_yomi(yc);
428 + return 0;
429 + }
430 +
431
432 diff --git a/app-i18n/canna/files/Canna-3.7p1-notimeout.patch b/app-i18n/canna/files/Canna-3.7p1-notimeout.patch
433 new file mode 100644
434 index 000000000..3f27a32cc
435 --- /dev/null
436 +++ b/app-i18n/canna/files/Canna-3.7p1-notimeout.patch
437 @@ -0,0 +1,12 @@
438 +ƒ‚ゃƒŠƒ�ƒ若ƒ祉ƒ•‚<‚ゃƒCanna37p1.orig/lib/RKC/.wconvert.c.swpCanna37p1/lib/RKC/.wconvert.c.swp�•„障™
439 +--- a/lib/RKC/conf.c
440 ++++ b/lib/RKC/conf.c
441 +@@ -1496,7 +1496,7 @@
442 + };
443 +
444 + const NumberDefaultRec host_num_defaults[] = {
445 +- { CONF_SERVER_TIMEOUT, 1500u },
446 ++ { CONF_SERVER_TIMEOUT, 0u },
447 + };
448 +
449 + const char *
450
451 diff --git a/app-i18n/canna/files/Canna-3.7p3-fix-gcc4-warning.patch b/app-i18n/canna/files/Canna-3.7p3-fix-gcc4-warning.patch
452 new file mode 100644
453 index 000000000..42e9ee3a8
454 --- /dev/null
455 +++ b/app-i18n/canna/files/Canna-3.7p3-fix-gcc4-warning.patch
456 @@ -0,0 +1,136 @@
457 +--- a/cmd/crxgram/crxgram.c
458 ++++ b/cmd/crxgram/crxgram.c
459 +@@ -485,7 +485,7 @@
460 + int j;
461 +
462 + nextS = scanToken(nextS, namevec, sizeof(namevec));
463 +- name = strtok(namevec, SEP);
464 ++ name = strtok((char *)namevec, SEP);
465 + for (j = 0; name && j < 255;) {
466 + if (r = probeIdent(Row, name))
467 + rdata[i][j++] = r->rownum;
468 +--- a/cmd/cshost/cshost.c
469 ++++ b/cmd/cshost/cshost.c
470 +@@ -152,12 +152,12 @@
471 + goto protoerr;
472 + assert(wp + 2 <= endp);
473 + printf("HOST NAME:%s\n", wp ) ;
474 +- wp += strlen( wp ) + 1 ;
475 ++ wp += strlen((char *) wp ) + 1 ;
476 + if( *wp ) {
477 + printf("USER NAME:" ) ;
478 + while( *wp ) {
479 + printf("%s ", wp ) ;
480 +- wp += strlen( wp ) + 1 ;
481 ++ wp += strlen((char *) wp ) + 1 ;
482 + }
483 + } else
484 + printf("ALL USER" ) ;
485 +--- a/cmd/wtoc/wtoc.c
486 ++++ b/cmd/wtoc/wtoc.c
487 +@@ -144,8 +144,8 @@
488 + int hindo;
489 + {
490 + if( !strcmp((char *)hinshi,"#kxuru") || !strcmp((char *)hinshi,"#sxuru")){
491 +- strcat(yomi,"る");
492 +- strcat(kouho,"る");
493 ++ strcat((char *)yomi,"る");
494 ++ strcat((char *)kouho,"る");
495 + }
496 + if( hindo == 0 )
497 + fprintf( fp, "%s %s %s \n", yomi, hinshi, kouho );
498 +--- a/lib/canna/ebind.c
499 ++++ b/lib/canna/ebind.c
500 +@@ -364,7 +364,7 @@
501 + /* list_cbはKC_setListCallbackでd->elistcbに引っ越す */
502 + list_cb.client_data = (char *)arg;
503 + list_cb.callback_func = &EUCListCallback;
504 +- ret = XwcKanjiControl2(display, window, request, (char *)&list_cb);
505 ++ ret = XwcKanjiControl2(display, window, request, (BYTE *)&list_cb);
506 + goto return_ret;
507 + /* FALLTHROUGH */
508 + default: /* ワイドでもEUCでも変わらないもの */
509 +--- a/lib/canna/obind.c
510 ++++ b/lib/canna/obind.c
511 +@@ -500,7 +500,7 @@
512 + /* list_cbはKC_setListCallbackでd->elistcbに引っ越す */
513 + list_cb.client_data = (char *)arg;
514 + list_cb.callback_func = &owcListCallback;
515 +- ret = XwcKanjiControl2(display, window, request, (char *)&list_cb);
516 ++ ret = XwcKanjiControl2(display, window, request, (BYTE *)&list_cb);
517 + goto return_ret;
518 + default: /* 新ワイドと変わらないもの */
519 + ret = XwcKanjiControl2(display, window, request, arg);
520 +--- a/server/convert.c
521 ++++ b/server/convert.c
522 +@@ -1506,7 +1506,7 @@
523 + const char *username;
524 + const char *hostname;
525 + {
526 +- int (*ReqCallFunc) pro((char *, int)) ;
527 ++ int (*ReqCallFunc) pro((BYTE *, int)) ;
528 + register Req0 *req0 = &Request.Request0 ;
529 + const char *username0 = username ? username : "";
530 + const char *hostname0 = hostname ? hostname : "";
531 +--- a/server/wconvert.c
532 ++++ b/server/wconvert.c
533 +@@ -189,7 +189,7 @@
534 + size_t size;
535 + {
536 + ir_debug( Dmsg(10, "WriteClient:") );
537 +- ir_debug( DebugDump( 10, buf, size ) );
538 ++ ir_debug( DebugDump( 10, (const char *)buf, size ) );
539 + return ClientBuf_store_reply(client->client_buf, buf, size);
540 + }
541 + #else
542 +@@ -1372,8 +1372,8 @@
543 + /* 以下、パーミッションのチェック */
544 + stat = ACCES;
545 + if (checkPermissionToRead(client, dirname, (char *)0) >= 0) {
546 +- stat = RkwListDic(cxnum, (unsigned char *)dirname,
547 +- (unsigned char *)dicnames, requestsize);
548 ++ stat = RkwListDic(cxnum, (char *)dirname,
549 ++ (char *)dicnames, requestsize);
550 + }
551 +
552 + listdicdone:
553 +@@ -1403,7 +1403,7 @@
554 + ir_debug( Dmsg(5, "dicname = %s\n",
555 + (req->dicname)?req->dicname:null) );
556 +
557 +- stat = (char)RkwCreateDic(cxnum, (unsigned char *)req->dicname,
558 ++ stat = (char)RkwCreateDic(cxnum, (char *)req->dicname,
559 + req->mode);
560 + }
561 +
562 +@@ -1438,7 +1438,7 @@
563 + ir_debug( Dmsg(5, "dicname = %s\n",
564 + (req->dicname)?req->dicname:null) );
565 +
566 +- stat = (char)RkwRemoveDic(cxnum, (unsigned char *)req->dicname,
567 ++ stat = (char)RkwRemoveDic(cxnum, (char *)req->dicname,
568 + req->mode);
569 + }
570 +
571 +@@ -1456,8 +1456,8 @@
572 +
573 + if (validcontext(cxnum, client, wRenameDictionary)) {
574 + diclen = strlen(req->dicname) + 1 ;
575 +- stat = RkwRenameDic(cxnum, (unsigned char *)req->dicname,
576 +- (unsigned char *)&(req->dicname)[diclen],
577 ++ stat = RkwRenameDic(cxnum, (char *)req->dicname,
578 ++ (char *)&(req->dicname)[diclen],
579 + req->mode);
580 + }
581 + return SendType2Reply(client, wRenameDictionary, EXTPROTO, stat);
582 +@@ -1950,8 +1950,8 @@
583 + ir_debug( Dmsg(5, "dicname = %s\n", Request.type15.dicname) );
584 + ir_debug( Dmsg(5, "username = %s\n", username) );
585 +
586 +- stat = (RkwQueryDic(cxnum, (unsigned char *)username,
587 +- (unsigned char *)Request.type15.dicname,
588 ++ stat = (RkwQueryDic(cxnum, (char *)username,
589 ++ (char *)Request.type15.dicname,
590 + dicinfo) < 0) ? -1 : 0;
591 +
592 + if (stat < 0) {
593
594 diff --git a/app-i18n/canna/files/Canna-3.7p3-redecl.patch b/app-i18n/canna/files/Canna-3.7p3-redecl.patch
595 new file mode 100644
596 index 000000000..816b73887
597 --- /dev/null
598 +++ b/app-i18n/canna/files/Canna-3.7p3-redecl.patch
599 @@ -0,0 +1,11 @@
600 +--- a/lib/canna/lisp.c
601 ++++ b/lib/canna/lisp.c
602 +@@ -1355,8 +1355,6 @@
603 + static int
604 + tyi()
605 + {
606 +- char *gets(), *fgets();
607 +-
608 + if (untyibuf) {
609 + int ret = untyibuf[--untyip];
610 + if (untyip == 0) {
611
612 diff --git a/app-i18n/canna/files/Canna-3.7p3-yenbs.patch b/app-i18n/canna/files/Canna-3.7p3-yenbs.patch
613 new file mode 100644
614 index 000000000..837fecdca
615 --- /dev/null
616 +++ b/app-i18n/canna/files/Canna-3.7p3-yenbs.patch
617 @@ -0,0 +1,11 @@
618 +--- a/lib/RK/RkGetDic.man
619 ++++ b/lib/RK/RkGetDic.man
620 +@@ -41,7 +41,7 @@
621 + Dictionary names are got in the area \f2dics\f1 in the following format:
622 + .P
623 + .RS 0.2c
624 +-dictionary-name-1 ¥0 dictionary-name-2 ¥0 ... dictionary-name-n ¥0 ¥0
625 ++dictionary-name-1 \\0 dictionary-name-2 \\0 ... dictionary-name-n \\0 \\0
626 + .RE
627 + .P
628 + The size of the area \f2dics\f1 is given in bytes by \f2maxdics\f1. The dictionary list is truncated in character strings when it exceeds this size.
629
630 diff --git a/app-i18n/canna/files/Canna-oldsock.patch b/app-i18n/canna/files/Canna-oldsock.patch
631 new file mode 100644
632 index 000000000..f62ee6c97
633 --- /dev/null
634 +++ b/app-i18n/canna/files/Canna-oldsock.patch
635 @@ -0,0 +1,29 @@
636 +--- a/lib/RKC/wconvert.c
637 ++++ b/lib/RKC/wconvert.c
638 +@@ -150,8 +150,25 @@
639 + if ((ServerFD = socket((int) addr->sa_family, SOCK_STREAM, 0)) >= 0){
640 + if( try_connect( ServerFD, addr, sizeof unaddr ) < 0 ) {
641 + close( ServerFD ) ;
642 +- return( -1 ) ;
643 ++ ServerFD = -1;
644 ++ }
645 ++ }
646 ++ if (ServerFD < 0) {
647 ++ /* for the backward compatibility */
648 ++#define OLD_IR_UNIX_PATH "/tmp/.iroha_unix/IROHA"
649 ++
650 ++ if (number)
651 ++ sprintf (unaddr.sun_path, "%s:%d", OLD_IR_UNIX_PATH, number);
652 ++ else
653 ++ strcpy (unaddr.sun_path, OLD_IR_UNIX_PATH);
654 ++
655 ++ if ((ServerFD = socket ((int) addr->sa_family, SOCK_STREAM, 0)) >= 0) {
656 ++ if (try_connect (ServerFD, addr, sizeof (unaddr)) < 0) {
657 ++ close (ServerFD);
658 ++ return -1;
659 ++ }
660 + }
661 ++#undef OLD_IR_UNIX_PATH
662 + }
663 + return( ServerFD ) ;
664 + }
665
666 diff --git a/app-i18n/canna/files/canna-05_fix_spelling_error.patch b/app-i18n/canna/files/canna-05_fix_spelling_error.patch
667 new file mode 100644
668 index 000000000..372c7a627
669 --- /dev/null
670 +++ b/app-i18n/canna/files/canna-05_fix_spelling_error.patch
671 @@ -0,0 +1,63 @@
672 +## 06_fix_spelling_error by HIGUCHI Daisuke (VDR dai) <dai@××××××.org>
673 +##
674 +## All lines beginning with `## DP:' are a description of the patch.
675 +## DP: eliminate lintian warning: spelling-error-in-{binary,manpages}
676 +
677 +--- a/cmd/wtoc/wtoc.c
678 ++++ b/cmd/wtoc/wtoc.c
679 +@@ -195,7 +195,7 @@ main(argc,argv)
680 + #endif
681 + }
682 + else { /* 引数が不正 */
683 +- fprintf(stderr,gettxt("cannacmd:50", "Usage: wtoc [-f part-of-speach table] [wnndic] [cannadic]\n"));
684 ++ fprintf(stderr,gettxt("cannacmd:50", "Usage: wtoc [-f part-of-speech table] [wnndic] [cannadic]\n"));
685 + exit(2);
686 + }
687 + if( argc >= (2 + option*2) ) { /* Wnn辞書をオープン */
688 +--- a/cmd/ctow/ctow.c
689 ++++ b/cmd/ctow/ctow.c
690 +@@ -256,9 +256,9 @@ char *argv[];
691 + hinshis = chghinshi(h, hinshiSize, taiou, fsize);
692 + if (!strcmp(hinshis,"")) {
693 + fprintf(stderr,gettxt("cannacmd:13",
694 +- "reading:%s nomination:%s a part of speach:%s\n"),y,k,h);
695 ++ "reading:%s nomination:%s a part of speech:%s\n"),y,k,h);
696 + fprintf(stderr,gettxt("cannacmd:14",
697 +- "This part of speach is undefined. Cannot convert.\n"));
698 ++ "This part of speech is undefined. Cannot convert.\n"));
699 + }
700 + else {
701 + for ( ; *hinshis; hinshis++, p++) {
702 +--- a/lib/canna/lisp.c
703 ++++ b/lib/canna/lisp.c
704 +@@ -3610,7 +3610,7 @@
705 + numtostr(xnum(e2), ee);
706 + num = howManyCharsAre(ss, ee, &sku, &sten, &cs);
707 + if (num <= 0) {
708 +- error("Inconsistent range of charcter code ", buf);
709 ++ error("Inconsistent range of character code ", buf);
710 + /* NOTREACHED */
711 + }
712 + kigolen = kigolen + (cswidth[cs] + 1) * num;
713 +--- a/lib/canna/uilib.man
714 ++++ b/lib/canna/uilib.man
715 +@@ -809,7 +809,7 @@ data input:
716 + int length; /* length of echo string */
717 + int revPos; /* reverse position */
718 + int revLen; /* reverse length */
719 +- unsigned long info; /* other informations */
720 ++ unsigned long info; /* other information */
721 + unsigned char *mode; /* mode information */
722 + struct {
723 + unsigned char *line; /* a grance of Kanji characters */
724 +--- a/lib/canna/uilib.jmn
725 ++++ b/lib/canna/uilib.jmn
726 +@@ -749,7 +749,7 @@ XCompose構造体へのポインタを指定します。
727 + int revPos; /* reverse position */
728 + int revLen; /* reverse length */
729 + .mc \(br
730 +- unsigned long info; /* other informations */
731 ++ unsigned long info; /* other information */
732 + unsigned char *mode; /* mode information */
733 + struct {
734 + unsigned char *line; /* a grance of Kanji characters */
735
736 diff --git a/app-i18n/canna/files/canna-06_fix_manpages_error.patch b/app-i18n/canna/files/canna-06_fix_manpages_error.patch
737 new file mode 100644
738 index 000000000..7b1cd0328
739 --- /dev/null
740 +++ b/app-i18n/canna/files/canna-06_fix_manpages_error.patch
741 @@ -0,0 +1,37 @@
742 +## 07_fix_manpage_error by HIGUCHI Daisuke (VDR dai) <dai@××××××.org>
743 +##
744 +## All lines beginning with `## DP:' are a description of the patch.
745 +## DP: eliminate lintian warning: manpage-has-errors-from-man
746 +
747 +--- a/cmd/dpromdic/dpromdic.man
748 ++++ b/cmd/dpromdic/dpromdic.man
749 +@@ -1,7 +1,7 @@
750 + .TH DPROMDIC 1
751 +-.S HNAME
752 ++.SH NAME
753 + dpromdic \- Convert the binary-form Romaji-to-Kana conversion table into the text-form table
754 +-.SHSYNOPSYS
755 ++.SH SYNOPSYS
756 + .B dpromdic
757 + [
758 + .I file
759 +--- a/cmd/dicar/dicar.man
760 ++++ b/cmd/dicar/dicar.man
761 +@@ -28,7 +28,7 @@ dicar \- Archive Binary Dictionary
762 + archives binary dictionary
763 + .I bindic1.
764 + The hyphen of each option may be omitted.
765 +-.OPTIONS
766 ++.SH OPTIONS
767 + .TP
768 + .B \-t
769 + Displays the dictionaries contained in binary dictionary file
770 +--- a/cmd/cshost/cshost.man
771 ++++ b/cmd/cshost/cshost.man
772 +@@ -1,5 +1,5 @@
773 + .TH CSHOST 1
774 +-.SH "NAMES"
775 ++.SH "NAME"
776 + cshost \- Server access control program for canna
777 + .SH "SYNOPSIS"
778 + .B "cshost [{\-cs|\-cannaserver} \fIcannaserver\fP]"
779
780 diff --git a/app-i18n/canna/files/canna-07_fix_ftbfs_on_hurd-i386.patch b/app-i18n/canna/files/canna-07_fix_ftbfs_on_hurd-i386.patch
781 new file mode 100644
782 index 000000000..2b3bc3c07
783 --- /dev/null
784 +++ b/app-i18n/canna/files/canna-07_fix_ftbfs_on_hurd-i386.patch
785 @@ -0,0 +1,16 @@
786 +## 08_fix_ftbfs_on_hurd-i386 by HIGUCHI Daisuke (VDR dai) <dai@××××××.org>
787 +##
788 +## All lines beginning with `## DP:' are a description of the patch.
789 +## DP: fix FTBFS on hurd-i386. use O_RDONLY instead of bare 0.
790 +
791 +--- a/cmd/crxdic/crxdic.c
792 ++++ b/cmd/crxdic/crxdic.c
793 +@@ -1228,7 +1228,7 @@ main (argc, argv)
794 + if (!(dic->gramdata = RkiReadWholeFile(fp, &dic->gramsz)))
795 + goto gram_err;
796 + fclose(fp);
797 +- if ((fd = open(gfile, 0)) < 0 || !(gram = RkReadGram(fd, dic->gramsz)))
798 ++ if ((fd = open(gfile, O_RDONLY)) < 0 || !(gram = RkReadGram(fd, dic->gramsz)))
799 + goto gram_err;
800 + close(fd);
801 + goto gram_ok;
802
803 diff --git a/app-i18n/canna/files/canna-10_fix_configure.ac.patch b/app-i18n/canna/files/canna-10_fix_configure.ac.patch
804 new file mode 100644
805 index 000000000..d53f3f233
806 --- /dev/null
807 +++ b/app-i18n/canna/files/canna-10_fix_configure.ac.patch
808 @@ -0,0 +1,19 @@
809 +Description: fix FTBFS caused after the DH level has bumped.
810 +Author: Francisco Vilmar Cardoso Ruviaro <francisco.ruviaro@××××××.net>
811 +Last-Update: 2020-06-20
812 +
813 +--- a/configure.ac
814 ++++ b/configure.ac
815 +@@ -3,9 +3,9 @@ AC_INIT([canna], [3.7p3], [canna-dev@lis
816 + AC_CONFIG_SRCDIR([WHATIS.jp])
817 + AC_CONFIG_HEADER([accanna.h])
818 +
819 +-if test "x$IN_MAKE" != xyes; then
820 +- AC_MSG_ERROR([You cannot invloke configure directly.])
821 +-fi
822 ++#if test "x$IN_MAKE" != xyes; then
823 ++# AC_MSG_ERROR([You cannot invloke configure directly.])
824 ++#fi
825 +
826 + # Checks for programs.
827 + AC_PROG_CC
828
829 diff --git a/app-i18n/canna/files/canna-11_fix_spelling_error_in_binary.patch b/app-i18n/canna/files/canna-11_fix_spelling_error_in_binary.patch
830 new file mode 100644
831 index 000000000..77ff26b27
832 --- /dev/null
833 +++ b/app-i18n/canna/files/canna-11_fix_spelling_error_in_binary.patch
834 @@ -0,0 +1,91 @@
835 +Description: Fix spelling error in binaries.
836 +Author: Francisco Vilmar Cardoso Ruviaro <francisco.ruviaro@××××××.net>
837 +Last-Update: 2020-07-16
838 +
839 +--- a/cmd/catdic/can.c
840 ++++ b/cmd/catdic/can.c
841 +@@ -281,7 +281,7 @@ int sig;
842 + */
843 + (void) RkFinalize();
844 + fprintf(stderr,"\n");
845 +- Message(gettxt("cannacmd:232", "Process was intrrupted."));
846 ++ Message(gettxt("cannacmd:232", "Process was interrupted."));
847 + exit(ERR_VALUE);
848 + }
849 +
850 +@@ -323,7 +323,7 @@ int sig;
851 + (void) RkFinalize();
852 + }
853 +
854 +- Message(gettxt("cannacmd:232", "Process was intrrupted."));
855 ++ Message(gettxt("cannacmd:232", "Process was interrupted."));
856 + exit(ERR_VALUE);
857 + }
858 +
859 +@@ -1475,7 +1475,7 @@ int force;
860 + }
861 + else {
862 + fprintf(stderr, gettxt("cannacmd:174",
863 +- "Specified dictionary \"%s\" does not overwite.\n"),dicname2);
864 ++ "Specified dictionary \"%s\" does not overwrite.\n"),dicname2);
865 + ret = 1;
866 + }
867 + break;
868 +--- a/cmd/crfreq/crfreq.c
869 ++++ b/cmd/crfreq/crfreq.c
870 +@@ -199,7 +199,7 @@ main(argc, argv)
871 +
872 + if ((fr = create(freqfile, 0666)) == -1) {
873 + (void)close(fd);
874 +- (void)fprintf(stderr, "%s: cannot create freqency file %s\n", program, freqfile);
875 ++ (void)fprintf(stderr, "%s: cannot create frequency file %s\n", program, freqfile);
876 + exit(1);
877 + }
878 + #ifdef __CYGWIN32__
879 +--- a/server/convert.c
880 ++++ b/server/convert.c
881 +@@ -887,7 +887,7 @@ ClientPtr *clientp ;
882 + if ((ret = RkwStoreYomi( cxnum, (Ushort *)cbuf, ret )) >= 0) {
883 + size = getFirstKouho(cxnum, bunsetu, ret, &stat, &lbufp);
884 + } else {
885 +- PrintMsg("%s RkwStoreYomi faild\n", irerrhdr(client));
886 ++ PrintMsg("%s RkwStoreYomi failed\n", irerrhdr(client));
887 + }
888 + } else {
889 + print_context_error(client);
890 +--- a/server/misc.c
891 ++++ b/server/misc.c
892 +@@ -316,7 +316,7 @@ BecomeDaemon ()
893 +
894 + #ifndef __EMX__
895 + if ((parent = fork()) == -1) {
896 +- PrintMsg( "Fork faild\n" );
897 ++ PrintMsg( "Fork failed\n" );
898 + exit( 1 ) ;
899 + }
900 + if ( parent ) {
901 +@@ -989,11 +989,11 @@ DetachTTY()
902 + sprintf(errfile,"%s/%s%d%s", ERRDIR, ERRFILE, PortNumberPlus, ERRFILE2);
903 +
904 + if((errfd = open(errfile, O_CREAT | O_RDWR | O_TRUNC, 0644)) < 0) {
905 +- (void)fprintf(stderr, "Warning: %s: %s open faild\n", Name, errfile);
906 ++ (void)fprintf(stderr, "Warning: %s: %s open failed\n", Name, errfile);
907 + (void)perror("");
908 + } else {
909 + if(dup2( errfd, fileno(stderr)) < 0) {
910 +- (void)fprintf(stderr, "Warning: %s: %s dup2 faild\n", Name, errfile);
911 ++ (void)fprintf(stderr, "Warning: %s: %s dup2 failed\n", Name, errfile);
912 + (void)perror("");
913 + close(fileno(stderr));
914 + }
915 +--- a/server/wconvert.c
916 ++++ b/server/wconvert.c
917 +@@ -1153,7 +1153,7 @@ ClientPtr *clientp ;
918 + sizeof(local_buffer) / sizeof(Ushort), &bufp);
919 + RkwGoTo(cxnum, bunsetu);
920 + } else {
921 +- PrintMsg("%s RkwStoreYomi faild\n",
922 ++ PrintMsg("%s RkwStoreYomi failed\n",
923 + irwerrhdr(client, wStoreYomi));
924 + stat = -1 ;
925 + }
926
927 diff --git a/app-i18n/canna/files/canna-12_make_the_output_of_mkbindic_reproducible.patch b/app-i18n/canna/files/canna-12_make_the_output_of_mkbindic_reproducible.patch
928 new file mode 100644
929 index 000000000..5019ec0ee
930 --- /dev/null
931 +++ b/app-i18n/canna/files/canna-12_make_the_output_of_mkbindic_reproducible.patch
932 @@ -0,0 +1,61 @@
933 +Description: make the output of mkbindic reproducible.
934 +Author: Chris Lamb <lamby@××××××.org>
935 +Bug-Debian: https://bugs.debian.org/861955
936 +Forwarded: no
937 +Reviewed-By: Francisco Vilmar Cardoso Ruviaro <francisco.ruviaro@××××××.net>
938 +Last-Update: 2020-08-17
939 +
940 +--- a/cmd/crxdic/crxdic.c
941 ++++ b/cmd/crxdic/crxdic.c
942 +@@ -31,6 +31,7 @@ static char rcsid[]="@(#) 102.1 $Id: crx
943 + #include <time.h>
944 + #include <ctype.h>
945 + #include <fcntl.h>
946 ++#include <limits.h>
947 + #include <assert.h>
948 + #include "ccompat.h"
949 + #include "RKindep/file.h"
950 +@@ -932,6 +933,9 @@ makeHeader(dic)
951 + unsigned i;
952 + RkiCksumCalc calc;
953 + unsigned off;
954 ++ char *source_date_epoch;
955 ++ unsigned long long epoch;
956 ++ char *endptr;
957 +
958 + if (RkiCksumCRCInit(&calc)
959 + || RkiCksumAdd(&calc, dic->Dir->buf, dic->Dir->dirsiz)) {
960 +@@ -963,7 +967,32 @@ makeHeader(dic)
961 + hd.data[HD_CMPV].var = 0x300702L;
962 + hd.flag[HD_CMPV] = -1;
963 + }
964 +- hd.data[HD_TIME].var = tloc = time(0);
965 ++ source_date_epoch = getenv("SOURCE_DATE_EPOCH");
966 ++ if (source_date_epoch) {
967 ++ errno = 0;
968 ++ epoch = strtoull(source_date_epoch, &endptr, 10);
969 ++ if ((errno == ERANGE && (epoch == ULLONG_MAX || epoch == 0))
970 ++ || (errno != 0 && epoch == 0)) {
971 ++ fprintf(stderr, "Environment variable $SOURCE_DATE_EPOCH: strtoull: %s\n", strerror(errno));
972 ++ exit(EXIT_FAILURE);
973 ++ }
974 ++ if (endptr == source_date_epoch) {
975 ++ fprintf(stderr, "Environment variable $SOURCE_DATE_EPOCH: No digits were found: %s\n", endptr);
976 ++ exit(EXIT_FAILURE);
977 ++ }
978 ++ if (*endptr != '\0') {
979 ++ fprintf(stderr, "Environment variable $SOURCE_DATE_EPOCH: Trailing garbage: %s\n", endptr);
980 ++ exit(EXIT_FAILURE);
981 ++ }
982 ++ if (epoch > ULONG_MAX) {
983 ++ fprintf(stderr, "Environment variable $SOURCE_DATE_EPOCH: value must be smaller than or equal to %lu but was found to be: %llu \n", ULONG_MAX, epoch);
984 ++ exit(EXIT_FAILURE);
985 ++ }
986 ++ tloc = epoch;
987 ++ } else {
988 ++ tloc = time(0);
989 ++ }
990 ++ hd.data[HD_TIME].var = tloc;
991 + hd.flag[HD_TIME] = -1;
992 + hd.data[HD_DMNM].ptr = (unsigned char *)STrdup(dic->name);
993 + hd.flag[HD_DMNM] = strlen(dic->name);
994
995 diff --git a/app-i18n/canna/files/canna-Wformat-security.patch b/app-i18n/canna/files/canna-Wformat-security.patch
996 new file mode 100644
997 index 000000000..c83552b5c
998 --- /dev/null
999 +++ b/app-i18n/canna/files/canna-Wformat-security.patch
1000 @@ -0,0 +1,199 @@
1001 +--- a/cmd/catdic/can.c
1002 ++++ b/cmd/catdic/can.c
1003 +@@ -1236,7 +1236,7 @@
1004 + break;
1005 + default:
1006 + if (init[0] == '/') {
1007 +- (void)fprintf(stderr,msg_abnl);
1008 ++ (void)fprintf(stderr,"%s",msg_abnl);
1009 + } else {
1010 + (void)fprintf(stderr,msg_abnls,init);
1011 + }
1012 +@@ -1297,11 +1297,11 @@
1013 +
1014 + if ( opt_fq ) {
1015 + if ( opt_s ) {
1016 +- (void) fprintf(stderr,msg_sfq);
1017 ++ (void) fprintf(stderr,"%s",msg_sfq);
1018 + exit(ERR_VALUE) ;
1019 + }
1020 + if ( opt_l || opt_std ) {
1021 +- (void) fprintf(stderr,msg_l);
1022 ++ (void) fprintf(stderr,"%s",msg_l);
1023 + exit(ERR_VALUE) ;
1024 + }
1025 + mode = mode | PL_DIC ;
1026 +@@ -1491,7 +1491,7 @@
1027 + break;
1028 + default:
1029 + if(init[0] == '/') {
1030 +- fprintf(stderr,msg_abnl );
1031 ++ fprintf(stderr,"%s",msg_abnl );
1032 + }
1033 + else {
1034 + fprintf(stderr,msg_abnls,init);
1035 +--- a/cmd/catdic/rutil.c
1036 ++++ b/cmd/catdic/rutil.c
1037 +@@ -271,7 +271,7 @@
1038 + "Dictionary \"%s\" does not exist.\n"), dicname);
1039 + break;
1040 + case NOTALC :
1041 +- (void)fprintf(stderr, msg_mem);
1042 ++ (void)fprintf(stderr, "%s", msg_mem);
1043 + break;
1044 + case BADF :
1045 + (void)fprintf(stderr, gettxt("cannacmd:196",
1046 +@@ -297,7 +297,7 @@
1047 + (void)fprintf(stderr,msg_abnls,init);
1048 + }
1049 + else {
1050 +- (void)fprintf(stderr,msg_abnl);
1051 ++ (void)fprintf(stderr,"%s",msg_abnl);
1052 + }
1053 + break;
1054 + }
1055 +@@ -321,7 +321,7 @@
1056 + (void)fprintf(stderr, msg_abnls, init);
1057 + }
1058 + else {
1059 +- (void)fprintf(stderr, msg_abnl);
1060 ++ (void)fprintf(stderr, "%s", msg_abnl);
1061 + }
1062 + ret = -1;
1063 + return ret;
1064 +@@ -332,13 +332,13 @@
1065 + (void)fprintf(stderr, msg_mnts, init);
1066 + }
1067 + else {
1068 +- (void)fprintf(stderr, msg_mnt);
1069 ++ (void)fprintf(stderr, "%s", msg_mnt);
1070 + }
1071 + ret = -1;
1072 + return ret;
1073 + }
1074 + if ((mode & PL_DIC) == PL_DIC ) {
1075 +- (void)fprintf(stderr,msg_fq);
1076 ++ (void)fprintf(stderr,"%s",msg_fq);
1077 + ret = -1 ;
1078 + return ret ;
1079 + }
1080 +@@ -359,7 +359,7 @@
1081 + ret = 0;
1082 + break;
1083 + case NOTALC :
1084 +- (void)fprintf(stderr, msg_mem);
1085 ++ (void)fprintf(stderr, "%s", msg_mem);
1086 + ret = -1;
1087 + break;
1088 + case BADF :
1089 +@@ -421,7 +421,7 @@
1090 + ret = -1;
1091 + break;
1092 + case BADCONT :
1093 +- (void)fprintf(stderr,msg_cnt);
1094 ++ (void)fprintf(stderr,"%s",msg_cnt);
1095 + ret = -1;
1096 + break;
1097 + default:
1098 +@@ -429,7 +429,7 @@
1099 + (void)fprintf(stderr, msg_abnls, init);
1100 + }
1101 + else {
1102 +- (void)fprintf(stderr, msg_abnl);
1103 ++ (void)fprintf(stderr, "%s", msg_abnl);
1104 + }
1105 + exit(ERR_VALUE);
1106 + break;
1107 +@@ -448,7 +448,7 @@
1108 + ret = 0;
1109 + break;
1110 + case NOTALC :
1111 +- (void)fprintf(stderr, msg_mem);
1112 ++ (void)fprintf(stderr, "%s", msg_mem);
1113 + ret = -1;
1114 + break;
1115 + case BADF :
1116 +@@ -509,11 +509,11 @@
1117 + ret = -1;
1118 + break;
1119 + case BADARG :
1120 +- (void)fprintf(stderr,msg_fq);
1121 ++ (void)fprintf(stderr,"%s",msg_fq);
1122 + ret = -1;
1123 + break;
1124 + case BADCONT :
1125 +- (void)fprintf(stderr,msg_cnt);
1126 ++ (void)fprintf(stderr,"%s",msg_cnt);
1127 + ret = -1;
1128 + break;
1129 + case NOENT : /* 91.12.03 */
1130 +@@ -526,7 +526,7 @@
1131 + (void)fprintf(stderr, msg_abnls, init);
1132 + }
1133 + else {
1134 +- (void)fprintf(stderr, msg_abnl);
1135 ++ (void)fprintf(stderr, "%s", msg_abnl);
1136 + }
1137 + exit(ERR_VALUE);
1138 + break;
1139 +@@ -556,7 +556,7 @@
1140 + (void)fprintf(stderr, msg_abnls,init);
1141 + }
1142 + else {
1143 +- (void)fprintf(stderr, msg_abnl);
1144 ++ (void)fprintf(stderr, "%s", msg_abnl);
1145 + }
1146 + ret = -1;
1147 + return ret;
1148 +@@ -567,13 +567,13 @@
1149 + (void)fprintf(stderr, msg_mnts, init);
1150 + }
1151 + else {
1152 +- (void)fprintf(stderr, msg_mnt);
1153 ++ (void)fprintf(stderr, "%s", msg_mnt);
1154 + }
1155 + ret = -1;
1156 + return ret;
1157 + }
1158 + if ((mode & PL_DIC) == PL_DIC ) {
1159 +- (void)fprintf(stderr, msg_fq);
1160 ++ (void)fprintf(stderr, "%s", msg_fq);
1161 + ret = -1 ;
1162 + return ret ;
1163 + }
1164 +@@ -608,7 +608,7 @@
1165 + ret = -2; /* 93.03.03 */
1166 + break;
1167 + case BADCONT :
1168 +- (void)fprintf(stderr, msg_cnt);
1169 ++ (void)fprintf(stderr, "%s", msg_cnt);
1170 + ret = -1;
1171 + break;
1172 + default:
1173 +@@ -616,7 +616,7 @@
1174 + (void)fprintf(stderr, msg_abnls, init);
1175 + }
1176 + else {
1177 +- (void)fprintf(stderr, msg_abnl);
1178 ++ (void)fprintf(stderr, "%s", msg_abnl);
1179 + }
1180 + ret = -1;
1181 + break;
1182 +@@ -651,7 +651,7 @@
1183 + ret = -2; /* 93.03.03 */
1184 + break;
1185 + case BADCONT :
1186 +- (void)fprintf(stderr, msg_cnt);
1187 ++ (void)fprintf(stderr, "%s", msg_cnt);
1188 + ret = -1;
1189 + break;
1190 + default:
1191 +@@ -659,7 +659,7 @@
1192 + (void)fprintf(stderr, msg_abnls, init);
1193 + }
1194 + else {
1195 +- (void)fprintf(stderr, msg_abnl);
1196 ++ (void)fprintf(stderr, "%s", msg_abnl);
1197 + }
1198 + ret = -1;
1199 + break;
1200
1201 diff --git a/app-i18n/canna/files/canna-Wformat.patch b/app-i18n/canna/files/canna-Wformat.patch
1202 new file mode 100644
1203 index 000000000..a8f5aa371
1204 --- /dev/null
1205 +++ b/app-i18n/canna/files/canna-Wformat.patch
1206 @@ -0,0 +1,11 @@
1207 +--- a/doc/man/guide/tex/cannaindex.c
1208 ++++ b/doc/man/guide/tex/cannaindex.c
1209 +@@ -198,7 +198,7 @@
1210 + }
1211 + inf = fopen(argv[1], "r");
1212 + if (!inf) {
1213 +- fprintf(stderr, "%s: Can not open file \"%s\".\n", argv[1]);
1214 ++ fprintf(stderr, "%s: Can not open file \"%s\".\n", program, argv[1]);
1215 + exit(1);
1216 + }
1217 + pages = readindex(inf, entries);
1218
1219 diff --git a/app-i18n/canna/files/canna-canuum.patch b/app-i18n/canna/files/canna-canuum.patch
1220 new file mode 100644
1221 index 000000000..293ffbb54
1222 --- /dev/null
1223 +++ b/app-i18n/canna/files/canna-canuum.patch
1224 @@ -0,0 +1,34 @@
1225 +--- a/canuum/configure.in
1226 ++++ b/canuum/configure.in
1227 +@@ -401,7 +401,7 @@
1228 + dnl
1229 + olibs="$LIBS"
1230 + AC_MSG_CHECKING(--with-term-libs argument)
1231 +-AC_ARG_WITH(tlib,
1232 ++AC_ARG_WITH(term-libs,
1233 + [ --with-term-libs=-lLIB terminal library to be used ],)
1234 + if test -n "$with_term_libs"; then
1235 + AC_MSG_RESULT($with_term_libs)
1236 +--- a/canuum/wnn_config.h
1237 ++++ b/canuum/wnn_config.h
1238 +@@ -149,8 +149,8 @@
1239 + #define TTY_KCODE J_EUJIS
1240 + #define PTY_KCODE J_EUJIS
1241 + # else /* !DGUX */
1242 +-#define TTY_KCODE J_JIS
1243 +-#define PTY_KCODE J_JIS
1244 ++#define TTY_KCODE J_EUJIS
1245 ++#define PTY_KCODE J_EUJIS
1246 + # endif
1247 + #endif
1248 +
1249 +--- a/canuum/wnn_os.h
1250 ++++ b/canuum/wnn_os.h
1251 +@@ -41,6 +41,7 @@
1252 + #include <signal.h>
1253 + #if STDC_HEADERS
1254 + # include <stdlib.h>
1255 ++# include <string.h>
1256 + # include <limits.h>
1257 + #endif /* STDC_HEADERS */
1258 +
1259
1260 diff --git a/app-i18n/canna/files/canna-gentoo.patch b/app-i18n/canna/files/canna-gentoo.patch
1261 new file mode 100644
1262 index 000000000..7ff274c2c
1263 --- /dev/null
1264 +++ b/app-i18n/canna/files/canna-gentoo.patch
1265 @@ -0,0 +1,146 @@
1266 +--- a/Canna.conf
1267 ++++ b/Canna.conf
1268 +@@ -109,12 +109,12 @@
1269 + # define DefErrDir $(cannaPrefix)/log
1270 + # define DefLibCannaDir $(cannaExecPrefix)/lib
1271 + #else
1272 +-# define DefCannaPrefix /usr/local/canna
1273 ++# define DefCannaPrefix $(EPREFIX)/usr
1274 + # ifdef ObsoleteInstallDir
1275 + # define DefErrDir /usr/spool/canna
1276 + # define DefLibCannaDir /usr/lib
1277 + # else
1278 +-# define DefErrDir /var/log
1279 ++# define DefErrDir $(EPREFIX)/var/log/$(PN)
1280 + # define DefLibCannaDir $(cannaExecPrefix)/lib
1281 + # endif
1282 + #endif
1283 +@@ -123,7 +123,7 @@
1284 + # define DefCannaLibDir $(cannaPrefix)/lib
1285 + #else
1286 + # define DefCannaSrvDir $(cannaExecPrefix)/sbin
1287 +-# define DefCannaLibDir $(cannaPrefix)/share/canna
1288 ++# define DefCannaLibDir /etc/canna
1289 + #endif
1290 +
1291 + #if defined(LinuxArchitecture) || defined(FreeBSDArchitecture) \
1292 +@@ -147,9 +147,11 @@
1293 + XCOMM cannaLibDir = /var/lib/canna
1294 + XCOMM cannaLibDir = /var/db/canna
1295 + cannaLibDir = DefCannaLibDir
1296 +-XCOMM cannaManDir = $(cannaPrefix)/share/man
1297 +-cannaManDir = $(cannaPrefix)/man
1298 +-cannaIncDir = $(cannaPrefix)/include/canna
1299 ++cannaManDir = $(cannaPrefix)/share/man
1300 ++XCOMM cannaManDir = $(cannaPrefix)/man
1301 ++cannaIncDir = $(cannaPrefix)/include/$(PN)
1302 ++cannaShareDir = $(cannaPrefix)/share/$(PN)
1303 ++cannaDocDir = $(cannaPrefix)/share/doc/$(PF)
1304 +
1305 + libCannaDir = DefLibCannaDir
1306 + ErrDir = DefErrDir
1307 +@@ -237,7 +239,7 @@
1308 + /* #define UseInstalledLibCanna YES */
1309 + #define UseInstalledLibCanna NO
1310 +
1311 +-DicDir = $(cannaLibDir)/dic
1312 ++DicDir = $(EPREFIX)/var/lib/$(PN)/dic
1313 +
1314 + /* ここから下は変更不要です */
1315 +
1316 +--- a/Imakefile
1317 ++++ b/Imakefile
1318 +@@ -87,6 +87,7 @@
1319 + echo "#define CANNAHOSTFILE \"$(cannaLibDir)/cannahost\"";\
1320 + echo "/* for lib/canna */";\
1321 + echo "#define CANNALIBDIR \"$(cannaLibDir)\""; \
1322 ++ echo "#define CANNASHAREDIR \"$(cannaShareDir)\""; \
1323 + echo "#define SUPPORT_OLD_WCHAR $(supportOldWchar)"; \
1324 + echo "/* for scripts */";\
1325 + echo "#define CANNABINDIR $(cannaBinDir)"; \
1326 +--- a/dic/phono/Imakefile
1327 ++++ b/dic/phono/Imakefile
1328 +@@ -27,9 +27,10 @@
1329 +
1330 + ROMAJI_DIC_DEF = -DSHIFT
1331 +
1332 +- DICDIR = $(cannaLibDir)/dic
1333 +- SAMPLEDIR = $(cannaLibDir)/sample
1334 +- SAMPLESRCDIR = $(cannaLibDir)/sample/src
1335 ++ DICDIR = $(DicDir)
1336 ++ CANNASHAREDIR = $(cannaShareDir)
1337 ++ SAMPLEDIR = $(cannaDocDir)/sample
1338 ++ SAMPLESRCDIR = $(cannaDocDir)/sample/src
1339 +
1340 + KPDEF = default.kpdef jdaemon.kpdef just.kpdef kaisoku.kpdef kana.kpdef \
1341 + lan5.kpdef matsu.kpdef newjis.kpdef romaji.kpdef sokuon.kpdef \
1342 +@@ -69,7 +70,7 @@
1343 + MakeDirectories(install,$(DICDIR))
1344 + MakeDirectories(install,$(SAMPLESRCDIR))
1345 +
1346 +-InstallMultiple($(ROMKANA_TABLES),$(DICDIR))
1347 ++InstallMultiple($(ROMKANA_TABLES),$(CANNASHAREDIR))
1348 +
1349 + #ifdef USE_OBSOLETE_STYLE_FILENAME
1350 + InstallNonExec(default.kpdef,$(SAMPLESRCDIR))
1351 +--- a/lib/canna/romaji.c
1352 ++++ b/lib/canna/romaji.c
1353 +@@ -427,7 +427,6 @@
1354 + }
1355 + }
1356 +
1357 +-#if 0 /* currently CANNASHAREDDIR is not defined */
1358 + if (retval == (struct RkRxDic *)NULL) { /* added for Debian by ISHIKAWA Mutsumi <ishikawa@××××××××.jp> */
1359 + extern jrUserInfoStruct *uinfo;
1360 +
1361 +@@ -450,7 +449,6 @@
1362 + }
1363 + }
1364 + }
1365 +-#endif
1366 +
1367 + if (retval == (struct RkRxDic *)NULL) { /* 全部オープンできない */
1368 + sprintf(rdic,
1369 +--- a/misc/Imakefile
1370 ++++ b/misc/Imakefile
1371 +@@ -48,7 +48,7 @@
1372 + MakeLintLibSubdirs($(SUBDIRS))
1373 + MakeLintSubdirs($(SUBDIRS),install.ln,install.ln)
1374 +
1375 +-MakeDirectories(install,$(cannaLibDir)/sample/src)
1376 ++MakeDirectories(install,$(cannaDocDir)/sample/src)
1377 +
1378 + #ifdef USE_OBSOLETE_STYLE_FILENAME
1379 + default.canna: default.ca
1380 +@@ -58,8 +58,8 @@
1381 + $(CP) default.ca default.canna
1382 + #endif
1383 +
1384 + InstallNonExec(default.canna,$(cannaLibDir))
1385 +-InstallNonExec(is.c,$(cannaLibDir)/sample/src)
1386 ++InstallNonExec(is.c,$(cannaDocDir)/sample/src)
1387 +
1388 + clean::
1389 + $(RM) $(PROGRAMS)
1390 +--- a/misc/initfiles/Imakefile
1391 ++++ b/misc/initfiles/Imakefile
1392 +@@ -6,7 +6,7 @@
1393 + #endif
1394 +
1395 + CANNAROOT = ../..
1396 +- SAMPLEDIR = $(cannaLibDir)/sample
1397 ++ SAMPLEDIR = $(cannaDocDir)/sample
1398 +
1399 + all::
1400 +
1401 +--- a/server/Imakefile
1402 ++++ b/server/Imakefile
1403 +@@ -6,7 +6,7 @@
1404 + #ifdef __EMX__
1405 + INSTFLAGS = $(INSTUGIDFLAGS)
1406 + #else
1407 +- INSTFLAGS = -s $(INSTUGIDFLAGS)
1408 ++ INSTFLAGS = $(INSTUGIDFLAGS)
1409 + #endif
1410 + DEFINES = $(CANNASERVER_DEFINES) $(SIGNAL_DEFINES) ConnectionFlags
1411 + INCLUDES = -I$(CANNAROOT)/include
1412
1413 diff --git a/app-i18n/canna/files/canna-kpdef.patch b/app-i18n/canna/files/canna-kpdef.patch
1414 new file mode 100644
1415 index 000000000..b0b71b444
1416 --- /dev/null
1417 +++ b/app-i18n/canna/files/canna-kpdef.patch
1418 @@ -0,0 +1,18 @@
1419 +--- a/dic/phono/default.kpdef
1420 ++++ b/dic/phono/default.kpdef
1421 +@@ -350,3 +350,15 @@
1422 + _ _
1423 + / /
1424 + \\ ¥
1425 ++
1426 ++# some useful romkan symbols
1427 ++z, ‥
1428 ++z- ~
1429 ++z. …
1430 ++z/ ・
1431 ++z[ 『
1432 ++z] 』
1433 ++zh ←
1434 ++zj ↓
1435 ++zk ↑
1436 ++zl →
1437
1438 diff --git a/app-i18n/canna/files/canna-overflow.patch b/app-i18n/canna/files/canna-overflow.patch
1439 new file mode 100644
1440 index 000000000..ef3b6ad1b
1441 --- /dev/null
1442 +++ b/app-i18n/canna/files/canna-overflow.patch
1443 @@ -0,0 +1,20 @@
1444 +--- a/cmd/catdic/rutil.c
1445 ++++ b/cmd/catdic/rutil.c
1446 +@@ -384,7 +384,7 @@
1447 + (void)fprintf(stderr,gettxt("cannacmd:205",
1448 + "Specified dictionary \"%s\" already exists. Do you overwrite it ? (y/n)"),
1449 + dicname);
1450 +- fgets(ans,80,stdin);
1451 ++ fgets(ans,sizeof(ans),stdin);
1452 + } else {
1453 + (void)fprintf(stderr,gettxt("cannacmd:206",
1454 + "Specified dictionary \"%s\" already exists."),dicname);
1455 +@@ -474,7 +474,7 @@
1456 + if (isatty(fileno(stdin)) != 0) {
1457 + (void)fprintf(stderr,gettxt("cannacmd:216",
1458 + "Personal learning file of dictionary \"%s\" exists. Do you overwrite it ? (y/n)"),dicname);
1459 +- fgets(ans,80,stdin);
1460 ++ fgets(ans,sizeof(ans),stdin);
1461 + } else {
1462 + (void)fprintf(stderr,gettxt("cannacmd:217",
1463 + "Personal learning file of system dictionary \"%s\" already exists."),
1464
1465 diff --git a/app-i18n/canna/files/canna-posix-sort.patch b/app-i18n/canna/files/canna-posix-sort.patch
1466 new file mode 100644
1467 index 000000000..1f98aaf5e
1468 --- /dev/null
1469 +++ b/app-i18n/canna/files/canna-posix-sort.patch
1470 @@ -0,0 +1,11 @@
1471 +--- a/cmd/mkbindic/mkbindic.cpp
1472 ++++ b/cmd/mkbindic/mkbindic.cpp
1473 +@@ -40,7 +40,7 @@
1474 + bck_text=;
1475 + flag=;
1476 + compat_flag=;
1477 +-sortcmd="sort -d -s +0 -1"
1478 ++sortcmd="sort -d -s -k 1,1"
1479 + usage="usage: mkbindic [-m|-s] [-name dicname] [-c version] textfile [cpp-args ...]";
1480 + : ${TMPDIR:=/tmp}
1481 +
1482
1483 diff --git a/app-i18n/canna/files/canna-respect-flags.patch b/app-i18n/canna/files/canna-respect-flags.patch
1484 new file mode 100644
1485 index 000000000..13fb1ed9c
1486 --- /dev/null
1487 +++ b/app-i18n/canna/files/canna-respect-flags.patch
1488 @@ -0,0 +1,29 @@
1489 +--- /var/tmp/portage/app-i18n/canna-3.7_p3-r4/work/Canna37p3/canuum/Imakefile
1490 ++++ Canna37p3/canuum/Imakefile
1491 +@@ -51,6 +51,8 @@
1492 + $(CONFIGURE_CMD)
1493 + XCOMM Invoked from confwrapper
1494 + cwenv.sh:
1495 +- $(CANNAROOT)/confwrapper mkenv CPPFLAGS $(ALLDEFINES) > $@
1496 +- $(CANNAROOT)/confwrapper mkenv CC env $(CC) >> $@
1497 ++ $(CANNAROOT)/confwrapper mkenv CPPFLAGS $(ALLDEFINES) $(CPPFLAGS) > $@
1498 ++ $(CANNAROOT)/confwrapper mkenv CC $(CC) >> $@
1499 ++ $(CANNAROOT)/confwrapper mkenv AR $(AR) >> $@
1500 + $(CANNAROOT)/confwrapper mkenv CFLAGS $(PURE_CFLAGS) >> $@
1501 ++ $(CANNAROOT)/confwrapper mkenv LDFLAGS $(LDFLAGS) >> $@
1502 +--- /var/tmp/portage/app-i18n/canna-3.7_p3-r4/work/Canna37p3/Imakefile
1503 ++++ Canna37p3/Imakefile
1504 +@@ -117,9 +117,11 @@
1505 + $(CONFIGURE_CMD)
1506 + XCOMM Invoked from confwrapper
1507 + cwenv.sh:
1508 +- $(CANNAROOT)/confwrapper mkenv CPPFLAGS $(ALLDEFINES) > $@
1509 +- $(CANNAROOT)/confwrapper mkenv CC env $(CC) >> $@
1510 ++ $(CANNAROOT)/confwrapper mkenv CPPFLAGS $(ALLDEFINES) $(CPPFLAGS) > $@
1511 ++ $(CANNAROOT)/confwrapper mkenv CC $(CC) >> $@
1512 ++ $(CANNAROOT)/confwrapper mkenv AR $(AR) >> $@
1513 + $(CANNAROOT)/confwrapper mkenv CFLAGS $(PURE_CFLAGS) >> $@
1514 ++ $(CANNAROOT)/confwrapper mkenv LDFLAGS $(LDFLAGS) >> $@
1515 +
1516 + CANNAROOT = .
1517 + SERVERDIR = server dic/phono dic/ideo
1518
1519 diff --git a/app-i18n/canna/files/canna-rundir.patch b/app-i18n/canna/files/canna-rundir.patch
1520 new file mode 100644
1521 index 000000000..d8c58be49
1522 --- /dev/null
1523 +++ b/app-i18n/canna/files/canna-rundir.patch
1524 @@ -0,0 +1,15 @@
1525 +--- a/Canna.conf
1526 ++++ b/Canna.conf
1527 +@@ -341,10 +341,10 @@
1528 + #endif
1529 +
1530 + #ifdef InstallAsUser
1531 +-UnixSockDir = $(cannaPrefix)/tmp/.iroha_unix
1532 ++UnixSockDir = $(cannaPrefix)/run/.iroha_unix
1533 + AccessFile = $(cannaPrefix)/etc/hosts.canna
1534 + #else
1535 +-UnixSockDir = /tmp/.iroha_unix
1536 ++UnixSockDir = /run/.iroha_unix
1537 + AccessFile = /etc/hosts.canna
1538 + #endif
1539 + UnixSockName = IROHA
1540
1541 diff --git a/app-i18n/canna/files/canna-tmpfiles.conf b/app-i18n/canna/files/canna-tmpfiles.conf
1542 new file mode 100644
1543 index 000000000..8b70ef1a1
1544 --- /dev/null
1545 +++ b/app-i18n/canna/files/canna-tmpfiles.conf
1546 @@ -0,0 +1,2 @@
1547 +d /run/.iroha_unix 0755 canna canna -
1548 +
1549
1550 diff --git a/app-i18n/canna/files/canna.confd b/app-i18n/canna/files/canna.confd
1551 new file mode 100644
1552 index 000000000..d3fdce542
1553 --- /dev/null
1554 +++ b/app-i18n/canna/files/canna.confd
1555 @@ -0,0 +1,7 @@
1556 +CANNASERVER_ENABLE_SYSLOG="yes"
1557 +
1558 +# Specify user to run as
1559 +CANNASERVER_OWNER="bin"
1560 +
1561 +# Options for cannaserver
1562 +CANNASERVER_OPTS=""
1563
1564 diff --git a/app-i18n/canna/files/canna.hosts b/app-i18n/canna/files/canna.hosts
1565 new file mode 100644
1566 index 000000000..509143d86
1567 --- /dev/null
1568 +++ b/app-i18n/canna/files/canna.hosts
1569 @@ -0,0 +1 @@
1570 +unix
1571
1572 diff --git a/app-i18n/canna/files/canna.initd b/app-i18n/canna/files/canna.initd
1573 new file mode 100644
1574 index 000000000..fdfc3fc20
1575 --- /dev/null
1576 +++ b/app-i18n/canna/files/canna.initd
1577 @@ -0,0 +1,31 @@
1578 +#!/sbin/openrc-run
1579 +# Copyright 1999-2022 Gentoo Authors
1580 +# Distributed under the terms of the GNU General Public License v2
1581 +
1582 +command="/usr/sbin/${RC_SVCNAME}server"
1583 +command_args="${CANNASERVER_OPTS}"
1584 +
1585 +# CANNASERVER_OPTS and CANNASERVER_OWNER is defined in /etc/conf.d/canna
1586 +CANNASERVER_LOGFILE="/var/log/${RC_SVCNAME}/CANNA0msgs"
1587 +
1588 +depend() {
1589 + use logger
1590 + need net
1591 +}
1592 +
1593 +start_pre() {
1594 + if [ "${CANNASERVER_ENABLE_SYSLOG}" = "yes" ]; then
1595 + command_args="${command_args} -syslog"
1596 + elif [ -z "${CANNASERVER_OWNER}" ]; then
1597 + checkpath "${CANNASERVER_LOGFILE}"
1598 + else
1599 + checkpath -o "${CANNASERVER_OWNER}" "${CANNASERVER_LOGFILE}"
1600 + command_args="${command_args} -u ${CANNASERVER_OWNER}"
1601 + fi
1602 +}
1603 +
1604 +stop() {
1605 + ebegin "Stopping ${name:-${RC_SVCNAME}}"
1606 + /usr/sbin/${RC_SVCNAME}kill
1607 + eend ${?}
1608 +}
1609
1610 diff --git a/app-i18n/canna/files/canna.service b/app-i18n/canna/files/canna.service
1611 new file mode 100644
1612 index 000000000..1bd0498fb
1613 --- /dev/null
1614 +++ b/app-i18n/canna/files/canna.service
1615 @@ -0,0 +1,12 @@
1616 +[Unit]
1617 +Description=Canna Japanese Conversion Engine
1618 +After=syslog.target
1619 +
1620 +[Service]
1621 +User=canna
1622 +Type=forking
1623 +ExecStart=/usr/sbin/cannaserver -syslog
1624 +ExecStop=/usr/sbin/cannakill
1625 +
1626 +[Install]
1627 +WantedBy=multi-user.target
1628
1629 diff --git a/app-i18n/canna/files/cannaping.c b/app-i18n/canna/files/cannaping.c
1630 new file mode 100644
1631 index 000000000..67f49808b
1632 --- /dev/null
1633 +++ b/app-i18n/canna/files/cannaping.c
1634 @@ -0,0 +1,46 @@
1635 +/*
1636 + * cannaping - the minimal cannaserver check program
1637 + *
1638 + * Copyright (C) 2003 Red Hat, Inc.
1639 + *
1640 + * This library is free software; you can redistribute it and/or
1641 + * modify it under the terms of the GNU Library General Public
1642 + * License as published by the Free Software Foundation; either
1643 + * version 2 of the License, or (at your option) any later version.
1644 + *
1645 + * This library is distributed in the hope that it will be useful,
1646 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
1647 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
1648 + * Library General Public License for more details.
1649 + *
1650 + * You should have received a copy of the GNU Library General Public
1651 + * License along with this library; if not, write to the
1652 + * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
1653 + * Boston, MA 02111-1307, USA.
1654 + */
1655 +
1656 +/*
1657 + * Bugs & suggestions about this program are welcome:
1658 + * http://bugzilla.redhat.com/
1659 + *
1660 + * 2003/02/04
1661 + * Yukihiro Nakai <ynakai@××××××.com>
1662 + */
1663 +
1664 +#include <stdio.h>
1665 +#include <stdlib.h>
1666 +#include <canna/jrkanji.h>
1667 +
1668 +int main() {
1669 + char** warning = NULL;
1670 + int res = jrKanjiControl(0, KC_INITIALIZE, (char*)&warning);
1671 +
1672 + if( res != 0 ) {
1673 + exit(-1);
1674 + } else if( warning ) {
1675 + exit(-1);
1676 + }
1677 +
1678 + jrKanjiControl(0, KC_FINALIZE, 0);
1679 + return 0;
1680 +}
1681
1682 diff --git a/app-i18n/canna/files/dot-canna b/app-i18n/canna/files/dot-canna
1683 new file mode 100644
1684 index 000000000..37fdc2f27
1685 --- /dev/null
1686 +++ b/app-i18n/canna/files/dot-canna
1687 @@ -0,0 +1,195 @@
1688 +;; Copyright 1992 NEC Corporation, Tokyo, Japan.
1689 +;;
1690 +;; Permission to use, copy, modify, distribute and sell this software
1691 +;; and its documentation for any purpose is hereby granted without
1692 +;; fee, provided that the above copyright notice appear in all copies
1693 +;; and that both that copyright notice and this permission notice
1694 +;; appear in supporting documentation, and that the name of NEC
1695 +;; Corporation not be used in advertising or publicity pertaining to
1696 +;; distribution of the software without specific, written prior
1697 +;; permission. NEC Corporation makes no representations about the
1698 +;; suitability of this software for any purpose. It is provided "as
1699 +;; is" without express or implied warranty.
1700 +;;
1701 +;; NEC CORPORATION DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
1702 +;; INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN
1703 +;; NO EVENT SHALL NEC CORPORATION BE LIABLE FOR ANY SPECIAL, INDIRECT OR
1704 +;; CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
1705 +;; USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
1706 +;; OTHER TORTUOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
1707 +;; PERFORMANCE OF THIS SOFTWARE.
1708 +
1709 +;; $Id: dot-canna,v 1.1 2005/09/26 09:29:14 tagoh Exp $
1710 +
1711 +;; 記号置き換え変換を利用するか。
1712 +
1713 +(setq use-symbolic-definition t)
1714 +
1715 +;;; ローマ字かな変換の設定
1716 +;
1717 +; ローマ字かな変換テーブルを指定します。ローマ字かな変換テーブルは
1718 +; (1) カレントディレクトリ
1719 +; (2) ホームディレクトリ
1720 +; (3) /usr/lib/canna/dic
1721 +; の順にサーチされます。
1722 +;
1723 +
1724 +;(setq romkana-table "unix.cbp")
1725 +(setq romkana-table "default.cbp")
1726 +
1727 +;; 外来語変換
1728 +;(setq english-table "canna/english.cbp")
1729 +
1730 +
1731 +;;; 利用する辞書
1732 +;
1733 +; ただ単に書き並べているのは単語登録を行わない辞書でシステム辞書などが
1734 +; これに当たります。
1735 +;
1736 +; 部首辞書に関しては :bushu を先行させて記述します。
1737 +;
1738 +; 単語登録をしたい辞書に関しては :user を先行させて記述します。単語登
1739 +; 録をする辞書はテキスト形式辞書でなければなりません。単語登録させたい
1740 +; 辞書は mkdic user の様なコマンドを打つことでで簡単に作成することがで
1741 +; きます。
1742 +;
1743 +(use-dictionary
1744 + "gcanna"
1745 + "gcannaf"
1746 + "chimei"
1747 +; "iroha"
1748 + "fuzokugo"
1749 + "hojomwd"
1750 + "hojoswd"
1751 + "software"
1752 + "keishiki"
1753 + "zipcode"
1754 + "geo"
1755 +; "zip99"
1756 + "basho"
1757 + "keisan"
1758 + "pub"
1759 + "scien"
1760 + "sup"
1761 + "bonobo"
1762 + :bushu "bushu"
1763 + :user "user"
1764 + )
1765 +
1766 +;;; さまざまなパラメタの設定
1767 +;
1768 +; 真理値を設定するものについては真については t 、偽については nil を設
1769 +; 定します。
1770 +
1771 +; 一番右で右に行こうとすると左端にいくようにするか
1772 +(setq cursor-wrap t) ; default t
1773 +
1774 +; 一覧表示で数字を打ったときにカーソル移動に留める(nil)か選択までして
1775 +; しまうか(t)
1776 +(setq select-direct t) ; default t
1777 +
1778 +; 一覧表示で数字で選択するか(t)。nilの時は数字が表示されません
1779 +(setq numerical-key-select t) ; default t
1780 +
1781 +; 候補表示時に文節の区切りに空白をいれるか
1782 +(setq bunsetsu-kugiri nil) ; default nil
1783 +
1784 +; 文字ベースの移動をするか(t)。 nilの時はローマ字かな変換の単位でカー
1785 +; ソル移動が行われます。
1786 +(setq character-based-move t) ; default t
1787 +
1788 +; 入力中の読み全体をリバースするか
1789 +(setq reverse-widely nil) ; default nil
1790 +
1791 +; 頻度学習をするか
1792 +(setq gakushu t) ; default t
1793 +
1794 +; 一覧の最後までいったら一旦一覧表示をやめるか
1795 +(setq quit-if-end-of-ichiran nil); default nil
1796 +
1797 +; 文節の右端で右移動をすると全体が確定してしまうか
1798 +(setq kakutei-if-end-of-bunsetsu nil) ; default nil
1799 +
1800 +; 一覧選択後同じ文節にとどまるか(t)。nilの時は一覧選択を行うとひとつ先
1801 +; の文節に移動します。
1802 +(setq stay-after-validate t) ; default t
1803 +
1804 +; 読みを入力中にバックスペースを打つとローマ字までバラバラにするか
1805 +(setq break-into-roman t) ; default nil
1806 +
1807 +; 何回の変換キーで一覧表示を行うか。0を入れると変換キーだけでは
1808 +; 一覧表示には移りません。その場合には C-w を入力して一覧表示して
1809 +; 下さい。
1810 +(setq n-henkan-for-ichiran 2) ; default 2
1811 +
1812 +; 単語登録時に文法関連の質問をするか(t)。nilの時は適当な品詞を付けてし
1813 +; まいます。
1814 +(setq gramatical-question t) ; default t
1815 +
1816 +; 候補が全体の何番目かを表示するか
1817 +(setq kouho-count t) ; default t
1818 +
1819 +; 逐次変換をするか
1820 +(setq auto nil) ; default nil
1821 +
1822 +; 逐次変換をする時に何個の文節までを未確定で保持するか
1823 +(setq n-kouho-bunsetsu 16) ; default 16
1824 +
1825 +; ローマ字かな変換でイリーガルなローマ字を捨てるか
1826 +(setq abandon-illegal-phonogram nil) ; default nil
1827 +
1828 +; 一覧の時も次の入力を認めるか
1829 +(setq allow-next-input t) ; default t
1830 +
1831 +; 一文字レベルのローマ字かな変換の補助テーブル
1832 +(if use-symbolic-definition
1833 + (progn
1834 + (defsymbol ?- "ー" "-" "-" "‐")
1835 + (defsymbol ?/ "/" "/" "・")
1836 + (defsymbol ?\\ "\\" "\" "¥")
1837 + (defsymbol
1838 + ?( "(" "(" "【"
1839 + ?) ")" ")" "】" )
1840 + (defsymbol
1841 + ?[ "「" "『" "[" "〔" "["
1842 + ?] "」" "』" "]" "〕" "]")
1843 + (defsymbol
1844 + ?. "。" "." "."
1845 + ?, "、" "," "," )
1846 + (defsymbol
1847 + ?0 "0" "0" "〇" "零"
1848 + ?1 "1" "1" "一" "壱"
1849 + ?2 "2" "2" "二" "弐"
1850 + ?3 "3" "3" "三" "参"
1851 + ?4 "4" "4" "四" "四"
1852 + ?5 "5" "5" "五" "伍"
1853 + ?6 "6" "6" "六" "六"
1854 + ?7 "7" "7" "七" "七"
1855 + ?8 "8" "8" "八" "八"
1856 + ?9 "9" "9" "九" "九" )
1857 + (defsymbol
1858 + ?? "?" "?"
1859 + ?! "!" "!")
1860 + (defsymbol ?# "#" "#")
1861 + (defsymbol ?$ "$" "$")
1862 + (defsymbol ?% "%" "%")
1863 + (defsymbol ?& "&" "&")
1864 + (defsymbol ?+ "+" "+")
1865 + (defsymbol ?* "*" "*" "×")
1866 + (defsymbol ?_ "_" "_")
1867 + (defsymbol ?' "'" "’")
1868 + (defsymbol ?` "`" "‘")
1869 + (defsymbol ?\" "\"" "”")
1870 + ))
1871 +
1872 +;; delete キーもバックスペースと同じ処理をさせる
1873 +(global-set-key "\Delete" 'delete-previous) ; necessary in using Emacs
1874 +
1875 +;; Help がない人もいるので F1 でも同じ動作をさせる。
1876 +(global-set-key "\F1" 'extend-mode)
1877 +
1878 +;; Escape key should escape from the mode.
1879 +(global-set-key "\Escape" 'quit)
1880 +
1881 +;; Ctrl-o の抑制
1882 +(global-unbind-key-function 'japanese-mode)
1883
1884 diff --git a/app-i18n/canna/files/update-canna-dics_dir b/app-i18n/canna/files/update-canna-dics_dir
1885 new file mode 100644
1886 index 000000000..b4061c885
1887 --- /dev/null
1888 +++ b/app-i18n/canna/files/update-canna-dics_dir
1889 @@ -0,0 +1,36 @@
1890 +#!/bin/sh
1891 +# update-canna-dics_dir
1892 +# compiles dics.dir files for Canna Server
1893 +# Copyright 2001 ISHIKAWA Mutsumi
1894 +# Licensed under the GNU General Public License, version 2. See the file
1895 +# /usr/share/common-licenses/GPL or <http://www.gnu.org/copyleft/gpl.txt>.
1896 +
1897 +SRC=/etc/canna/dics.dir.d
1898 +DEST=/var/lib/canna/dic/canna
1899 +
1900 +for DIR in $SRC $DEST; do
1901 + VALID=yes
1902 + if [ ! -d $DIR ]; then
1903 + echo "$0: $DIR does not exist or is not a directory." >&2
1904 + VALID=
1905 + fi
1906 +done
1907 +
1908 +if [ -n "$VALID" ]; then
1909 + # write new dics.dir file in case we are interrupted
1910 + echo '# dics.dir -- automatically generated file. DO NOT EDIT.' > $DEST/dics.dir.update-new
1911 +# echo '# To modify, see update-canna-dics_dir(8). >> $DEST/dics.dir.update-new
1912 + # are there any files to process?
1913 + if [ "$(echo $SRC/*.dics.dir)" != "$SRC/*.dics.dir" ]; then
1914 + for file in $SRC/*.dics.dir; do
1915 + echo "# $file" >> $DEST/dics.dir.update-new
1916 + cat $file >> $DEST/dics.dir.update-new
1917 + done
1918 + mv $DEST/dics.dir.update-new $DEST/dics.dir
1919 + else
1920 + # no files to process, remove the one
1921 + rm -f $DEST/dics.dir
1922 + fi
1923 +fi
1924 +
1925 +exit
1926
1927 diff --git a/app-i18n/canna/metadata.xml b/app-i18n/canna/metadata.xml
1928 new file mode 100644
1929 index 000000000..88181e8f0
1930 --- /dev/null
1931 +++ b/app-i18n/canna/metadata.xml
1932 @@ -0,0 +1,12 @@
1933 +<?xml version="1.0" encoding="UTF-8"?>
1934 +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
1935 +<pkgmetadata>
1936 + <maintainer type="person">
1937 + <description>co-maintainers welcome</description>
1938 + <name>Alessandro Barbieri</name>
1939 + <email>lssndrbarbieri@×××××.com</email>
1940 + </maintainer>
1941 + <use>
1942 + <flag name="canuum">Build canuum</flag>
1943 + </use>
1944 +</pkgmetadata>