aboutsummaryrefslogtreecommitdiffstats
path: root/devel/libzrtp/Makefile
blob: 10d8e6c3be11f27aaa7353f25ef842deb3291a94 (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
# New ports collection makefile for:   libzrtp for freeswitch
# Date created:        3 December 2010
# Whom:                rneese@gmail.com
#
# $FreeBSD$
#

PORTNAME=   libzrtp
PORTVERSION=    0.81.514
PORTREVISION=   1
CATEGORIES= devel
MASTER_SITES=   # http://philzimmermann.com/zfone/EN/registration/index.html

MAINTAINER= r.neese@gmail.com
COMMENT=    ZRTP library from the Zfone SDK

GNU_CONFIGURE=  yes
USE_GMAKE=  yes
USE_LDCONFIG=   yes

CFLAGS+=        -fPIC

PATCH_WRKSRC=   ${WRKDIR}/${PORTNAME}-${PORTVERSION}
WRKSRC=     ${WRKDIR}/${PORTNAME}-${PORTVERSION}/projects/gnu

RESTRICTED= Forbidden by license

.include <bsd.port.pre.mk>

.if ${ARCH} == "sparc64"
BROKEN=     Does not link on sparc64
.endif

# Check for sources
.if !exists(${DISTDIR}/${DISTFILES})
DISTFILE_INSTRUCTIONS=\n\
Due to licensing restrictions, certain files must be fetched manually.\n\n\
Please register to download the LINUX version of the Zfone SDK at\n\
http://philzimmermann.com/zfone/EN/registration/index.html\n\n\n\
After downloading the SDK, extract the library source\n\
${DISTFILES}\n\n\
place it in ${DISTDIR}, and restart the build.\n\n
.endif

pre-fetch:
.if defined(DISTFILE_INSTRUCTIONS) && !defined(PACKAGE_BUILDING)
    @${PRINTF} "${DISTFILE_INSTRUCTIONS}"
    @exit 1
.endif

pre-configure:
    @${REINPLACE_CMD} -e 's|./configure CFLAGS="-O0 -g3"|./configure CFLAGS="-O0 -g3 -fPIC"|g' ${WRKDIR}/${PORTNAME}-${PORTVERSION}/third_party/bnlib/cfg.debug

post-patch:
    @cd ${PATCH_WRKSRC}/src && \
        ${FIND} * -type f -exec ${REINPLACE_CMD} -i "" -e "s|<malloc.h>|<stdlib.h>|g" "{}" \; && \
            ${FIND} * -type f -exec ${REINPLACE_CMD} -i "" -e "s|<stdint.h>|<inttypes.h>|g" "{}" \;
    @${REINPLACE_CMD} -e "s|-lpthread|${PTHREAD_LIBS}|g" ${WRKSRC}/${CONFIGURE_SCRIPT}

test:
    cd ${WRKDIR}/${PORTNAME}-${PORTVERSION}/projects/gnu && make check

.include <bsd.port.post.mk>