summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 79d6428dabc2ffdc67546f5a9c0aea747c49bd45 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
# Maintainer: Einhard Leichtfuß <archer@respiranto.de>
# Contributor: Enrico Morelli <morelli@cerm.unifi.it>
# Contributor: Andrew Engelbrecht <sudoman@ninthfloor.org>
pkgname=dict-wn
pkgver=3.1
_debver=3.0
pkgrel=2
pkgdesc="WordNet for dictd et al."
arch=('any')
url="https://wordnet.princeton.edu/"
license=('custom: WordNet License' 'GPL')
optdepends=('dictd: dict client and server')
makedepends=('dictd' 'tk' 'python2' 'ghostscript')
provides=('dictd-wn')
conflicts=('dictd-wn')
install="${pkgname}.install"

# The tarball from debian is required for wordnet_structures.py .
source=("http://wordnetcode.princeton.edu/wn${pkgver}.dict.tar.gz"
				"http://ftp.de.debian.org/debian/pool/main/w/wordnet/wordnet_${_debver}.orig.tar.gz")
sha512sums=('16dca17a87026d8a0b7b4758219cd21a869c3ef3da23ce7875924546f2eacac4c2f376cb271b798b2c458fe8c078fb43d681356e3d9beef40f4bd88d3579394f'
            'f153ea6be57ef57b18e4f0857e2ce0493ee75171f60df4b3aa669f4279c1b2ad91641da166b450d95a89166d50d6dc0d9f199710fa2f1ab934882028760d6917')

prepare()
{
	cp -rf dict/* "WordNet-${_debver}/dict/"

	cd "WordNet-${_debver}"

	# Apparently, the naming conventions changed.
	# Use the old ones.
	mv -f "dict/dbfiles/verb.Framestext" "dict/frames.vrb"

	# Pretend old version.
	mv -f "dict/log.grind."{"${pkgver}","${_debver}"}

	# Use python2, pass the url and the name with the new version.
	sed -i 's/python wordnet_structures.py/python2 wordnet_structures.py --wn_url="http:\/\/wordnet\.princeton.edu" --db_desc_short="     WordNet \(r\) '"${pkgver}"' \(2011\)"/g' contrib/wordnet_structures/Makefile.in

	# Tcl_Interp structure does by default not contain result.
	sed -i 's/^#include <tcl.h>$/#define USE_INTERP_RESULT\n#include <tcl.h>/' src/stubs.c
}

build() {
	cd "WordNet-${_debver}"
	./configure
	make
}

package() {
	cd "WordNet-${_debver}"
	mkdir -p "$pkgdir/usr/share/dictd/"
	cp contrib/wordnet_structures/wn.{dict.dz,index} "$pkgdir/usr/share/dictd/"
	
	install -m 0755 -d "${pkgdir}/usr/share/doc/${pkgname}"

	# Note, that the documentation will be for the old version.
	install -m 0644 -t "${pkgdir}/usr/share/doc/${pkgname}/" AUTHORS COPYING NEWS README
	
	mkdir -p "${pkgdir}/usr/share/licenses/dict-wn"
	ln -s /usr/share/doc/dict-wn/COPYING "${pkgdir}/usr/share/licenses/dict-wn"
}