summaryrefslogtreecommitdiff
path: root/textproc/dict-dictionaries/Makefile
blob: 35b70578d6a6849753aa801232ddc6835936acb3 (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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
# $NetBSD: Makefile,v 1.10 2007/11/17 12:04:14 rillig Exp $

DISTNAME=	#
PKGNAME=	dict-data-1.8.0
PKGREVISION=	1
CATEGORIES=	textproc
MASTER_SITES=	ftp://ftp.dict.org/pub/dict/
#MASTER_SITES=	${MASTER_SITE_SOURCEFORGE:=/dict}
DISTFILES=	dict-gazetteer-1.3.tar.gz \
		dict-misc-1.5.tar.gz \
		dict-web1913-1.4.tar.gz \
		web1913-0.46-a.tar.gz \
		dict-wn-1.5.tar.gz

MAINTAINER=	pkgsrc-users@NetBSD.org
HOMEPAGE=	http://www.dict.org/
COMMENT=	Dictionary data for DICTD

DEPENDS+=	dict-server>=1.8.0nb1:../../textproc/dict-server

USE_TOOLS+=	gmake lex yacc

# Strip '.gz', strip '.tar'.
DICTIONARIES=	${DISTFILES:R:R}

LEXICONS=	easton.dict.dz \
		easton.index \
		elements.dict.dz \
		elements.index \
		foldoc.dict.dz \
		foldoc.index \
		hitchcock.dict.dz \
		hitchcock.index \
		jargon.dict.dz \
		jargon.index \
		world95.dict.dz \
		world95.index
GAZETTEER=	gazetteer.dict.dz \
		gazetteer.index
WEB1913=	web1913.dict.dz \
		web1913.index
WN=		wn.dict.dz \
		wn.index

pre-configure:
	@for d in ${WRKDIR}/*/config.guess ${WRKDIR}/*/*/config.guess; do \
		${CP} ${PKGSRCDIR}/mk/gnu-config/config.guess $${d}; \
	done
	@for d in ${WRKDIR}/*/config.sub ${WRKDIR}/*/*/config.sub; do \
		${CP} ${PKGSRCDIR}/mk/gnu-config/config.sub $${d}; \
	done

do-configure:
	@for d in ${DICTIONARIES}; do \
		(cd ${WRKDIR}/$${d}; [ -f configure ] && ${SH} configure); \
	done

# Build dictinaries
do-build:
	@cd ${WRKDIR}/dict-web1913-1.4; ${MAKE_PROGRAM}		# For libmaa
	@${LN} -fs ${WRKDIR}/web1913-0.46-a ${WRKDIR}/dict-web1913-1.4/web1913
	@for d in ${DICTIONARIES}; do \
		(cd ${WRKDIR}/$$d; \
		    ${MAKE_PROGRAM} db); \
	done
	${FIND} ${WRKDIR} -name '*.dict' -print | \
	while read f; do \
		if [ ! -f $${f}.dz ]; then \
			${LOCALBASE}/bin/dictzip $$f; \
		fi; \
	done

do-install:
	${INSTALL_DATA_DIR} ${PREFIX}/share/dictd
	for f in ${LEXICONS}; do \
		${INSTALL_DATA} ${WRKDIR}/dict-misc-1.5/$$f \
		    ${PREFIX}/share/dictd; \
	done
	for f in ${GAZETTEER}; do \
		${INSTALL_DATA} ${WRKDIR}/dict-gazetteer-1.3/$$f \
		    ${PREFIX}/share/dictd; \
	done
	for f in ${WEB1913}; do \
		${INSTALL_DATA} ${WRKDIR}/dict-web1913-1.4/$$f \
		    ${PREFIX}/share/dictd; \
	done
	for f in ${WN}; do \
		${INSTALL_DATA} ${WRKDIR}/dict-wn-1.5/$$f \
		    ${PREFIX}/share/dictd; \
	done

.include "../../mk/bsd.pkg.mk"