/[gentoo-x86]/eclass/myspell-r2.eclass
Gentoo

Contents of /eclass/myspell-r2.eclass

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.8 - (show annotations) (download)
Wed Oct 24 14:44:40 2012 UTC (2 years ago) by scarabeus
Branch: MAIN
Changes since 1.7: +13 -1 lines
Add some boring debug prints and error+die when hunspell folder is symlink. Should fix bug#438792.

1 # Copyright 1999-2012 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/eclass/myspell-r2.eclass,v 1.7 2012/07/23 14:11:26 scarabeus Exp $
4
5 # @ECLASS: aspell-dict.eclass
6 # @MAINTAINER:
7 # app-dicts@gentoo.org
8 # @AUTHOR:
9 # Tomáš Chvátal <scarabeus@gentoo.org>
10 # @BLURB: An eclass to ease the construction of ebuilds for myspell dicts
11 # @DESCRIPTION:
12
13 inherit base
14
15 EXPORT_FUNCTIONS src_unpack src_install
16
17 # @ECLASS-VARIABLE: MYSPELL_DICT
18 # @DEFAULT_UNSET
19 # @DESCRIPTION:
20 # Array variable containing list of all dictionary files.
21 # MYSPELL_DICT=( "file.dic" "dir/file2.aff" )
22
23 # @ECLASS-VARIABLE: MYSPELL_HYPH
24 # @DESCRIPTION:
25 # Array variable containing list of all hyphenation files.
26 # MYSPELL_HYPH=( "file.dic" "dir/file2.dic" )
27
28 # @ECLASS-VARIABLE: MYSPELL_THES
29 # @DESCRIPTION:
30 # Array variable containing list of all thesarus files.
31 # MYSPELL_HYPH=( "file.dat" "dir/file2.idx" )
32
33 # Basically no extra deps needed.
34 # Unzip is required for .oxt libreoffice extensions
35 # which are just fancy zip files.
36 DEPEND="app-arch/unzip"
37 RDEPEND=""
38
39 # by default this stuff does not have any folder in the pack
40 S="${WORKDIR}"
41
42 # @FUNCTION: myspell-r2_src_unpack
43 # @DESCRIPTION:
44 # Unpack all variants of weird stuff.
45 # In our case .oxt packs.
46 myspell-r2_src_unpack() {
47 debug-print-function ${FUNCNAME} "$@"
48
49 local f
50 for f in ${A}; do
51 case ${f} in
52 *.oxt)
53 echo ">>> Unpacking "${DISTDIR}/${f}" to ${PWD}"
54 unzip -qoj ${DISTDIR}/${f}
55 assert "failed unpacking ${DISTDIR}/${f}"
56 ;;
57 *) unpack ${f} ;;
58 esac
59 done
60 }
61
62 # @FUNCTION: myspell-r2_src_install
63 # @DESCRIPTION:
64 # Install the dictionaries to the right places.
65 myspell-r2_src_install() {
66 debug-print-function ${FUNCNAME} "$@"
67
68 local x target
69
70 # Following the debian directory layout here.
71 # DICT: /usr/share/hunspell
72 # THES: /usr/share/mythes
73 # HYPH: /usr/share/hyphen
74 # We just need to copy the required files to proper places.
75
76 # TODO: backcompat dosym remove when all dictionaries and libreoffice
77 # ebuilds in tree use only the new paths
78
79 # Very old installs have hunspell to be symlink to myspell.
80 # This results in fcked up install/symlink stuff.
81 if [[ -L "${EPREFIX}/usr/share/hunspell" ]] ; then
82 eerror "\"${EPREFIX}/usr/share/hunspell\" is a symlink."
83 eerror "Please remove it so it is created properly as folder"
84 die "\"${EPREFIX}/usr/share/hunspell\" is a symlink."
85 fi
86
87 insinto /usr/share/hunspell
88 for x in "${MYSPELL_DICT[@]}"; do
89 target="${x##*/}"
90 newins "${x}" "${target}" || die
91 dosym /usr/share/hunspell/"${target}" /usr/share/myspell/"${target}" || die
92 done
93
94 insinto /usr/share/mythes
95 for x in "${MYSPELL_THES[@]}"; do
96 target="${x##*/}"
97 newins "${x}" "${target}" || die
98 dosym /usr/share/mythes/"${target}" /usr/share/myspell/"${target}" || die
99 done
100
101 insinto /usr/share/hyphen
102 for x in "${MYSPELL_HYPH[@]}"; do
103 target="${x##*/}"
104 newins "${x}" "${target}" || die
105 dosym /usr/share/hyphen/"${target}" /usr/share/myspell/"${target}" || die
106 done
107
108 # Remove licenses as they suffix them with .txt too
109 rm -rf COPYING*
110 rm -rf LICENSE*
111 rm -rf LICENCE*
112 rm -rf license*
113 rm -rf licence*
114 # Readme and so on
115 for x in *.txt README*; do
116 if [[ -f ${x} ]]; then
117 dodoc ${x} || die
118 fi
119 done
120 }

  ViewVC Help
Powered by ViewVC 1.1.20