summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 986855e5047cba79f3758b670fd23bf4e2152269 (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
# Maintainer:  respiranto         <respiranto@icloud.com>
# Contributor: Enrico Morelli     <morelli@cerm.unifi.it>
# Contributor: Andrew Engelbrecht <sudoman@ninthfloor.org>
pkgname=dict-wn
pkgver=3.0
pkgrel=3
pkgdesc="WordNet in dict format"
arch=('any')
url="http://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, since it contains wordnet_structures.py
source=("http://ftp.de.debian.org/debian/pool/main/w/wordnet/wordnet_$pkgver.orig.tar.gz")
md5sums=('a91cee4bab52c750dc25e3b1d296a091');

build() {
	cd WordNet-$pkgver
	./configure

	# we need to use python2, pass the name, and the url of the new WN version
	sed -i 's/python wordnet_structures.py/python2 wordnet_structures.py --wn_url="http:\/\/wordnet\.princeton.edu" --db_desc_short="     WordNet \(r\) 3\.0 \(2006\)"/g' contrib/wordnet_structures/Makefile

	# 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

	make
}

package() {
	cd WordNet-$pkgver
	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"
	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"
}