aboutsummaryrefslogtreecommitdiffstats
path: root/net/asterisk-bristuff/Makefile
blob: 38610fed79b51df42a77403c1eff7b8e5e968326 (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
# New ports collection makefile for:    asterisk
# Date created:             17 October 2003
# Whom:                 Maxim Sobolev <sobomax@portaone.com>
#
# $FreeBSD$
#

PORTNAME=   asterisk
PORTVERSION=    1.2.7.1
PORTREVISION=   1
CATEGORIES= net
MASTER_SITES=   http://ftp.digium.com/pub/asterisk/ \
        http://ftp.digium.com/pub/asterisk/old-releases/

PKGNAMESUFFIX=  -bristuff
PATCHFILES= ${PORTNAME}-${PORTVERSION}-${BRIVER}.patch.gz
PATCH_SITES=    ${MASTER_SITE_LOCAL}
PATCH_SITE_SUBDIR=  fjoe
PATCH_DIST_STRIP=   -p1
BRIVER=     bristuff-0.3.0-PRE-1p
CONFLICTS=  asterisk-[0-9]*

MAINTAINER= fjoe@FreeBSD.org
COMMENT=    An Open Source PBX and telephony toolkit

BUILD_DEPENDS=  mpg123:${PORTSDIR}/audio/mpg123
LIB_DEPENDS=    speex.3:${PORTSDIR}/audio/speex \
        newt.51:${PORTSDIR}/devel/newt \
        curl.3:${PORTSDIR}/ftp/curl
RUN_DEPENDS=    mpg123:${PORTSDIR}/audio/mpg123

ONLY_FOR_ARCHS= i386 sparc64 amd64

GNU_CONFIGURE=  yes
CONFIGURE_WRKSRC=   ${WRKSRC}/editline
USE_GMAKE=  yes
USE_BISON=  yes
USE_RC_SUBR=    asterisk.sh
MAKE_ENV=   PTHREAD_CFLAGS="${PTHREAD_CFLAGS}" \
        PTHREAD_LIBS="${PTHREAD_LIBS}" \
        MKDIR="${MKDIR}" \
        PWLIBDIR=${LOCALBASE}/share/pwlib \
        OPENH323DIR=${LOCALBASE}/share/openh323 \
        OSVERSION=${OSVERSION} \
        CXX="${CXX}"
MAN8=       asterisk.8 astgenkey.8 autosupport.8 safe_asterisk.8

.include <bsd.port.pre.mk>

.if ${ARCH} == "amd64" || ${ARCH} == "sparc64"
BROKEN=     does not compile on ${ARCH}
.endif

.if ${ARCH} != "i386"
WITHOUT_H323=   1
WITHOUT_ZAPTEL= 1
.endif

.if defined(WITHOUT_H323)
PLIST_SUB+= WITH_H323="@comment "
.else
LIB_DEPENDS+=   pt_r.1:${PORTSDIR}/devel/pwlib\
        h323_r.1:${PORTSDIR}/net/openh323
PLIST_SUB+= WITH_H323=""
MAKE_ENV+=  WITH_H323=1
.endif

.if defined(WITHOUT_ZAPTEL)
PLIST_SUB+= WITH_ZAPTEL="@comment "
MAKE_ENV+=  WITHOUT_ZAPTEL=1
.else
BUILD_DEPENDS+= ${LOCALBASE}/include/zaptel.h:${PORTSDIR}/misc/zaptel
LIB_DEPENDS+=   pri-bristuff.1:${PORTSDIR}/misc/libpri-bristuff
RUN_DEPENDS+=   ${LOCALBASE}/include/zaptel.h:${PORTSDIR}/misc/zaptel
PLIST_SUB+= WITH_ZAPTEL=""
MAKE_ENV+=  WITH_ZAPTEL=1
.endif

#
# WITH_FREETDS, WITH_PGSQL and WITH_SQLITE can also be added to MAKE_ENV
# similarly
.if defined(WITHOUT_ODBC)
PLIST_SUB+= WITH_ODBC="@comment "
.else
LIB_DEPENDS+=   odbc.1:${PORTSDIR}/databases/unixODBC
PLIST_SUB+= WITH_ODBC=""
MAKE_ENV+=  WITH_ODBC=1
.endif

.if defined(WITHOUT_FAX)
PLIST_SUB+= WITH_FAX="@comment "
.else
MAKE_ENV+=  WITH_FAX=1
LIB_DEPENDS+=   spandsp.0:${PORTSDIR}/comms/spandsp
PLIST_SUB+= WITH_FAX=""
.endif

.if ${OSVERSION} >= 500036
PLIST_SUB+= NEWGCC=""
.else
PLIST_SUB+= NEWGCC="@comment "
.endif

post-patch:
    ${REINPLACE_CMD} -e 's|/var/lib|${PREFIX}/share|g' ${WRKSRC}/configs/musiconhold.conf.sample
    ${REINPLACE_CMD} -e 's,^#include <libpri\.h>,#include <libpri-bristuff.h>,' ${WRKSRC}/channels/chan_zap.c
    ${REINPLACE_CMD} -e 's,-lpri,-lpri-bristuff,' ${WRKSRC}/channels/Makefile

.include <bsd.port.post.mk>