summaryrefslogtreecommitdiff
path: root/x11-toolkits/libjsearch/Makefile
blob: 3c2e4b5ca58f082dd2dbb71b5b3162ab8710289e (plain) (blame)
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
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
# New ports collection makefile for:	libjsearch
# Date created:				04 Jun 2000
# Whom:					Mario S F Ferreira <lioux@linf.unb.br> et al.
#
# $FreeBSD$
#

PORTNAME=	libjsearch
PORTVERSION=	0.5.6
PORTREVISION=	1
CATEGORIES=	x11-toolkits
MASTER_SITES=	ftp://ftp.newplanetsoftware.com/pub/jx/source-1.5.3/ \
		ftp://ftp.newplanetsoftware.com/pub/jcc/source/ \
		ftp://ftp.newplanetsoftware.com/pub/medic/source/ \
		ftp://ftp.cs.itu.edu.tr/pub/linux/x11/jx/
DISTNAME=	JSearch_source-${PORTVERSION}

MAINTAINER=	lioux@linf.unb.br

BUILD_DEPENDS=	${NONEXISTENT}:${JXPORT}:configure \
		makemake:${JXPORT}
LIB_DEPENDS=	jx-1_5_3.1:${JXPORT}

WRKSRC=		${WRKDIR}/JX-1.5.3

USE_X_PREFIX=	yes
INSTALLS_SHLIB=	yes
USE_GMAKE=	yes
MAKE_ARGS=	CC="${CC}" CXX="${CXX}" \
		CFLAGS="${CFLAGS}" CXXFLAGS="${CXXFLAGS}"
MAKE_ENV=	JX_INSTALL_ROOT="${PREFIX}/bin" \
		JX_LIB_ROOT="${PREFIX}/lib"
PLIST_SUB=	PORTNAME="${PORTNAME}" \
		LIBNUMBER="${LIBNUMBER}" \
		LIBVERSION="${LIBVERSION}" \
		EXTRALIBFILES_MAKE_FILES="${EXTRALIBFILES_MAKE_FILES}" \
		INCLUDEDIR="${INCLUDEDIR}"
INSTALLS_SHLIB=	yes

# Make environment
PORTINCLUDES=	-I${X11BASE}/include/jx -I${X11BASE}/share/jx \
		-I${X11BASE}/include/jcore

# Installs dir with proper permissions
INSTALL_DATA_DIR=	${INSTALL} -d -o ${SHAREOWN} -g ${SHAREGRP} -m 755
# New version number
LIBVERSION=	0_5_6
# the libraries
LIBFILES=	${PORTNAME}-${LIBVERSION}.a ${PORTNAME}-${LIBVERSION}.so
# header files
INCLUDEDIR=	jsearch
# documentation
DOCDIR_PREFIX=	${PREFIX}/share/doc/jx
DOCDIRS=	${PORTNAME}
DOCDIRFILES=	LICENSE
# xpm images
ICONDIRS=	libjsearch/code
ICONDIR_PREFIX=	${PREFIX}/share/jx/jsearch
# additional configuration and header files
EXTRALIB_PREFIX=		${PREFIX}/lib/jx
EXTRALIBDIRS=			lib make
EXTRALIBFILES_MAKE_WRKSRC=	include/make
EXTRALIBFILES_MAKE_FILES=	jsearch_constants

.include <bsd.port.pre.mk>

# main jx distribution port wrksrc
JXPORT=		${PORTSDIR}/x11-toolkits/jx
JXPORT_WRKSRC!=	cd ${JXPORT} && ${MAKE} -V WRKSRC
# main jx distribution files needed for building
COPY_JXDIRS=	include
COPY_JXFILES=	Makefile

.if ${OSVERSION} >= 300000
ALL_TARGET=	freebsd3.x
LIBNUMBER=	0
.else
ALL_TARGET=	freebsd2.x
LIBNUMBER=	0.5
.endif

.if defined(NOPORTDOCS)
PLIST_SUB+=	PORTDOCS:="@comment "
.else
PLIST_SUB+=	PORTDOCS:=
.endif # !defined(NOPORTDOCS)

post-extract:
.for i in ${COPY_JXDIRS}
	@${CP} -Rp ${JXPORT_WRKSRC}/${i} ${WRKSRC}
.endfor
.for i in ${COPY_JXFILES}
	@${CP} -p ${JXPORT_WRKSRC}/${i} ${WRKSRC}
.endfor

post-patch:
	@${ECHO} "SEARCHDIRS += ${PORTINCLUDES}" >> \
		${WRKSRC}/${EXTRALIBFILES_MAKE_WRKSRC}/jx_constants

post-build:
	@cd ${WRKSRC}/${PORTNAME}; ${SETENV} ${MAKE_ENV} makemake; \
		${SETENV} ${MAKE_ENV} ${GMAKE} \
			${MAKE_FLAGS} ${MAKEFILE} ${MAKE_ARGS}

do-install:
.if !defined(NOPORTDOCS)
# Install all documentation
.for i in ${DOCDIRS}
	@for j in ${DOCDIRFILES} ; \
	do \
		if [ -f ${WRKSRC}/programs/${i}/$${j} ]; \
		then \
			${INSTALL_DATA} ${WRKSRC}/programs/${i}/$${j} \
				${DOCDIR_PREFIX}/$${j}_${i} ; \
		elif [ -f ${WRKSRC}/${i}/$${j} ]; \
		then \
			${INSTALL_DATA} ${WRKSRC}/${i}/$${j} \
				${DOCDIR_PREFIX}/$${j}_${i} ; \
		fi ; \
	done
.endfor
.endif # !defined(NOPORTDOCS)
# Install all icons
.for i in ${ICONDIRS}
	@${INSTALL_DATA_DIR} ${ICONDIR_PREFIX} ; \
	for j in ${WRKSRC}/${i}/*.xpm ; \
	do \
		${INSTALL_DATA} $${j} ${ICONDIR_PREFIX} ; \
	done
.endfor
# Install all header files
.for i in ${INCLUDEDIR}
	@${INSTALL_DATA_DIR} ${PREFIX}/include/${i} ; \
	for j in ${WRKSRC}/include/${i}/*.h ; \
	do \
		${INSTALL_DATA} $${j} ${PREFIX}/include/${i} ; \
	done
.endfor
# Install all libraries
.for i in ${LIBFILES}
	@${INSTALL_PROGRAM} ${WRKSRC}/lib/${i} ${PREFIX}/lib
.endfor
# Install additional library files
.for i in ${EXTRALIBDIRS}
	@${INSTALL_DATA_DIR} ${EXTRALIB_PREFIX}/${i}
.endfor
.for i in ${EXTRALIBFILES_MAKE_FILES}
	@${INSTALL_DATA} ${WRKSRC}/${EXTRALIBFILES_MAKE_WRKSRC}/${i} \
		${EXTRALIB_PREFIX}/make/${i}
.endfor

post-install:
	@${LN} -sf ${PORTNAME}-${LIBVERSION}.so \
		${PREFIX}/lib/${PORTNAME}-${LIBVERSION}.so.${LIBNUMBER}
.for i in ${LIBFILES}
	@${LN} -sf ../../${i} ${EXTRALIB_PREFIX}/lib/${i}
.endfor

.include <bsd.port.post.mk>