diff options
author | Einhard Leichtfuß | 2018-03-31 01:14:24 +0200 |
---|---|---|
committer | Einhard Leichtfuß | 2018-03-31 22:38:36 +0200 |
commit | 4b59ec54b81965b7f82ead54e7701d452f83ccc7 (patch) | |
tree | 9694440a49dc9b72fa981e370ec4eb56ac43e7f8 | |
download | aur-4b59ec54b81965b7f82ead54e7701d452f83ccc7.tar.gz |
Initial commit
Establish a properly named binary replacement for dict-freedict-deu-fra,
now being based on sources.
-rw-r--r-- | .SRCINFO | 16 | ||||
-rw-r--r-- | PKGBUILD | 40 | ||||
-rw-r--r-- | dict-freedict-deu-fra-bin.install | 78 |
3 files changed, 134 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 000000000000..609661d04898 --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,16 @@ +pkgbase = dict-freedict-deu-fra-bin + pkgdesc = German -> French dictionary for dictd et al. from Freedict.org + pkgver = 2017_11_24 + pkgrel = 1 + url = http://www.freedict.org/ + install = dict-freedict-deu-fra-bin.install + arch = any + license = GPL + optdepends = dictd: dict client and server + provides = dict-freedict-deu-fra + conflicts = dict-freedict-deu-fra + source = https://sourceforge.net/projects/freedict/files/deu-fra/2017-11-24/freedict-deu-fra-2017-11-24.dictd.tar.xz + sha512sums = c90a1f76b26f677acb701209335bb777764154ad9ae1823da06887466422624b834190c1bcf0ff3512e03f0457be11e404cf78656560de2e31fcaec12de14986 + +pkgname = dict-freedict-deu-fra-bin + diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 000000000000..3daa0442ac9f --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,40 @@ +# Maintainer: Einhard Leichtfuß <alguien@respiranto.de> +_lang=deu-fra +_pkgname=dict-freedict-${_lang} +pkgname=${_pkgname}-bin +pkgver=2017_11_24 +_pkgver=${pkgver//_/-} +pkgrel=1 +pkgdesc="German -> French dictionary for dictd et al. from Freedict.org" +arch=('any') +url="http://www.freedict.org/" +license=('GPL') +optdepends=('dictd: dict client and server') +provides=(${_pkgname}) +conflicts=(${_pkgname}) +install=${pkgname}.install +source=("https://sourceforge.net/projects/freedict/files/${_lang}/${_pkgver}/freedict-${_lang}-${_pkgver}.dictd.tar.xz") +sha512sums=('c90a1f76b26f677acb701209335bb777764154ad9ae1823da06887466422624b834190c1bcf0ff3512e03f0457be11e404cf78656560de2e31fcaec12de14986') + +prepare() +{ + cd $_lang + dictzip -d ${_lang}.dict.dz + sed -i 's/\(10\)\(100\>.*1 mit 100 Nullen\)/\1\^\2/' ${_lang}.dict + dictzip ${_lang}.dict +} + +package() +{ + install -m 755 -d "${pkgdir}/usr/share/dictd" + install -m 644 -t "${pkgdir}/usr/share/dictd/" \ + ${_lang}/${_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 +} diff --git a/dict-freedict-deu-fra-bin.install b/dict-freedict-deu-fra-bin.install new file mode 100644 index 000000000000..b8ab6a68a77d --- /dev/null +++ b/dict-freedict-deu-fra-bin.install @@ -0,0 +1,78 @@ +basename=deu-fra +pkgname=dict-freedict-$basename-bin +dictd_conf=/etc/dict/dictd.conf +datadir=/usr/share/dictd +conf="database $basename { + data $datadir/$basename.dict.dz + index $datadir/$basename.index +}" + +post_install() +{ + echo + if pacman -Qq dictd > /dev/null 2>&1 + then + if grep -q "^database *$basename" "$dictd_conf" + then + echo "$pkgname already configured in $dictd_conf" + else + echo "Adding configuration for $pkgname to $dictd_conf" + echo "$conf" >> "$dictd_conf" + fi + + if systemctl -q is-active dictd.service + then + echo "Restarting dictd service in order to" \ + "use the new dictionary database" + systemctl restart dictd.service + else + echo "Starting dictd service in order to" \ + "use the new dictionary database" + systemctl start dictd.service + fi + else + echo "dictd does not appear to be installed." + echo "In order to use this database you should either" \ + "install dictd or alternatively" \ + "another dict server and configure it on your own." + fi + echo +} + +post_upgrade() +{ + if pacman -Qq dictd > /dev/null 2>&1 && \ + systemctl -q is-active dictd.service + then + echo -e "\nRestarting dictd service in order to" \ + "use the updated dictionary database" + systemctl restart dictd.service + fi +} + +post_remove() +{ + if pacman -Qq dictd > /dev/null 2>&1 + then + current_conf="$(grep -A 3 "^database *$basename" "$dictd_conf")" + if test -n "$current_conf" + then + echo + if test "$current_conf" = "$conf" + then + echo "Removing configuration for $pkgname from $dictd_conf" + sed -i "/database $basename {/,/}/d" "$dictd_conf" + else + echo "User created / modified configuration" \ + "for $pkgname in $dictd_conf is left untouched." + fi + fi + + if systemctl -q is-active dictd.service + then + echo "Restarting dictd service in order to" \ + "stop using the removed dictionary database" + systemctl restart dictd.service + fi + fi +} |