skk-jisyo-201101.ebuild 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. # Copyright 1999-2013 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI="3"
  4. DESCRIPTION="Jisyo (dictionary) files for the SKK Japanese-input software"
  5. HOMEPAGE="http://openlab.ring.gr.jp/skk/dic.html"
  6. SRC_URI="mirror://gentoo/${P}.tar.bz2"
  7. LICENSE="GPL-2 public-domain freedist"
  8. SLOT="0"
  9. KEYWORDS="amd64 hppa ppc ppc64 x86 ~amd64-linux ~x86-linux ~ppc-macos ~sparc-solaris"
  10. IUSE="cdb"
  11. COMMON_DEPEND="cdb? ( dev-db/cdb )"
  12. DEPEND="${COMMON_DEPEND}
  13. sys-apps/gawk"
  14. RDEPEND="${COMMON_DEPEND}
  15. !app-i18n/skk-jisyo-extra
  16. !app-i18n/skk-jisyo-cdb"
  17. src_prepare() {
  18. rm SKK-JISYO.wrong.annotated SKK-JISYO.china_taiwan.header
  19. rm SKK-JISYO.noregist SKK-JISYO.not_wrong SKK-JISYO.hukugougo
  20. rm SKK-JISYO.notes SKK-JISYO.requested SKK-JISYO.pubdic+
  21. }
  22. src_compile() {
  23. # bug 184457
  24. unset LANG LC_ALL LC_CTYPE
  25. for f in SKK-JISYO.* zipcode/SKK-JISYO.* ; do
  26. mv ${f} ${f}.annotated
  27. gawk -f "${FILESDIR}"/unannotation.awk ${f}.annotated > $(basename ${f}) || die
  28. if use cdb ; then
  29. gawk '
  30. /^[^;]/ {
  31. s = substr($0, index($0, " ") + 1)
  32. print "+" length($1) "," length(s) ":" $1 "->" s
  33. }
  34. END {
  35. print ""
  36. }
  37. ' $(basename ${f}) | cdbmake $(basename ${f}).cdb "${T}"/$(basename ${f}) || die
  38. fi
  39. rm ${f}.annotated
  40. done
  41. }
  42. src_install() {
  43. # install dictionaries
  44. insinto /usr/share/skk
  45. doins SKK-JISYO.* || die
  46. dodoc ChangeLog* READMEs/committers.txt edict_doc.txt || die
  47. }