Tweak devel/nspr version 4.10.9
[dports.git] / devel / nspr / Makefile
1 # Created by: Maxim Sobolev <sobomax@FreeBSD.org>
2 # $FreeBSD$
3
4 PORTNAME=       nspr
5 DISTVERSION=    4.10.9
6 CATEGORIES=     devel
7 MASTER_SITES=   MOZILLA/${PORTNAME}/releases/v${PORTVERSION}/src
8
9 MAINTAINER=     gecko@FreeBSD.org
10 COMMENT=        Platform-neutral API for system level and libc like functions
11
12 WRKSRC=         ${WRKDIR}/${DISTNAME}/nspr/build
13
14 USES=           cpe gmake
15 CPE_VENDOR=     mozilla
16 CPE_PRODUCT=    netscape_portable_runtime
17 USE_LDCONFIG=   yes
18 GNU_CONFIGURE=  yes
19 USE_AUTOTOOLS=  autoconf
20 CONFIGURE_ARGS= --srcdir=${WRKSRC:H}
21 CONFIGURE_WRKSRC= ${WRKSRC}/..
22
23 MAKE_ENV=       DIST=${WRKSRC}/dist
24
25 LIBRARIES=      libnspr4.so.1 libplc4.so.1 libplds4.so.1
26
27 OPTIONS_DEFINE= DEBUG
28
29 DEBUG_CONFIGURE_ENABLE=debug
30
31 do-configure:
32         cd ${WRKSRC} && ${CONFIGURE_ENV} \
33                 ../${CONFIGURE_SCRIPT} ${CONFIGURE_ARGS}
34
35 do-install:
36         ${MKDIR} ${STAGEDIR}${PREFIX}/include/nspr
37         ${TAR} -C ${WRKSRC}/dist/include --dereference -cf - . | \
38                 ${TAR} -C ${STAGEDIR}${PREFIX}/include -xof -
39         ${FIND} ${STAGEDIR}${PREFIX}/include/nspr -type d | \
40                 ${XARGS} ${CHMOD} 0755
41         ${FIND} ${STAGEDIR}${PREFIX}/include/nspr -type f | \
42                 ${XARGS} ${CHMOD} ${SHAREMODE}
43         ${TAR} -C ${WRKSRC}/dist/lib --dereference -cf - . | \
44                 ${TAR} -C ${STAGEDIR}${PREFIX}/lib -xof -
45         ${INSTALL_SCRIPT} ${WRKSRC}/config/nspr-config ${STAGEDIR}${PREFIX}/bin
46         ${MKDIR} ${STAGEDIR}${PREFIX}/libdata/pkgconfig
47         ${INSTALL_DATA} ${WRKSRC}/config/nspr.pc ${STAGEDIR}${PREFIX}/libdata/pkgconfig
48 .for lib in ${LIBRARIES}
49 .if defined(STRIP) && ${STRIP} != ""
50         ${STRIP_CMD} ${STAGEDIR}${PREFIX}/lib/${lib}
51 .endif
52         ${CHMOD} ${LIBMODE} ${STAGEDIR}${PREFIX}/lib/${lib}
53         ${LN} -sf ${lib} ${STAGEDIR}${PREFIX}/lib/${lib:R}
54 .endfor
55
56 prtests:
57         ${DO_MAKE_BUILD} -C ${WRKSRC}/pr/tests
58         ${LN} -sf libmy.so.1 ${WRKSRC}/pr/tests/dll/libmy.so
59         cd ${WRKSRC}/pr/tests && ../../../pr/tests/runtests.sh
60
61 libtests:
62         ${DO_MAKE_BUILD} -C ${WRKSRC}/lib/tests
63         ${WRKSRC}/lib/tests/string
64         ${WRKSRC}/lib/tests/base64t
65         # The test below is commented out, because arena requires
66         # command-line arguments. If you can provide reasonable values
67         # for it, please contact ${MAINTAINER}. Thank you.
68         #       ${WRKSRC}/lib/tests/arena
69         #
70
71 test: libtests prtests
72
73 #regression-test: test
74
75 #.if defined(PACKAGE_BUILDING)
76 #post-build: test
77 #.else
78 post-build:
79         #
80         # Please, consider running ``make test'' to find any
81         # possible build problems.
82         #
83 #.endif
84
85 .include <bsd.port.mk>