summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authordasbaumwolltier2019-03-08 16:16:44 +0100
committerdasbaumwolltier2019-03-08 16:16:44 +0100
commitd1e2e5cb3ecc1bd97d66fa3cd85089b670ccd36e (patch)
tree121c92a396ce6a5e2b252d7b81967139657dc2fc
downloadaur-d1e2e5cb3ecc1bd97d66fa3cd85089b670ccd36e.tar.gz
Created repo, PKGBUILD and install file
-rw-r--r--.SRCINFO17
-rw-r--r--.gitignore1
-rw-r--r--PKGBUILD31
-rw-r--r--dict-freedict-deu-swe-bin.install78
4 files changed, 127 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 00000000000..f4447d7c1b1
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,17 @@
+pkgbase = dict-freedict-deu-swe-bin
+ pkgdesc = German -> Swedish dictionary for dictd et al. from Freedict.org
+ pkgver = 2018.09.13
+ pkgrel = 1
+ url = https://freedict.org/
+ install = dict-freedict-deu-swe-bin.install
+ arch = any
+ license = CCPL:by-sa
+ license = FDL
+ optdepends = dictd: dict client and server
+ provides = dict-freedict-deu-swe
+ conflicts = dict-freedict-deu-swe
+ source = https://download.freedict.org/dictionaries/deu-swe/2018.09.13/freedict-deu-swe-2018.09.13.dictd.tar.xz
+ sha256sums = 4de34d93c3510b2f774900f04c4f55d4aa6ba1f8de572dd8b01607930072d0ca
+
+pkgname = dict-freedict-deu-swe-bin
+
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 00000000000..72e8ffc0db8
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1 @@
+*
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 00000000000..1615311c26b
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,31 @@
+# Maintainer: Gabriel Guldner <gabriel at guldner . eu>
+_lang=deu-swe
+_pkgname=dict-freedict-${_lang}
+pkgname=${_pkgname}-bin
+pkgver=2018.09.13
+pkgrel=1
+pkgdesc="German -> Swedish 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=('4de34d93c3510b2f774900f04c4f55d4aa6ba1f8de572dd8b01607930072d0ca')
+
+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-swe-bin.install b/dict-freedict-deu-swe-bin.install
new file mode 100644
index 00000000000..9f28f86e2cf
--- /dev/null
+++ b/dict-freedict-deu-swe-bin.install
@@ -0,0 +1,78 @@
+basename=deu-swe
+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
+}