diff options
author | dasbaumwolltier | 2019-03-08 16:30:20 +0100 |
---|---|---|
committer | dasbaumwolltier | 2019-03-08 16:30:20 +0100 |
commit | 6875d2dc62e2a65dfb675dc105bde3df337382e5 (patch) | |
tree | 1b548545c8e61f73fb83afd2dbba4a7727ce9540 | |
download | aur-6875d2dc62e2a65dfb675dc105bde3df337382e5.tar.gz |
Created repo, PKGBUILD and install file
-rw-r--r-- | .SRCINFO | 17 | ||||
-rw-r--r-- | .gitignore | 1 | ||||
-rw-r--r-- | PKGBUILD | 31 | ||||
-rw-r--r-- | dict-freedict-swe-deu-bin.install | 78 |
4 files changed, 127 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 000000000000..643b4f014d8e --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,17 @@ +pkgbase = dict-freedict-swe-deu-bin + pkgdesc = Swedish -> German dictionary for dictd et al. from Freedict.org + pkgver = 2018.09.13 + pkgrel = 1 + url = https://freedict.org/ + install = dict-freedict-swe-deu-bin.install + arch = any + license = CCPL:by-sa + license = FDL + optdepends = dictd: dict client and server + provides = dict-freedict-swe-deu + conflicts = dict-freedict-swe-deu + source = https://download.freedict.org/dictionaries/swe-deu/2018.09.13/freedict-swe-deu-2018.09.13.dictd.tar.xz + sha256sums = 65f3638e7c2070fbae0523aa8698918cb17f9a6616b865f0676372b43f0fd073 + +pkgname = dict-freedict-swe-deu-bin + diff --git a/.gitignore b/.gitignore new file mode 100644 index 000000000000..72e8ffc0db8a --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +* diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 000000000000..885b9cc7fb0c --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,31 @@ +# Maintainer: Gabriel Guldner <gabriel at guldner . eu> +_lang=swe-deu +_pkgname=dict-freedict-${_lang} +pkgname=${_pkgname}-bin +pkgver=2018.09.13 +pkgrel=1 +pkgdesc="Swedish -> German 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') +provides=(${_pkgname}) +conflicts=(${_pkgname}) +install=${pkgname}.install +source=("https://download.freedict.org/dictionaries/${_lang}/${pkgver}/freedict-${_lang}-${pkgver}.dictd.tar.xz") +sha256sums=('65f3638e7c2070fbae0523aa8698918cb17f9a6616b865f0676372b43f0fd073') + +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-swe-deu-bin.install b/dict-freedict-swe-deu-bin.install new file mode 100644 index 000000000000..10ac5c66e5a9 --- /dev/null +++ b/dict-freedict-swe-deu-bin.install @@ -0,0 +1,78 @@ +basename=swe-deu +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 +} |