Line 0
Link Here
|
|
|
1 |
# Copyright 1999-2019 Gentoo Authors |
2 |
# Distributed under the terms of the GNU General Public License v2 |
3 |
|
4 |
EAPI=7 |
5 |
|
6 |
WV=${PV%_p*} |
7 |
GV=${WV//.} |
8 |
|
9 |
SN="web1913-dict-patches" |
10 |
SV=${PV##*_} |
11 |
SD="$SN-$SV" |
12 |
|
13 |
DESCRIPTION="Webster's Revised Unabridged Dictionary (1913) for dict" |
14 |
HOMEPAGE="http://www.micra.com/" |
15 |
SRC_URI="http://www.gutenberg.org/files/660/old/pgw${GV}ab.zip \ |
16 |
http://www.gutenberg.org/files/661/old/pgw${GV}c.zip \ |
17 |
http://www.gutenberg.org/files/662/old/pgw${GV}de.zip \ |
18 |
http://www.gutenberg.org/files/663/old/pgw${GV}fh.zip \ |
19 |
http://www.gutenberg.org/files/664/old/pgw${GV}il.txt \ |
20 |
http://www.gutenberg.org/files/665/old/pgw${GV}mo.zip \ |
21 |
http://www.gutenberg.org/files/666/old/pgw${GV}pq.zip \ |
22 |
http://www.gutenberg.org/files/667/old/pgw${GV}r.zip \ |
23 |
http://www.gutenberg.org/files/668/old/pgw${GV}s.zip \ |
24 |
http://www.gutenberg.org/files/669/old/pgw${GV}tw.zip \ |
25 |
http://www.gutenberg.org/files/670/old/pgw${GV}xz.zip \ |
26 |
https://git.sr.ht/~ag_eitilt/$SN/archive/$SV.tar.gz -> $SD.tar.gz" |
27 |
|
28 |
LICENSE="GPL-2" |
29 |
SLOT="0" |
30 |
IUSE="" |
31 |
KEYWORDS="amd64 ppc ppc64 sparc x86" |
32 |
|
33 |
DEPEND=">=app-text/dictd-1.5.5 \ |
34 |
dev-libs/libxslt" |
35 |
|
36 |
S="$WORKDIR" |
37 |
|
38 |
src_unpack() { |
39 |
unpack ${A//pgw${GV}il.txt} |
40 |
cp "$DISTDIR/pgw${GV}il.txt" . |
41 |
cp "$SD/xhtml-lat1.ent" "$SD/xhtml-special.ent" "$SD/xhtml-symbol.ent" . |
42 |
cp "$SD/dictfmt-elements.txt" web1913.txt |
43 |
} |
44 |
|
45 |
src_prepare() { |
46 |
eapply "$SD/tag-nesting.patch" |
47 |
eapply_user |
48 |
|
49 |
sed -e '/<! Begin file/,$ d' pgw050c.txt > COPYING.gutenberg |
50 |
|
51 |
for f in $(ls pgw$GV?*.txt) ; do |
52 |
echo "Cleaning '$f'" |
53 |
sed -n -e '/<! Begin file/,$ p' -i "$f" |
54 |
sed -f "$SD/cleanup.sed" -i "$f" |
55 |
cat "$SD/micra-head.xml" "$f" "$SD/micra-foot.xml" > "${f%txt}xml" |
56 |
done |
57 |
} |
58 |
|
59 |
src_compile() { |
60 |
for f in $(ls pgw050?*.xml) ; do |
61 |
echo "Processing '$f'" |
62 |
xsltproc "$SD/dictfmt-elements.xsl" "$f" >> web1913.txt |
63 |
done |
64 |
echo "Building dictionary" |
65 |
dictfmt -u "https://micra.com" \ |
66 |
-s "Webster's Revised Unabridged Dictionary, 1913 edition (v$WV $SV)" \ |
67 |
--headword-separator " / " \ |
68 |
--columns 73 \ |
69 |
--utf8 \ |
70 |
-p web1913 \ |
71 |
< web1913.txt |
72 |
dictzip web1913.dict |
73 |
} |
74 |
|
75 |
src_install() { |
76 |
dodoc COPYING.gutenberg "$SD/README" |
77 |
newdoc "$SD/dictfmt-elements.txt" COPYING.micra |
78 |
insinto /usr/lib/dict |
79 |
doins web1913.dict.dz web1913.index || die |
80 |
} |