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