summaryrefslogtreecommitdiff
path: root/databases/grass-i18n/Makefile
blob: 71e686b2132428effccfabefbf0ec848f91913a8 (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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
# New ports collection makefile for:	grass-i18n
# Date created:		20 Aug 2004
# Whom:			hrs
#
# $FreeBSD$

PORTNAME=	grass-i18n
PORTVERSION=	5.0.3
CATEGORIES=	databases
MASTER_SITES=	http://www.grass-japan.org/FOSS4G/GRASS/:grass \
		http://www.grass-japan.org/FOSS4G/ipafonts/:ipafonts
PKGNAMESUFFIX=	+ipafont
DISTFILES=	${FILES_SRC}:grass ${FILES_TKI18N}:grass ${FILES_FONTS}:ipafonts
EXTRACT_ONLY=	${FILES_SRC}

MAINTAINER=	hrs@FreeBSD.org
COMMENT=	An open source Geographical Information System (GIS), i18n version

LIB_DEPENDS=	tiff.4:${PORTSDIR}/graphics/tiff \
		png.5:${PORTSDIR}/graphics/png \
		jpeg.9:${PORTSDIR}/graphics/jpeg \
		gd.4:${PORTSDIR}/graphics/gd \
		fftw.2:${PORTSDIR}/math/fftw \
		freetype.9:${PORTSDIR}/print/freetype2 \
		gdbm.3:${PORTSDIR}/databases/gdbm \
		lapack.3:${PORTSDIR}/math/lapack

CONFLICTS=	grass-[0-9]*

FILES_SRC=	grass${PORTVERSION}_i18n_src${EXTRACT_SUFX}
FILES_TKI18N=	tcltkgrass-i18n${EXTRACT_SUFX}
FILES_FONTS=	grass${PORTVERSION}_i686-pc-linux-i18n-ipafull-gnu_bin${EXTRACT_SUFX}

.if defined(WITH_POSTGRES)
USE_PGSQL=	yes
LIB_DEPENDS+=	odbc.1:${PORTSDIR}/databases/unixODBC
CONFIGURE_ARGS+=--with-postgres \
		--with-postgres-includes=${LOCALBASE}/include/postgresql/internal/ \
		--with-odbc
PLIST_SUB+=	POSTGRES=""
.else
CONFIGURE_ARGS+=--without-postgres \
		--without-odbc
PLIST_SUB+=	POSTGRES="@comment "
.endif

.if defined(WITH_TCLTK)
BUILD_DEPENDS+=	tclsh8.3:${PORTSDIR}/lang/tcl83 \
		wish8.3:${PORTSDIR}/x11-toolkits/tk83
RUN_DEPENDS+=	tclsh8.3:${PORTSDIR}/lang/tcl83 \
		wish8.3:${PORTSDIR}/x11-toolkits/tk83
CONFIGURE_ARGS+=--with-tcltk \
		--with-tcltk-includes="${LOCALBASE}/include/tcl8.3 \
					 ${LOCALBASE}/include/tk8.3"
PLIST_SUB+=	TCLTK=""
.else
CONFIGURE_ARGS+=--without-tcltk
PLIST_SUB+=	TCLTK="@comment "
.endif

EXTRACT_AFTER_ARGS=	| ${TAR} -xf - --exclude *CVS*

WRKSRC=		${WRKDIR}/grass-${PORTVERSION}-i18n

USE_ICONV=	yes
USE_XLIB=	yes
USE_GL=		yes
USE_PERL5=	yes
USE_BISON=	yes
USE_GMAKE=	yes
USE_AUTOCONF_VER=	213

CONFIGURE_ARGS+=--with-includes=${LOCALBASE}/include \
		--with-libs=${LOCALBASE}/lib \
		--with-opengl-includes=${X11BASE}/include \
		--with-opengl-libs=${X11BASE}/lib \
		--with-freetype \
		--with-freetype-includes=${LOCALBASE}/include/freetype2 \
		--with-blas \
		--with-lapack \
		--with-nls \
		--without-motif

CONFIGURE_IN_SUB=	PTHREAD_CFLAGS=${PTHREAD_CFLAGS} \
			PTHREAD_LIBS=${PTHREAD_LIBS}

.include <bsd.port.pre.mk>

pre-extract:
	@${ECHO_CMD} "You can specify the following build options:"
	@${ECHO_CMD} "	WITH_POSTGRES=YES: build with PostgreSQL support"
	@${ECHO_CMD} "	WITH_TCLTK=YES:    build with TclTk support"
	@${ECHO_CMD} ""

post-extract:
	cd ${WRKDIR} && ${TAR} xzf \
		${DISTDIR}/${FILES_FONTS} ./fonts/\*.ttf ./license-ipafonts.eucjp
	${MKDIR} ${WRKDIR}/tcltkgrass-i18n
	cd ${WRKDIR}/tcltkgrass-i18n && ${TAR} xzf \
		${DISTDIR}/${FILES_TKI18N}
	${RM} -rf `${FIND} ${WRKDIR}/tcltkgrass-i18n -type d -a -name cvs`
.for D in docs main module script
	${MV} ${WRKSRC}/src/tcltkgrass/${D} ${WRKSRC}/src/tcltkgrass/${D}.orig
	${MV} ${WRKDIR}/tcltkgrass-i18n/tcltkgrass-i18n/${D} ${WRKSRC}/src/tcltkgrass/${D}
.endfor

post-patch:
	${CP} ${WRKSRC}/configure.in ${WRKSRC}/configure.in.orig
	${SED} ${CONFIGURE_IN_SUB:S/$/!g/:S/^/ -e s!%%/:S/=/%%!/} \
		< ${WRKSRC}/configure.in.orig \
		> ${WRKSRC}/configure.in

post-install:
	cd ${WRKDIR}/tcltkgrass-i18n/scripts && ${TAR} cf - . | \
		(cd ${PREFIX}/grass5/scripts && ${TAR} xf -)
.if defined(WITH_TCLTK)
	cd ${WRKDIR}/tcltkgrass-i18n/bin && ${TAR} cf - . | \
		(cd ${PREFIX}/grass5/bin && ${TAR} xf -)
	cd ${WRKDIR}/tcltkgrass-i18n/etc && ${TAR} cf - ./nviz2.2-i18n | \
		(cd ${PREFIX}/grass5/etc && ${TAR} xf -)
	cd ${WRKDIR}/tcltkgrass-i18n/documents && ${TAR} cf - ./nviz | \
		(cd ${PREFIX}/grass5/documents && ${TAR} xf -)
.endif
	${INSTALL_DATA} ${WRKDIR}/fonts/*.ttf \
			${WRKDIR}/license-ipafonts.eucjp \
			${PREFIX}/grass5/fonts/
	-(cd ${PREFIX} && ${GREP} -v "@" ${PLIST} | \
	  ${XARGS} ${STRIP_CMD} 2> /dev/null || ${TRUE})

.include <bsd.port.post.mk>