aboutsummaryrefslogtreecommitdiffstats
path: root/net/jpcap/Makefile
blob: d849299e3f0a88f3db7dc8bdef58655bfe1089c0 (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
# New ports collection makefile for:   jpcap
# Date created:                10 February 2010
# Whom:                        bms
#
# $FreeBSD$
#

PORTNAME=   jpcap
PORTVERSION=    0.7
PORTREVISION=   1
CATEGORIES= net devel java
MASTER_SITES=   http://netresearch.ics.uci.edu/kfujii/Jpcap/

MAINTAINER= ports@FreeBSD.org
COMMENT=    JNI wrapper around libpcap

LIB_DEPENDS=    pcap.1:${PORTSDIR}/net/libpcap

USE_GMAKE=  yes
USE_JAVA=   yes
USE_LDCONFIG=   yes
MAKE_JOBS_UNSAFE=   yes

PKGMESSAGE= ${WRKDIR}/pkg-message

SUB_FILES+= pkg-message #pkg-install
SUB_LIST+=  JAVAJARDIR="${JAVAJARDIR}"

MAKE_ENV=   JAVA_HOME="${JAVA_HOME}" JAVA="${JAVA}" JAVAC="${JAVAC}" \
        JAVAH="${JAVAH}" JAR_="${JAR}"

PLIST_FILES=    %%JAVAJARDIR%%/jpcap.jar lib/libjpcap.so

# Build JNI .so only; install pre-compiled jar.
BUILD_WRKSRC=   ${WRKSRC}/src/c
ALL_TARGET= # empty

.include <bsd.port.pre.mk>

.if ${ARCH} == "amd64" || ${ARCH} =="ia64" || ${ARCH} == "sparc64"
CFLAGS+=    -fPIC
.else
CFLAGS+=    -fpic
.endif
CPPFLAGS+=  -I${LOCALBASE}/include
LDFLAGS+=   -L${LOCALBASE}/lib

MAKE_ARGS+= CFLAGS="${CFLAGS}" \
        CPPFLAGS="${CPPFLAGS}" \
        LDFLAGS="${LDFLAGS}" \
        PLATFORM="FreeBSD"

do-install:
    ${INSTALL_DATA} ${WRKSRC}/src/c/libjpcap.so ${PREFIX}/lib
    ${INSTALL_DATA} ${WRKSRC}/lib/jpcap.jar ${JAVAJARDIR}

# TODO: Install docs.

post-install:
    @${CAT} ${PKGMESSAGE}

.include <bsd.port.post.mk>