summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorEinhard Leichtfuß2017-02-09 15:22:46 +0100
committerEinhard Leichtfuß2017-02-09 15:22:46 +0100
commit1391e816444d5ec09b4199a2b240bafe8a83176f (patch)
treefa97bfca075f7f0c2b3d0a934167860b252d028a
downloadaur-1391e816444d5ec09b4199a2b240bafe8a83176f.tar.gz
Intial upload
-rw-r--r--.SRCINFO19
-rw-r--r--PKGBUILD48
-rw-r--r--dict-freedict-fra-eng-svn.install78
3 files changed, 145 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..60e393360718
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,19 @@
+pkgbase = dict-freedict-fra-eng-svn
+ pkgdesc = French -> English dictionary for dictd et al. from Freedict.org
+ pkgver = r1487
+ pkgrel = 1
+ url = http://www.freedict.org/
+ install = dict-freedict-fra-eng-svn.install
+ arch = any
+ license = GPL
+ makedepends = subversion
+ makedepends = dictd
+ makedepends = freedict-tools
+ optdepends = dictd: dict client and server
+ provides = dict-freedict-fra-eng
+ conflicts = dict-freedict-fra-eng
+ source = svn+https://github.com/freedict/fd-dictionaries/trunk/fra-eng
+ md5sums = SKIP
+
+pkgname = dict-freedict-fra-eng-svn
+
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..2b20654012ca
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,48 @@
+# Maintainer: Einhard Leichtfuß <archer@respiranto.de>
+_lang=fra-eng
+_pkgname=dict-freedict-${_lang}
+pkgname=${_pkgname}-svn
+pkgver=r1487
+pkgrel=1
+pkgdesc="French -> English dictionary for dictd et al. from Freedict.org"
+arch=('any')
+url="http://www.freedict.org/"
+license=('GPL')
+optdepends=('dictd: dict client and server')
+makedepends=('subversion' 'dictd' 'freedict-tools')
+provides=(${_pkgname})
+conflicts=(${_pkgname})
+install=${pkgname}.install
+source=("svn+https://github.com/freedict/fd-dictionaries/trunk/${_lang}")
+md5sums=('SKIP')
+
+pkgver()
+{
+ cd ${_lang}
+ local _ver="$(svnversion)"
+ printf "r%s" "${_ver//[[:alpha:]]}"
+}
+
+prepare()
+{
+ ln -s /usr/lib/freedict-tools/{tools,shared} .
+}
+
+build()
+{
+ cd ${_lang}
+ make
+}
+
+package()
+{
+ mkdir -p "${pkgdir}/usr/share/dictd"
+ cp ${_lang}/${_lang}.{dict.dz,index} "$pkgdir/usr/share/dictd/"
+
+ mkdir -p "${pkgdir}/usr/share/doc/freedict/${_lang}"
+ for file in ${_lang}/{AUTHORS,README,NEWS,INSTALL,ChangeLog}
+ do
+ test -f ${file} && \
+ cp -d ${file} "${pkgdir}/usr/share/doc/freedict/${_lang}/"
+ done
+}
diff --git a/dict-freedict-fra-eng-svn.install b/dict-freedict-fra-eng-svn.install
new file mode 100644
index 000000000000..9bdfe971ae39
--- /dev/null
+++ b/dict-freedict-fra-eng-svn.install
@@ -0,0 +1,78 @@
+basename=fra-eng
+pkgname=dict-freedict-$basename-svn
+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
+}