# -*- coding: utf-8; mode: tcl; tab-width: 4; truncate-lines: t; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:et:sw=4:ts=4:sts=4
# $Id: Portfile 54316 2009-07-24 19:38:59Z snc@macports.org $

PortSystem			1.0

name				asterisk
version             1.6.1.1
categories			net
platforms			darwin
maintainers			viagente.ca:marc.blanchet mr_bond openmaintainer

description			An Open Source PBX and telephony toolkit
long_description	Asterisk is an open source PBX and telephony toolkit.  It \
					provides the ability to develop telephony applications on top of internet \
					telephony (Voice over IP) as well as traditional telephony connectivity (PSTN).
				
homepage			http://www.asterisk.org
master_sites		http://downloads.digium.com/pub/asterisk/releases/
patchfiles          20090420__bug14930.diff
					
depends_lib			port:ncurses \
					port:openssl \
					port:zlib \
					port:bison \
					port:curl \
					port:wget
					
checksums           md5     8e91e14436c1fb385a6ab8dac4507d39 \
                    sha1    db9462d1a829625da0149c4952abfa7eee99d0c2 \
                    rmd160  2eddf1f8b234480a84ce840323c66b204fea09e1

startupitem.create      yes
startupitem.netchange   yes
startupitem.executable  ${prefix}/sbin/asterisk -d

configure.args		--without-h323 --without-zaptel

build.env			ASTCFLAGS=-I${prefix}/include \
					ASTLDFLAGS=-L${prefix}/lib

post-destroot {
	system "rsync -a $worksrcpath/configs/*.sample ${destroot}/${prefix}/etc/asterisk"
	file mkdir "${destroot}/${prefix}/var/run"
	file mkdir "${destroot}/${prefix}/var/log/asterisk"
}
