summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: a9de968a66efe72f15826cc4e5e5428940f774be (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
# Maintainer: Einhard Leichtfuß <alguien@respiranto.de>
#
# Generated by aur-fd-scripts - https://git.respiranto.de/aur-fd-scripts.git/

_lang=deu-fra
pkgname="dict-freedict-${_lang}"
_pkgver=2023.05.29
pkgver="${_pkgver//-/_}"
pkgrel=1
pkgdesc="German -> French dictionary for dictd et al. from FreeDict.org"
arch=('any')
url="https://freedict.org/"
license=('CCPL:by-sa' 'FDL')
optdepends=('dictd: dict client and server')
makedepends=('freedict-tools')
install="${pkgname}.install"
source=("https://download.freedict.org/dictionaries/${_lang}/${_pkgver}/freedict-${_lang}-${_pkgver}.src.tar.xz")
sha512sums=('98ddf4933c56563fec52e0f4e6e45eae5020edca25e6109448e26092ea919c64768694a815133613e88e697f43d1c9f0ee5d2bc83588f83102c46bfee35505f5')

prepare()
{
	cd "${srcdir}/${_lang}"
	sed -Ei \
		-e 's/(10)(10)(100\>)(\s+\(10)(Googol.*(1|Eins) mit einem Googol Nullen)/\1^(\2^\3)\4^\5/' \
		-e 's/(10)([1-9][0-9]*)(.*(1|Eins) mit \2 Nullen)/\1\^\2\3/' \
		-e 's/(die Zahl 10)(60)/\1^\2/' \
		"${_lang}.tei"
}

build()
{
	cd "$_lang"
	make FREEDICT_TOOLS=/usr/lib/freedict-tools build-dictd
}

package()
{
	install -m 755 -d "${pkgdir}/usr/share/dictd"
	install -m 644 -t "${pkgdir}/usr/share/dictd/" \
		"${_lang}/build/dictd/${_lang}".{dict.dz,index}

	for file in "$_lang"/{AUTHORS,README,NEWS,ChangeLog}
	do
		if test -f "$file"
		then
			install -m 644 -Dt "${pkgdir}/usr/share/doc/freedict/${_lang}/" "$file"
		fi
	done
}