summarylogtreecommitdiffstats
path: root/PKGBUILD
diff options
context:
space:
mode:
authorEinhard Leichtfuß2018-12-27 18:55:44 +0100
committerEinhard Leichtfuß2018-12-27 19:06:40 +0100
commitdd137b37a572f28510be3cd7a74ec538ef692689 (patch)
tree1b30d22a8f47fe36c257aa456a72bffa23c84789 /PKGBUILD
parent8fe66d46bef882a390ba637a2be9a2172cd3f423 (diff)
downloadaur-dd137b37a572f28510be3cd7a74ec538ef692689.tar.gz
Add a few fixes to the dictionary source
A large part is derived from a diff between 0.48 and Debian's 0.48.5. Also, - split the sed script into one to be executed initially and another one after webfilter. - Use Debian's 0.48.5 instead of 0.48.4 (does not change much). - Correctly set the version of the dictionary (as written by `dict -D'). - Do not patch the Makefile but execute the commands directly. - Simplify prepare() and build(). - Add a check function.
Diffstat (limited to 'PKGBUILD')
-rw-r--r--PKGBUILD79
1 files changed, 48 insertions, 31 deletions
diff --git a/PKGBUILD b/PKGBUILD
index 023cfad20dbc..c2ef10024746 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,61 +1,78 @@
-# Maintainer: Einhard Leichtfuß <archer@respiranto.de>
+# Maintainer: Einhard Leichtfuß <alguien@respiranto.de>
# Contributor: Tai Chi Minh Ralph Eastwood <tcmreastwood@gmail.com>
pkgname=dict-gcide
-_debver=0.48.4
+_major_debver=0.48
+_debver=${_major_debver}.5
pkgver=0.52
-pkgrel=1
+pkgrel=2
pkgdesc="GNU version of the Collaborative International Dictionary of English for dictd et al."
arch=('any')
url="http://gcide.gnu.org.ua/"
-license=('GPL' 'GPL3')
+license=('GPL3')
optdepends=('dictd: dict client and server')
makedepends=('dictd' 'sed')
provides=('dictd-gcide')
conflicts=('dictd-gcide')
install=${pkgname}.install
source=('fixes.sed'
+ 'post_webfilter.sed'
+ 'check.sed'
"http://ftp.debian.org/debian/pool/main/d/${pkgname}/${pkgname}_${_debver}.tar.xz"
"ftp://ftp.gnu.org/gnu/gcide/gcide-${pkgver}.tar.xz"{,.sig})
-sha512sums=('3adc1c75e9f96883966236131518b4b8f4c6c588759112417ec46c35d421da87ddd1bac156fa0bf55c64f939cbe1efd235d0854b4dfe8cfa1278917d6fef07f5'
- '82939f8c9e2bb30368b673784abaf85724a04fb9ebab382b6908034e0978d4d47039b7667573b88fe074bb29ea232b9e11129ac30ba6e88d5b9271df3b2ad302'
+sha512sums=('6fc2caf86d96ac9a14f2676ca4455afe987f37933c03ac672b27cf2de7a4fc893457c97c7fa17dc280debfb4e1a3ab4adc5f7c68ee445605dc3c22665d32a445'
+ 'e7c6766b51ef92c4d8669394b6a71f8c4d7249ac63a1eb940f0a3017cb5ff6841f0f4bce7a60ffbcf180801d92b068db6ca46afd1dceac06a9c37c59dcddbfb3'
+ '1304bdce3776355fcd7827cebbf670ae34377bda78b04bf271ba10a25d92e33f6ec69644e168c30a6ec47808ebacc461de47d9494a5a2a5894d58c21be045973'
+ 'a10d46947c7d8b7050c44a12cfb38ed374e971063805e69897652cd8993dc5cf0ecc4d9a12680a8ced30d110d20bc84def75bd587166aa2cfa78529b9397aafe'
'260e4e7bb30ac857255b9a1f696b18b77bbae06574bb0f0cc35b38be7399bf497d3c561ab0d4a4b7e8fc3127c6bf72efde8e1d4a28fa428f82178d0972f704b3'
'SKIP')
validpgpkeys=('325F650C4C2B6AD58807327A3602B07F55D0C732')
-prepare() {
- ln -s "${srcdir}/fixes.sed" "${pkgname}-${_debver}/"
- sed -i 's`\(\./webfilter\) | \(\./webfmt -c\)`\1 | sed -Ef fixes.sed | \2`' "${pkgname}-${_debver}/Makefile.in"
-
- rm -rf "${pkgname}-${_debver}/cide"
- ln -s "${srcdir}/gcide-${pkgver}" "${pkgname}-${_debver}/cide"
- cd "${pkgname}-${_debver}/cide"
- for file in CIDE.?
- do
- mv "$file" "${file,,}"
- done
- mv tagset.{txt,web}
- mv webfont.{txt,asc}
- mv README{,.dic}
+prepare()
+{
+ sed -Ei \
+ "s/\"(The Collaborative International Dictionary of English) v.${_major_debver}\"/\"\\1 v.${pkgver}\"/" \
+ "${pkgname}-${_debver}/scan.l"
}
-build() {
- cd "${pkgname}-${_debver}"
- export CPPFLAGS="-D_FORTIFY_SOURCE=0"
- ./configure --with-local-libmaa --prefix=/usr
+build()
+{
+ cd ${pkgname}-${_debver}
+
+ CPPFLAGS="-D_FORTIFY_SOURCE=0" ./configure --with-local-libmaa
make -j1
- mkdir "../final_data"
- make dictdir="../final_data" install
- # Fix wrong order.
- LANG=C sort --dictionary-order --ignore-case \
- -o ../final_data/gcide.index{,}
+
+ # Do the conversion explicitly, instead of `make db', to account for all
+ # the differences to the original build process.
+ # LANG=C is required so that the index file is properly sorted.
+ ../fixes.sed ../gcide-${pkgver}/CIDE.? \
+ | sed -f debian/sedfile \
+ | ./webfilter \
+ | ../post_webfilter.sed \
+ | tee pre_webfmt.data \
+ | LANG=C ./webfmt -c
+
+ dictzip -v gcide.dict
+}
+
+check()
+{
+ errors="$(./check.sed < ${pkgname}-${_debver}/pre_webfmt.data)"
+
+ if test -n "$errors"
+ then
+ echo "Errors found:"
+ echo "$errors"
+ return 1
+ fi
}
package()
{
install -m 0755 -d "${pkgdir}/usr/share/dictd"
install -m 0644 -t "${pkgdir}/usr/share/dictd/" \
- final_data/gcide.{dict.dz,index}
+ ${pkgname}-${_debver}/gcide.{dict.dz,index}
+
install -m 0755 -d "${pkgdir}/usr/share/doc/dict-gcide"
install -m 0644 -t "${pkgdir}/usr/share/doc/dict-gcide/" \
- "${pkgname}-${_debver}/cide/"{README.dic,INFO}
+ gcide-${pkgver}/{README,INFO}
}