aboutsummaryrefslogtreecommitdiff
path: root/net/asterisk-devel/Makefile
blob: 4f65d3bea502c980a685d0f968abf422ebd7b756 (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
160
# New ports collection makefile for:	asterisk-current
# Date created:				15 January 2006
# Whom:					Luigi Rizzo
#
# $FreeBSD$
#

PORTNAME=	asterisk-devel
PORTVERSION=	1.4	# the head branch
CATEGORIES=	net
MASTER_SITES=	# none, we fetch directly from svn (or cvs)
DISTFILES=	# none

MAINTAINER=	luigi@FreeBSD.org
COMMENT=	An Open Source PBX and telephony toolkit - head branch

# --- BUILD OPTIONS ---
#
# If you run "make -DPLAIN" you will only run the svn distribution
# without any local change. Otherwise, you will use whatever
# patch-* and src*.tgz that is in the files directory.
# If you run "make -DNO_FETCH" you will not update the sources from
# the latest version in the svn repository.
#
# Other options are available with "make config", below.
#
# In general, the original asterisk code has some tests in the Makefiles
# to check whether certain packages are installed, and use them in case,
# without giving the user a chance to override the decision.
# Only in a limited number of cases (zaptel, libpri...) there are
# WITHOUT_FOO Makefile variables to disable the use of a given package.
# The options below are designed with the above in mind.
#
# DEVELBSD	use the bsd-specific modifications that are not
#		integrated yet in the trunk.
#		If unset, use trunk, but it is not guaranteed to
#		compile cleanly on FreeBSD
#
# ZAPTEL	support for the ZAPTEL drivers. Strictly speaking,
#		you would need that only with analog or ISDN telephony
#		cards, but a lot of functionality in asterisk relies on
#		this driver, so you might have a hard time without it.
#
# PRI		support for ISDN PRI channels. Not necessary unless you
#		have this cards.
#
# NEWT		make sure newt is installed, if you want to compile astman.
#
# SPEEX		make sure it has speex, additional codec.
#
# H323		make sure the openh323 packages are installed.
#		this is not tested, at the moment.
#
# Database support at the moment includes odbc, pgsql, sqlite and tds
# but there is no option to configure them.

OPTIONS=	\
		DEVELBSD	"BSD development version" off \
		ZAPTEL	"Zaptel (you probably want it)" on \
		PRI	"PRI support (normally off)" off \
		H323	"OpenH323 support (default off)" off \
		NEWT	"newt library, required for astman" off \
		SPEEX	"speex library, optional codec" off \

# Do not try on other architectures, no idea how it works.
ONLY_FOR_ARCHS=	i386	# maybe more but it is untested.

# We are working against -current, so it is not meant to be
# installed or packaged automatically.

RESTRICTED=	experimental version
NO_INSTALL=	"not meant to install"
NO_PACKAGE=	not meant to build a package

EXTRA_SOUNDS = \
	ftp://213.156.62.146/pub/linux/asterisk/sounds/it/it_mm_sounds_20041110.tar.gz

# local components
# The code uses gmake and flex/bison.
USE_GMAKE=	yes
USE_BISON=	yes

# Editline use autoconf, but the configure is there already,
# so these are just reminders.
# GNU_CONFIGURE=	yes
# CONFIGURE_WRKSRC=	${WRKSRC}/editline

.include <bsd.port.pre.mk>	# need to include this before testing options.

# Targets for the fetch command.

FETCH_DEPENDS+= svn:${PORTSDIR}/devel/subversion
.if defined(WITH_DEVELBSD)
# use the FreeBSD-specific version
LOCAL_REPO= ${PORTSDIR}/distfiles/ast-svn/bsd
REMOTE_REPO= http://svn.digium.com/svn/asterisk/team/rizzo/base
.else
# use the main version.
LOCAL_REPO= ${PORTSDIR}/distfiles/ast-svn/asterisk
REMOTE_REPO= http://svn.digium.com/svn/asterisk/trunk/asterisk
.endif
REPO_CMD=  \
	if [ -f asterisk ] ; then \
		svn update ${REMOTE_REPO} . ; else \
	svn checkout ${REMOTE_REPO} . ; fi

do-fetch:
	${MKDIR} ${LOCAL_REPO}
	[ "x${NO_FETCH}" != "x" ] || (cd ${LOCAL_REPO}; ${REPO_CMD} )

.if defined(PLAIN)	# disable any local patches
do-patch:
	@echo "Local patches disabled, to check the FreeBSD compliance"
	@echo "of the standard asterisk distribution."
.endif

do-extract:
	${MKDIR} ${WRKDIR}
	@echo "Copying main repository"
	${CP} -Rp ${LOCAL_REPO} ${WRKSRC}
.if defined(PLAIN)
	@echo "Not extracting local distributions"
.else
	@echo "Extracting local distributions"
	(cd ${WRKSRC}; \
	for fn in ${FILESDIR}/src*.tgz ; do [ ! -f $${fn} ] || tar xvzf $${fn} ; done )
.endif

.if defined(WITH_H323)
# this is untested.
# put in the prerequisites
BUILD_DEPENDS+=	${NONEXISTENT}:${PORTSDIR}/devel/pwlib152:build \
		${NONEXISTENT}:${PORTSDIR}/net/openh323-112:build
.endif

.if defined(WITH_ZAPTEL)
# first, put in the prerequisites.
BUILD_DEPENDS+=	${LOCALBASE}/include/zaptel.h:${PORTSDIR}/misc/zaptel
RUN_DEPENDS+=	${LOCALBASE}/include/zaptel.h:${PORTSDIR}/misc/zaptel
# now look at pri (no pri if no zaptel)
.if defined(WITH_PRI)
LIB_DEPENDS+=	pri.1:${PORTSDIR}/misc/libpri
.else
MAKE_ENV+=	WITHOUT_PRI=1
.endif
.else
MAKE_ENV+=	WITHOUT_ZAPTEL=1
.endif

.if defined(WITH_NEWT)
# newt is required for astmon
LIB_DEPENDS+=	newt.51:${PORTSDIR}/devel/newt
.endif

.if defined(WITH_SPEEX)
# support for additional codecs
LIB_DEPENDS+=	speex.3:${PORTSDIR}/audio/speex
.endif

.include <bsd.port.post.mk>