summaryrefslogtreecommitdiff
path: root/comms/asterisk/patches
diff options
context:
space:
mode:
authorriz <riz>2006-01-13 20:32:38 +0000
committerriz <riz>2006-01-13 20:32:38 +0000
commit4936a95fcb1f97c325344de3f57670b4eaad02e9 (patch)
tree68870952abc7c200609deaab377fbd49ee1464d2 /comms/asterisk/patches
parent53c8457287ada995eb83da49cf4b20d8614191c0 (diff)
downloadpkgsrc-4936a95fcb1f97c325344de3f57670b4eaad02e9.tar.gz
Update asterisk to version 1.2.1. Many, many bugfixes, and some
new features, including support for DUNDi. (http://www.dundi.com/ for more information) The initial framework and porting of this package upgrade was done by Martin J. Laubach, with lots of feature/PLIST fixes by me. DragonFly support added by Joerg Sonnenberger.
Diffstat (limited to 'comms/asterisk/patches')
-rw-r--r--comms/asterisk/patches/patch-aa243
-rw-r--r--comms/asterisk/patches/patch-ab22
-rw-r--r--comms/asterisk/patches/patch-ac49
-rw-r--r--comms/asterisk/patches/patch-ad195
-rw-r--r--comms/asterisk/patches/patch-ae47
-rw-r--r--comms/asterisk/patches/patch-af49
-rw-r--r--comms/asterisk/patches/patch-ah13
-rw-r--r--comms/asterisk/patches/patch-ai27
-rw-r--r--comms/asterisk/patches/patch-aj10
-rw-r--r--comms/asterisk/patches/patch-ak15
-rw-r--r--comms/asterisk/patches/patch-al33
-rw-r--r--comms/asterisk/patches/patch-am22
-rw-r--r--comms/asterisk/patches/patch-an13
13 files changed, 447 insertions, 291 deletions
diff --git a/comms/asterisk/patches/patch-aa b/comms/asterisk/patches/patch-aa
index d866b1872f7..8098de0486d 100644
--- a/comms/asterisk/patches/patch-aa
+++ b/comms/asterisk/patches/patch-aa
@@ -1,115 +1,188 @@
-$NetBSD: patch-aa,v 1.5 2006/01/02 16:02:10 joerg Exp $
+$NetBSD: patch-aa,v 1.6 2006/01/13 20:32:38 riz Exp $
---- Makefile.orig 2005-04-26 14:30:23.000000000 +0000
+--- Makefile.orig 2005-12-05 06:47:51.000000000 +0000
+++ Makefile
-@@ -42,7 +42,11 @@ MPG123TARG=linux
- endif
+@@ -106,31 +106,32 @@ BUSYDETECT+= #-DBUSYDETECT_TONEONLY
+ BUSYDETECT+= #-DBUSYDETECT_COMPARE_TONE_AND_SILENCE
- ifeq ($(findstring BSD,${OSARCH}),BSD)
--PROC=$(shell uname -m)
-+PROC=$(shell uname -p)
-+endif
-+
-+ifeq (${OSARCH},DragonFly)
-+PROC=$(shell uname -p)
+ ifneq ($(OSARCH),SunOS)
+- ASTLIBDIR=$(INSTALL_PREFIX)/usr/lib/asterisk
+- ASTVARLIBDIR=$(INSTALL_PREFIX)/var/lib/asterisk
+- ASTETCDIR=$(INSTALL_PREFIX)/etc/asterisk
+- ASTSPOOLDIR=$(INSTALL_PREFIX)/var/spool/asterisk
+- ASTLOGDIR=$(INSTALL_PREFIX)/var/log/asterisk
+- ASTHEADERDIR=$(INSTALL_PREFIX)/usr/include/asterisk
+- ASTCONFPATH=$(ASTETCDIR)/asterisk.conf
+- ASTBINDIR=$(INSTALL_PREFIX)/usr/bin
+- ASTSBINDIR=$(INSTALL_PREFIX)/usr/sbin
+- ASTVARRUNDIR=$(INSTALL_PREFIX)/var/run
+- ASTMANDIR=$(INSTALL_PREFIX)/usr/share/man
++ASTLIBDIR = /usr/pkg/lib/asterisk
++ASTVARLIBDIR = /usr/pkg/libdata/asterisk
++ASTETCDIR = /usr/pkg/etc/asterisk
++ASTSPOOLDIR = /var/spool/asterisk
++ASTLOGDIR = /var/log/asterisk
++ASTHEADERDIR = /usr/pkg/include/asterisk
++ASTCONFPATH = /usr/pkg/etc/asterisk/asterisk.conf
++ASTBINDIR = /usr/pkg/bin
++ASTSBINDIR = /usr/pkg/sbin
++ASTVARRUNDIR = /var/run
++ASTMANDIR = /usr/pkg/man
++ ASTEXAMPLEDIR?=${PREFIX}/share/examples/asterisk
+ MODULES_DIR=$(ASTLIBDIR)/modules
+ AGI_DIR=$(ASTVARLIBDIR)/agi-bin
+ else
+- ASTLIBDIR=$(INSTALL_PREFIX)/opt/asterisk/lib
+- ASTVARLIBDIR=$(INSTALL_PREFIX)/var/opt/asterisk/lib
+- ASTETCDIR=$(INSTALL_PREFIX)/etc/opt/asterisk
+- ASTSPOOLDIR=$(INSTALL_PREFIX)/var/opt/asterisk/spool
+- ASTLOGDIR=$(INSTALL_PREFIX)/var/opt/asterisk/log
+- ASTHEADERDIR=$(INSTALL_PREFIX)/opt/asterisk/usr/include/asterisk
+- ASTCONFPATH=$(ASTETCDIR)/asterisk.conf
+- ASTBINDIR=$(INSTALL_PREFIX)/opt/asterisk/usr/bin
+- ASTSBINDIR=$(INSTALL_PREFIX)/opt/asterisk/usr/sbin
+- ASTVARRUNDIR=$(INSTALL_PREFIX)/var/opt/asterisk/run
+- ASTMANDIR=$(INSTALL_PREFIX)/opt/asterisk/usr/share/man
++ASTLIBDIR = /usr/pkg/lib/asterisk
++ASTVARLIBDIR = /usr/pkg/libdata/asterisk
++ASTETCDIR = /usr/pkg/etc/asterisk
++ASTSPOOLDIR = /var/spool/asterisk
++ASTLOGDIR = /var/log/asterisk
++ASTHEADERDIR = /usr/pkg/include/asterisk
++ASTCONFPATH = /usr/pkg/etc/asterisk/asterisk.conf
++ASTBINDIR = /usr/pkg/bin
++ASTSBINDIR = /usr/pkg/sbin
++ASTVARRUNDIR = /var/run
++ASTMANDIR = /usr/pkg/man
+ MODULES_DIR=$(ASTLIBDIR)/modules
+ AGI_DIR=$(ASTVARLIBDIR)/agi-bin
endif
+@@ -223,7 +224,7 @@ ASTCFLAGS+=$(OPTIMIZE)
+ ASTOBJ=-o asterisk
- # Pentium Pro Optimize
-@@ -122,6 +122,7 @@ ASTBINDIR=$(INSTALL_PREFIX)/usr/bin
- ASTSBINDIR=$(INSTALL_PREFIX)/usr/sbin
- ASTVARRUNDIR=$(INSTALL_PREFIX)/var/run
- ASTMANDIR=$(INSTALL_PREFIX)/usr/share/man
-+ASTEXAMPLEDIR=${PREFIX}/share/examples/asterisk
+ ifeq ($(findstring BSD,$(OSARCH)),BSD)
+- PROC=$(shell uname -m)
++ PROC=$(shell uname -p)
+ ASTCFLAGS+=-I$(CROSS_COMPILE_TARGET)/usr/local/include -L$(CROSS_COMPILE_TARGET)/usr/local/lib
+ endif
- MODULES_DIR=$(ASTLIBDIR)/modules
- AGI_DIR=$(ASTVARLIBDIR)/agi-bin
-@@ -148,7 +153,7 @@ endif # FreeBSD
+@@ -254,24 +255,24 @@ ifeq ($(OSARCH),FreeBSD)
- ifeq (${OSARCH},NetBSD)
- CFLAGS+=-pthread
--INCLUDE+=-I/usr/local/include -I/usr/pkg/include
-+INCLUDE+=-I${PREFIX}/include
- MPG123TARG=netbsd
- endif
+ # XXX FreeBSD paths
+ PREFIX?=/usr/local
+- ASTLIBDIR=$(INSTALL_PREFIX)$(PREFIX)/lib/asterisk
+- ASTVARLIBDIR=$(INSTALL_PREFIX)$(PREFIX)/share/asterisk
+- ASTETCDIR=$(INSTALL_PREFIX)$(PREFIX)/etc/asterisk
+- ASTSPOOLDIR=$(INSTALL_PREFIX)/var/spool/asterisk
+- ASTLOGDIR=$(INSTALL_PREFIX)/var/log/asterisk
+- ASTHEADERDIR=$(INSTALL_PREFIX)$(PREFIX)/include/asterisk
+- ASTCONFPATH=$(ASTETCDIR)/asterisk.conf
+- ASTBINDIR=$(INSTALL_PREFIX)$(PREFIX)/bin
+- ASTSBINDIR=$(INSTALL_PREFIX)$(PREFIX)/sbin
+- ASTVARRUNDIR=$(INSTALL_PREFIX)/var/run
+- ASTMANDIR=$(INSTALL_PREFIX)$(PREFIX)/man
++ASTLIBDIR = /usr/pkg/lib/asterisk
++ASTVARLIBDIR = /usr/pkg/libdata/asterisk
++ASTETCDIR = /usr/pkg/etc/asterisk
++ASTSPOOLDIR = /var/spool/asterisk
++ASTLOGDIR = /var/log/asterisk
++ASTHEADERDIR = /usr/pkg/include/asterisk
++ASTCONFPATH = /usr/pkg/etc/asterisk/asterisk.conf
++ASTBINDIR = /usr/pkg/bin
++ASTSBINDIR = /usr/pkg/sbin
++ASTVARRUNDIR = /var/run
++ASTMANDIR = /usr/pkg/man
+ # XXX end FreeBSD paths
-@@ -159,8 +164,11 @@ endif
- #Uncomment this to use the older DSP routines
- #CFLAGS+=-DOLD_DSP_ROUTINES
+ endif # FreeBSD
--CFLAGS+=$(shell if [ -f /usr/include/linux/zaptel.h ]; then echo "-DZAPTEL_OPTIMIZATIONS"; fi)
--CFLAGS+=$(shell if [ -f /usr/local/include/zaptel.h ]; then echo "-DZAPTEL_OPTIMIZATIONS"; fi)
-+#CFLAGS+=$(shell if [ -f /usr/include/linux/zaptel.h ]; then echo "-DZAPTEL_OPTIMIZATIONS"; fi)
-+#CFLAGS+=$(shell if [ -f /usr/local/include/zaptel.h ]; then echo "-DZAPTEL_OPTIMIZATIONS"; fi)
-+ifdef ASTERISK_USE_ZAPTEL
-+CFLAGS+=-DZAPTEL_OPTIMIZATIONS
-+endif
+ ifeq ($(OSARCH),NetBSD)
+ ASTCFLAGS+=-pthread
+- INCLUDE+=-I$(CROSS_COMPILE_TARGET)/usr/pkg/include
++ INCLUDE+=-I${PREFIX}/include
+ MPG123TARG=netbsd
+ endif
- LIBEDIT=editline/libedit.a
+@@ -290,7 +291,7 @@ ifeq ($(findstring CYGWIN,$(OSARCH)),CYG
+ ASTOBJ=-shared -o asterisk.dll -Wl,--out-implib=libasterisk.dll.a -Wl,--export-all-symbols
+ ASTLINK=
+ LIBS+=-lpthread -lncurses -lm -lresolv
+- ASTSBINDIR=$(MODULES_DIR)
++ASTSBINDIR = /usr/pkg/sbin
+ PROC=$(shell uname -m)
+ endif
-@@ -200,7 +208,10 @@ ifeq (${OSARCH},FreeBSD)
- LIBS+=-lcrypto
+@@ -367,7 +368,8 @@ ifeq ($(OSARCH),Darwin)
+ AUDIO_LIBS=-framework CoreAudio
+ ASTLINK=-Wl,-dynamic
+ SOLINK=-dynamic -bundle -undefined suppress -force_flat_namespace
+- OBJS+= poll.o
++ OBJS+=dlfcn.o
++ OBJS+=$(shell if [ -e /usr/include/sys/poll.h ]; then echo -n "" ; else echo poll.o; fi)
+ ASTCFLAGS+=-DPOLLCOMPAT
+ else
+ #These are used for all but Darwin
+@@ -379,8 +381,12 @@ ifeq ($(OSARCH),FreeBSD)
+ LIBS+=-lcrypto
endif
- ifeq (${OSARCH},NetBSD)
--LIBS+=-lpthread -lcrypto -lm -L/usr/local/lib -L/usr/pkg/lib -lncurses
-+LIBS+=-lpthread -lcrypto -lm -L${PREFIX}/lib -R${PREFIX}/lib -lncurses
+
++ifeq ($(OSARCH),DragonFly)
++ LIBS+=-lcrypto -pthread
+endif
-+ifeq (${OSARCH},DragonFly)
-+LIBS+=-pthread -lcrypto -lm -L${PREFIX}/lib -R${PREFIX}/lib -lncurses
++
+ ifeq ($(OSARCH),NetBSD)
+- LIBS+=-lpthread -lcrypto -lm -L$(CROSS_COMPILE_TARGET)/usr/pkg/lib -lncurses
++ LIBS+=-lpthread -lcrypto -lm -L${PREFIX}/lib -R${PREFIX}/lib -lncurses
endif
- ifeq (${OSARCH},OpenBSD)
- LIBS=-lcrypto -lpthread -lm -lncurses
-@@ -214,7 +225,8 @@ OBJS=io.o sched.o logger.o frame.o loade
- astmm.o enum.o srv.o dns.o aescrypt.o aestab.o aeskey.o \
- utils.o
- ifeq (${OSARCH},Darwin)
--OBJS+=poll.o dlfcn.o
-+OBJS+=dlfcn.o
-+OBJS+=$(shell if [ -e /usr/include/sys/poll.h ]; then echo -n "" ; else echo poll.o; fi)
- ASTLINK=-Wl,-dynamic
- SOLINK=-dynamic -bundle -undefined suppress -force_flat_namespace
- else
-@@ -450,29 +462,29 @@ install: all datafiles bininstall
+
+ ifeq ($(OSARCH),OpenBSD)
+@@ -718,31 +724,31 @@ install: all datafiles bininstall
upgrade: all bininstall
- adsi: all
+ adsi:
- mkdir -p $(DESTDIR)$(ASTETCDIR)
+ mkdir -p $(DESTDIR)$(ASTEXAMPLEDIR)
for x in configs/*.adsi; do \
-- if ! [ -f $(DESTDIR)$(ASTETCDIRX)/$$x ]; then \
-- install -m 644 $$x $(DESTDIR)$(ASTETCDIR)/`basename $$x` ; \
+- if [ ! -f $(DESTDIR)$(ASTETCDIRX)/$$x ]; then \
+- $(INSTALL) -m 644 $$x $(DESTDIR)$(ASTETCDIR)/`basename $$x` ; \
+ if ! [ -f $(DESTDIR)$(ASTEXAMPLEDIR)/$$x ]; then \
-+ install -m 644 $$x $(DESTDIR)$(ASTEXAMPLEDIR)/`basename $$x` ; \
++ $(INSTALL) -m 644 $$x $(DESTDIR)$(ASTEXAMPLEDIR)/`basename $$x` ; \
fi ; \
done
- samples: all datafiles adsi
+ samples: adsi
- mkdir -p $(DESTDIR)$(ASTETCDIR)
+ mkdir -p $(DESTDIR)$(ASTEXAMPLEDIR)
for x in configs/*.sample; do \
- if [ -f $(DESTDIR)$(ASTETCDIR)/`basename $$x .sample` ]; then \
-- mv -f $(DESTDIR)$(ASTETCDIR)/`basename $$x .sample` $(DESTDIR)$(ASTETCDIR)/`basename $$x .sample`.old ; \
+ if [ -f $(DESTDIR)$(ASTEXAMPLEDIR)/`basename $$x .sample` ]; then \
-+ mv -f $(DESTDIR)$(ASTEXAMPLEDIR)/`basename $$x .sample` $(DESTDIR)$(ASTEXAMPLEDIR)/`basename $$x .sample`.old ; \
+ if [ "$(OVERWRITE)" = "y" ]; then \
+- if cmp -s $(DESTDIR)$(ASTETCDIR)/`basename $$x .sample` $$x ; then \
++ if cmp -s $(DESTDIR)$(ASTEXAMPLEDIR)/`basename $$x .sample` $$x ; then \
+ echo "Config file $$x is unchanged"; \
+ continue; \
+ fi ; \
+- mv -f $(DESTDIR)$(ASTETCDIR)/`basename $$x .sample` $(DESTDIR)$(ASTETCDIR)/`basename $$x .sample`.old ; \
++ mv -f $(DESTDIR)$(ASTEXAMPLEDIR)/`basename $$x .sample` $(DESTDIR)$(ASTEXAMPLEDIR)/`basename $$x .sample`.old ; \
+ else \
+ echo "Skipping config file $$x"; \
+ continue; \
+ fi ;\
fi ; \
-- install -m 644 $$x $(DESTDIR)$(ASTETCDIR)/`basename $$x .sample` ;\
-+ install -m 644 $$x $(DESTDIR)$(ASTEXAMPLEDIR)/`basename $$x .sample` ;\
+- $(INSTALL) -m 644 $$x $(DESTDIR)$(ASTETCDIR)/`basename $$x .sample` ;\
++ $(INSTALL) -m 644 $$x $(DESTDIR)$(ASTEXAMPLEDIR)/`basename $$x .sample` ;\
done
-- echo "[directories]" > $(DESTDIR)$(ASTETCDIR)/asterisk.conf
-- echo "astetcdir => $(ASTETCDIR)" >> $(DESTDIR)$(ASTETCDIR)/asterisk.conf
-- echo "astmoddir => $(MODULES_DIR)" >> $(DESTDIR)$(ASTETCDIR)/asterisk.conf
-- echo "astvarlibdir => $(ASTVARLIBDIR)" >> $(DESTDIR)$(ASTETCDIR)/asterisk.conf
-- echo "astagidir => $(AGI_DIR)" >> $(DESTDIR)$(ASTETCDIR)/asterisk.conf
-- echo "astspooldir => $(ASTSPOOLDIR)" >> $(DESTDIR)$(ASTETCDIR)/asterisk.conf
-- echo "astrundir => $(ASTVARRUNDIR)" >> $(DESTDIR)$(ASTETCDIR)/asterisk.conf
-- echo "astlogdir => $(ASTLOGDIR)" >> $(DESTDIR)$(ASTETCDIR)/asterisk.conf
-+ echo "[directories]" > $(DESTDIR)$(ASTEXAMPLEDIR)/asterisk.conf
-+ echo "astetcdir => $(ASTETCDIR)" >> $(DESTDIR)$(ASTEXAMPLEDIR)/asterisk.conf
-+ echo "astmoddir => $(MODULES_DIR)" >> $(DESTDIR)$(ASTEXAMPLEDIR)/asterisk.conf
-+ echo "astvarlibdir => $(ASTVARLIBDIR)" >> $(DESTDIR)$(ASTEXAMPLEDIR)/asterisk.conf
-+ echo "astagidir => $(AGI_DIR)" >> $(DESTDIR)$(ASTEXAMPLEDIR)/asterisk.conf
-+ echo "astspooldir => $(ASTSPOOLDIR)" >> $(DESTDIR)$(ASTEXAMPLEDIR)/asterisk.conf
-+ echo "astrundir => $(ASTVARRUNDIR)" >> $(DESTDIR)$(ASTEXAMPLEDIR)/asterisk.conf
-+ echo "astlogdir => $(ASTLOGDIR)" >> $(DESTDIR)$(ASTEXAMPLEDIR)/asterisk.conf
- for x in sounds/demo-*; do \
- if grep -q "^%`basename $$x`%" sounds.txt; then \
- install -m 644 $$x $(DESTDIR)$(ASTVARLIBDIR)/sounds ; \
+- if [ "$(OVERWRITE)" = "y" ] || [ ! -f $(DESTDIR)$(ASTCONFPATH) ]; then \
++ if [ "$(OVERWRITE)" = "y" ] || [ ! -f $(DESTDIR)$(ASTEXAMPLEDIR)/asterisk.conf ]; then \
+ ( \
+ echo "[directories]" ; \
+ echo "astetcdir => $(ASTETCDIR)" ; \
+@@ -759,7 +765,7 @@ samples: adsi
+ echo ";astctlowner = root" ; \
+ echo ";astctlgroup = apache" ; \
+ echo ";astctl = asterisk.ctl" ; \
+- ) > $(DESTDIR)$(ASTCONFPATH) ; \
++ ) > $(DESTDIR)$(ASTEXAMPLEDIR)/asterisk.conf ; \
+ else \
+ echo "Skipping asterisk.conf creation"; \
+ fi
diff --git a/comms/asterisk/patches/patch-ab b/comms/asterisk/patches/patch-ab
index 5632b27258c..aaa277d36a3 100644
--- a/comms/asterisk/patches/patch-ab
+++ b/comms/asterisk/patches/patch-ab
@@ -1,17 +1,15 @@
-$NetBSD: patch-ab,v 1.1.1.1 2005/04/08 03:10:52 riz Exp $
---- pbx/Makefile.orig 2003-10-26 10:50:49.000000000 -0800
-+++ pbx/Makefile 2005-03-30 14:08:41.000000000 -0800
-@@ -16,9 +16,12 @@
- PBX_LIBS=pbx_config.so pbx_wilcalu.so pbx_spool.so # pbx_gtkconsole.so pbx_kdeconsole.so
-
- # Add GTK console if appropriate
--PBX_LIBS+=$(shell gtk-config --cflags >/dev/null 2>/dev/null && echo "pbx_gtkconsole.so")
-+#PBX_LIBS+=$(shell gtk-config --cflags >/dev/null 2>/dev/null && echo "pbx_gtkconsole.so")
+$NetBSD: patch-ab,v 1.2 2006/01/13 20:32:38 riz Exp $
+
+--- pbx/Makefile.orig 2005-11-29 19:24:39.000000000 +0100
++++ pbx/Makefile 2005-12-25 13:20:08.000000000 +0100
+@@ -23,6 +23,10 @@
# Add KDE Console if appropriate
#PBX_LIBS+=$(shell [ "$$QTDIR" != "" ] && echo "pbx_kdeconsole.so")
+
+ifdef ASTERISK_USE_GTK
+PBX_LIBS+=pbx_gtkconsole.so
+endif
-
-
- GTK_FLAGS=`gtk-config --cflags gthread`
++
+ GTK_FLAGS=`${CROSS_COMPILE_BIN}gtk-config --cflags gthread`
+ GTK_LIBS=`${CROSS_COMPILE_BIN}gtk-config --libs gthread`
+ MOC=$(QTDIR)/bin/moc
diff --git a/comms/asterisk/patches/patch-ac b/comms/asterisk/patches/patch-ac
index f946d432c10..e397e21db2e 100644
--- a/comms/asterisk/patches/patch-ac
+++ b/comms/asterisk/patches/patch-ac
@@ -1,28 +1,27 @@
-$NetBSD: patch-ac,v 1.1.1.1 2005/04/08 03:10:52 riz Exp $
---- res/Makefile.orig 2004-07-17 13:58:01.000000000 -0700
-+++ res/Makefile 2005-03-30 12:48:37.000000000 -0800
-@@ -13,15 +13,18 @@
+$NetBSD: patch-ac,v 1.2 2006/01/13 20:32:38 riz Exp $
+
+--- res/Makefile.orig 2005-11-29 19:24:39.000000000 +0100
++++ res/Makefile 2005-12-25 13:16:43.000000000 +0100
+@@ -13,14 +13,14 @@
- MODS=res_adsi.so res_features.so res_crypto.so res_musiconhold.so res_indications.so res_monitor.so \
- res_agi.so
--MODS+=$(shell if [ -f "/usr/include/odbcinst.h" ]; then echo "res_odbc.so res_config_odbc.so"; fi)
--MODS+=$(shell if [ -f "/usr/local/include/odbcinst.h" ]; then echo "res_odbc.so res_config_odbc.so"; fi)
--MODS+=$(shell if [ -f "/usr/include/osp/osp.h" ]; then echo "res_osp.so"; fi)
-+#MODS+=$(shell if [ -f "/usr/include/odbcinst.h" ]; then echo "res_odbc.so res_config_odbc.so"; fi)
-+#MODS+=$(shell if [ -f "/usr/local/include/odbcinst.h" ]; then echo "res_odbc.so res_config_odbc.so"; fi)
-+#MODS+=$(shell if [ -f "/usr/include/osp/osp.h" ]; then echo "res_osp.so"; fi)
+ MODS=res_indications.so res_monitor.so res_adsi.so res_agi.so res_features.so
- CRYPTO_LIBS=-lssl -lcrypto
+-ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/include/odbcinst.h)$(wildcard $(CROSS_COMPILE_TARGET)/usr/local/include/odbcinst.h),)
+- ifneq (${OSARCH},FreeBSD)
+- MODS+=res_config_odbc.so
+- else
+- MODS+=$(shell if test ${BSDVERSION} -ge 500000 ; then echo "res_config_odbc.so"; fi)
+- endif
+- MODS+=res_odbc.so
+-endif
++# ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/include/odbcinst.h)$(wildcard $(CROSS_COMPILE_TARGET)/usr/local/include/odbcinst.h),)
++# ifneq (${OSARCH},FreeBSD)
++# MODS+=res_config_odbc.so
++# else
++# MODS+=$(shell if test ${BSDVERSION} -ge 500000 ; then echo "res_config_odbc.so"; fi)
++# endif
++# MODS+=res_odbc.so
++# endif
--CFLAGS+=
--CFLAGS+=$(shell [ -f /usr/include/linux/zaptel.h ] && echo " -DZAPATA_MOH")
--CFLAGS+=$(shell [ -f /usr/local/include/zaptel.h ] && echo " -DZAPATA_MOH")
-+#CFLAGS+=
-+#CFLAGS+=$(shell [ -f /usr/include/linux/zaptel.h ] && echo " -DZAPATA_MOH")
-+#CFLAGS+=$(shell [ -f /usr/local/include/zaptel.h ] && echo " -DZAPATA_MOH")
-+ifdef ASTERISK_USE_ZAPTEL
-+CFLAGS+=-DZAPATA_MOH
-+endif
- #
- # Work around buggy RedHat 9.0
- #
+ ifneq ($(NOCRYPTO),yes)
+ MODS+=res_crypto.so
diff --git a/comms/asterisk/patches/patch-ad b/comms/asterisk/patches/patch-ad
index dc6be8986fd..b66110e3fb7 100644
--- a/comms/asterisk/patches/patch-ad
+++ b/comms/asterisk/patches/patch-ad
@@ -1,88 +1,137 @@
-$NetBSD: patch-ad,v 1.1.1.1 2005/04/08 03:10:52 riz Exp $
---- channels/Makefile.orig 2004-08-31 09:33:00.000000000 -0700
-+++ channels/Makefile 2005-03-30 12:32:50.000000000 -0800
-@@ -38,11 +38,11 @@
- #CHANNEL_LIBS+=chan_vofr
+$NetBSD: patch-ad,v 1.2 2006/01/13 20:32:38 riz Exp $
+
+--- channels/Makefile.orig 2005-11-29 19:24:39.000000000 +0100
++++ channels/Makefile 2005-12-25 13:13:12.000000000 +0100
+@@ -22,12 +22,13 @@
+ endif
+
+ ifeq ($(findstring BSD,${OSARCH}),BSD)
+- CFLAGS+=-I$(CROSS_COMPILE_TARGET)/usr/local/include -L$(CROSS_COMPILE_TARGET)/usr/local/lib
++ CFLAGS+=-I${PREFIX}/include -L${PREFIX}/lib
+ endif
ifeq (${OSARCH},OpenBSD)
--MYSQLLIB=-L/usr/local/lib/mysql -lmysqlclient
--CFLAGS+=-I/usr/local/include
-+MYSQLLIB=-L${PREFIX}/lib/mysql -lmysqlclient
-+CFLAGS+=-I${PREFIX}/include
- PTLIB=-lpt_OpenBSD_x86_r
- H323LIB=-lh323_OpenBSD_x86_r
--CHANH323LIB=-L/usr/local/lib
-+CHANH323LIB=-L${PREFIX}/lib
+ PTLIB=-lpt_OpenBSD_x86_r
+ H323LIB=-lh323_OpenBSD_x86_r
++ CHANH323LIB=-L${PREFIX}/lib
endif
+
ifeq (${OSARCH},Linux)
- MYSQLLIB=-L/usr/lib/mysql -lmysqlclient
-@@ -60,33 +60,36 @@
- PTLIB=-lpt_FreeBSD_x86_r
- H323LIB=-lh323_FreeBSD_x86_r
- CHANH323LIB=-pthread
--SOLINK+=-L/usr/local/lib
-+SOLINK+=-L${PREFIX}/lib -R${PREFIX}/lib
- endif
- ifeq (${OSARCH},NetBSD)
- PTLIB=-lpt_NetBSD_x86_r
- H323LIB=-lh323_NetBSD_x86_r
--SOLINK+=-L/usr/local/lib
-+SOLINK+=-L${PREFIX}/lib -R${PREFIX}/lib
- endif
- ifneq (${OSARCH},Darwin)
- CHANNEL_LIBS+=chan_oss.so
+@@ -73,40 +74,40 @@
+ SOLINK+=-lrt
endif
--CHANNEL_LIBS+=$(shell [ -f /usr/include/linux/ixjuser.h ] && echo chan_phone.so)
--CHANNEL_LIBS+=$(shell [ -f /usr/local/include/ixjuser.h ] && echo chan_phone.so)
--CHANNEL_LIBS+=$(shell [ -f h323/libchanh323.a ] && echo chan_h323.so)
-+#CHANNEL_LIBS+=$(shell [ -f /usr/include/linux/ixjuser.h ] && echo chan_phone.so)
-+CHANNEL_LIBS+=$(shell [ -f ${PREFIX}/include/ixjuser.h ] && echo chan_phone.so)
-+#CHANNEL_LIBS+=$(shell [ -f h323/libchanh323.a ] && echo chan_h323.so)
+-ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/include/linux/ixjuser.h)$(wildcard $(CROSS_COMPILE_TARGET)/usr/local/include/ixjuser.h),)
+- CHANNEL_LIBS+=chan_phone.so
+-endif
+-
+-ifneq ($(wildcard h323/libchanh323.a),)
+- CHANNEL_LIBS+=chan_h323.so
+-endif
+-
+-ifneq ($(wildcard misdn/chan_misdn_lib.a),)
+- CHANNEL_LIBS+=chan_misdn.so
+-endif
++# ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/include/linux/ixjuser.h)$(wildcard $(CROSS_COMPILE_TARGET)/usr/local/include/ixjuser.h),)
++# CHANNEL_LIBS+=chan_phone.so
++# endif
++
++# ifneq ($(wildcard h323/libchanh323.a),)
++# CHANNEL_LIBS+=chan_h323.so
++# endif
++
++# ifneq ($(wildcard misdn/chan_misdn_lib.a),)
++# CHANNEL_LIBS+=chan_misdn.so
++# endif
CFLAGS+=-Wno-missing-prototypes -Wno-missing-declarations
--CFLAGS+=$(shell [ ! -f /usr/include/linux/if_wanpipe.h ] && echo " -DOLD_SANGOMA_API")
--CHANNEL_LIBS+=$(shell [ -f /usr/include/alsa/asoundlib.h ] && echo "chan_alsa.so")
--CFLAGS+=$(shell [ -f /usr/lib/libpri.so.1 ] && echo " -DZAPATA_PRI")
--CFLAGS+=$(shell [ -f /usr/lib/libmfcr2.so.1 ] && echo " -DZAPATA_R2")
--CFLAGS+=$(shell [ -f alsa-monitor.h ] && echo " -DALSA_MONITOR")
--ZAPPRI=$(shell [ -f /usr/lib/libpri.so.1 ] && echo "-lpri")
--ZAPR2=$(shell [ -f /usr/lib/libmfcr2.so.1 ] && echo "-lmfcr2")
--CFLAGS+=$(shell [ -f /usr/include/linux/zaptel.h ] && echo "-DIAX_TRUNKING")
--CFLAGS+=$(shell [ -f /usr/local/include/zaptel.h ] && echo "-DIAX_TRUNKING")
--CHANNEL_LIBS+=$(shell [ -f /usr/include/vpbapi.h ] && echo "chan_vpb.so" )
--CFLAGS+=$(shell [ -f /usr/include/vpbapi.h ] && echo " -DLINUX")
-+#CFLAGS+=$(shell [ ! -f /usr/include/linux/if_wanpipe.h ] && echo " -DOLD_SANGOMA_API")
-+#CHANNEL_LIBS+=$(shell [ -f /usr/include/alsa/asoundlib.h ] && echo "chan_alsa.so")
-+#CFLAGS+=$(shell [ -f /usr/lib/libpri.so.1 ] && echo " -DZAPATA_PRI")
-+#CFLAGS+=$(shell [ -f /usr/lib/libmfcr2.so.1 ] && echo " -DZAPATA_R2")
-+#CFLAGS+=$(shell [ -f alsa-monitor.h ] && echo " -DALSA_MONITOR")
-+#ZAPPRI=$(shell [ -f /usr/lib/libpri.so.1 ] && echo "-lpri")
-+#ZAPR2=$(shell [ -f /usr/lib/libmfcr2.so.1 ] && echo "-lmfcr2")
-+#CFLAGS+=$(shell [ -f /usr/include/linux/zaptel.h ] && echo "-DIAX_TRUNKING")
-+#CFLAGS+=$(shell [ -f /usr/local/include/zaptel.h ] && echo "-DIAX_TRUNKING")
-+ifdef ASTERISK_USE_ZAPTEL
-+CFLAGS+= -DIAX_TRUNKING
-+endif
-+#CHANNEL_LIBS+=$(shell [ -f /usr/include/vpbapi.h ] && echo "chan_vpb.so" )
-+#CFLAGS+=$(shell [ -f /usr/include/vpbapi.h ] && echo " -DLINUX")
+
+-ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/include/alsa/asoundlib.h),)
+- CHANNEL_LIBS+=chan_alsa.so
+-endif
+-
+-ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/lib/libpri.so.1)$(wildcard $(CROSS_COMPILE_TARGET)/usr/local/lib/libpri.so.1),)
+- CFLAGS+=-DZAPATA_PRI
+- ZAPPRI=-lpri
+-endif
+-
+-ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/lib/libmfcr2.so.1)$(wildcard $(CROSS_COMPILE_TARGET)/usr/local/lib/libmfcr2.so.1),)
+- CFLAGS+=-DZAPATA_R2
+- ZAPR2=-lmfcr2
+-endif
++# ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/include/alsa/asoundlib.h),)
++# CHANNEL_LIBS+=chan_alsa.so
++# endif
++
++# ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/lib/libpri.so.1)$(wildcard $(CROSS_COMPILE_TARGET)/usr/local/lib/libpri.so.1),)
++# CFLAGS+=-DZAPATA_PRI
++# ZAPPRI=-lpri
++# endif
++
++# ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/lib/libmfcr2.so.1)$(wildcard $(CROSS_COMPILE_TARGET)/usr/local/lib/libmfcr2.so.1),)
++# CFLAGS+=-DZAPATA_R2
++# ZAPR2=-lmfcr2
++# endif
ALSA_SRC=chan_alsa.c
- ALSA_SRC+=$(shell [ -f alsa-monitor.h ] && echo "alsa-monitor.h")
-@@ -106,10 +109,13 @@
- ZAPDIR=/usr/lib
+-ifneq ($(wildcard alsa-monitor.h),)
+- CFLAGS+=-DALSA_MONITOR
+- ALSA_SRC+=alsa-monitor.h
+-endif
++# ifneq ($(wildcard alsa-monitor.h),)
++# CFLAGS+=-DALSA_MONITOR
++# ALSA_SRC+=alsa-monitor.h
++# endif
--CHANNEL_LIBS+=$(shell [ -f /usr/include/linux/zaptel.h ] && echo "chan_zap.so")
--CHANNEL_LIBS+=$(shell [ -f /usr/local/include/zaptel.h ] && echo "chan_zap.so")
-+#CHANNEL_LIBS+=$(shell [ -f /usr/include/linux/zaptel.h ] && echo "chan_zap.so")
-+#CHANNEL_LIBS+=$(shell [ -f /usr/local/include/zaptel.h ] && echo "chan_zap.so")
-+ifdef ASTERISK_USE_ZAPTEL
-+CHANNEL_LIBS+=chan_zap.so
-+endif
+ ifndef WITHOUT_ZAPTEL
+ ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/include/linux/zaptel.h)$(wildcard $(CROSS_COMPILE_TARGET)/usr/local/include/zaptel.h)$(wildcard $(CROSS_COMPILE_TARGET)/usr/pkg/include/zaptel.h),)
+@@ -121,10 +122,10 @@
+ endif
+ endif # WITHOUT_ZAPTEL
--CHANNEL_LIBS+=$(shell [ -f /usr/include/nbs.h ] && echo "chan_nbs.so" )
-+#CHANNEL_LIBS+=$(shell [ -f /usr/include/nbs.h ] && echo "chan_nbs.so" )
+-ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/include/vpbapi.h),)
+- CHANNEL_LIBS+=chan_vpb.so
+- CFLAGS+=-DLINUX
+-endif
++# ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/include/vpbapi.h),)
++# CHANNEL_LIBS+=chan_vpb.so
++# CFLAGS+=-DLINUX
++# endif
+
+ CFLAGS+=-DCRYPTO
+
+@@ -136,9 +137,9 @@
+
+ ZAPDIR=/usr/lib
+
+-ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/include/nbs.h),)
+- CHANNEL_LIBS+=chan_nbs.so
+-endif
++# ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/include/nbs.h),)
++# CHANNEL_LIBS+=chan_nbs.so
++# endif
ifndef OPENH323DIR
- OPENH323DIR=$(HOME)/openh323
+ OPENH323DIR=$(HOME)/openh323
+@@ -163,13 +164,13 @@
+ include .depend
+ endif
+
+-ifneq ($(wildcard h323/Makefile.ast),)
+- include h323/Makefile.ast
+-endif
+-
+-ifneq ($(wildcard misdn/Makefile.ast),)
+- include misdn/Makefile.ast
+-endif
++# ifneq ($(wildcard h323/Makefile.ast),)
++# include h323/Makefile.ast
++# endif
++
++# ifneq ($(wildcard misdn/Makefile.ast),)
++# include misdn/Makefile.ast
++# endif
+
+ gentone: gentone.c
+ $(HOST_CC) -o gentone gentone.c -lm
diff --git a/comms/asterisk/patches/patch-ae b/comms/asterisk/patches/patch-ae
index cc3a3c9701c..2a218da43df 100644
--- a/comms/asterisk/patches/patch-ae
+++ b/comms/asterisk/patches/patch-ae
@@ -1,19 +1,36 @@
-$NetBSD: patch-ae,v 1.1.1.1 2005/04/08 03:10:52 riz Exp $
---- apps/Makefile.orig 2005-03-30 12:40:19.000000000 -0800
-+++ apps/Makefile 2005-03-30 12:41:21.000000000 -0800
-@@ -39,9 +39,12 @@
- #APPS+=app_sql_odbc.so
+$NetBSD: patch-ae,v 1.2 2006/01/13 20:32:38 riz Exp $
+--- apps/Makefile.orig 2005-11-29 18:24:39.000000000 +0000
++++ apps/Makefile 2006-01-02 00:58:23.000000000 +0000
+@@ -45,15 +45,17 @@
#APPS+=app_rpt.so
--APPS+=$(shell if [ -f /usr/include/linux/zaptel.h ]; then echo "app_zapras.so app_meetme.so app_flash.so app_zapbarge.so app_zapscan.so" ; fi)
--APPS+=$(shell if [ -f /usr/local/include/zaptel.h ]; then echo "app_zapras.so app_meetme.so app_flash.so app_zapbarge.so app_zapscan.so" ; fi)
--APPS+=$(shell if [ -f /usr/include/osp/osp.h ]; then echo "app_osplookup.so" ; fi)
-+#APPS+=$(shell if [ -f /usr/include/linux/zaptel.h ]; then echo "app_zapras.so app_meetme.so app_flash.so app_zapbarge.so app_zapscan.so" ; fi)
-+#APPS+=$(shell if [ -f /usr/local/include/zaptel.h ]; then echo "app_zapras.so app_meetme.so app_flash.so app_zapbarge.so app_zapscan.so" ; fi)
-+#APPS+=$(shell if [ -f /usr/include/osp/osp.h ]; then echo "app_osplookup.so" ; fi)
-+ifdef ASTERISK_USE_ZAPTEL
-+APPS+= app_zapras.so app_meetme.so app_flash.so app_zapbarge.so app_zapscan.so
-+endif
+ ifndef WITHOUT_ZAPTEL
+-ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/include/linux/zaptel.h)$(wildcard $(CROSS_COMPILE_TARGET)/usr/local/include/zaptel.h),)
++ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/include/linux/zaptel.h)$(wildcard $(CROSS_COMPILE_TARGET)$(PREFIX)/include/zaptel.h),)
+ APPS+=app_zapras.so app_meetme.so app_flash.so app_zapbarge.so app_zapscan.so app_page.so
+ endif
+ endif # WITHOUT_ZAPTEL
- CFLAGS+=-fPIC
+-ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/local/include/osp/osp.h $(CROSS_COMPILE_TARGET)/usr/include/osp/osp.h),)
++ifneq ($(wildcard $(CROSS_COMPILE_TARGET)$(PREFIX)/include/osp/osp.h $(CROSS_COMPILE_TARGET)/usr/include/osp/osp.h),)
+ APPS+=app_osplookup.so
+ endif
++CFLAGS+=-I$(CROSS_COMPILE_TARGET)/$(PREFIX)/include -L$(CROSS_COMPILE_TARGET)/$(PREFIX)/lib
++
+ ifeq ($(findstring BSD,${OSARCH}),BSD)
+ CFLAGS+=-I$(CROSS_COMPILE_TARGET)/usr/local/include -L$(CROSS_COMPILE_TARGET)/usr/local/lib
+ endif
+@@ -103,10 +105,10 @@
+ $(CC) $(SOLINK) -o $@ ${CYGSOLINK} $< ${CYGSOLIB} $(CURLLIBS)
+
+ app_sql_postgres.o: app_sql_postgres.c
+- $(CC) -pipe -I/usr/local/pgsql/include $(CFLAGS) -c -o app_sql_postgres.o app_sql_postgres.c
++ $(CC) -pipe -I${PREFIX}/include $(CFLAGS) -c -o app_sql_postgres.o app_sql_postgres.c
+
+ app_sql_postgres.so: app_sql_postgres.o
+- $(CC) $(SOLINK) -o $@ ${CYGSOLINK} $< ${CYGSOLIB} -L/usr/local/pgsql/lib -lpq
++ $(CC) $(SOLINK) -o $@ ${CYGSOLINK} $< ${CYGSOLIB} -L${PREFIX}/lib -lpq
+
+ app_sql_odbc.so: app_sql_odbc.o
+ $(CC) $(SOLINK) -o $@ ${CYGSOLINK} $< ${CYGSOLIB} -lodbc
diff --git a/comms/asterisk/patches/patch-af b/comms/asterisk/patches/patch-af
index d3845613ffc..73339b11ae7 100644
--- a/comms/asterisk/patches/patch-af
+++ b/comms/asterisk/patches/patch-af
@@ -1,20 +1,37 @@
-$NetBSD: patch-af,v 1.2 2005/09/02 12:58:34 adam Exp $
+$NetBSD: patch-af,v 1.3 2006/01/13 20:32:38 riz Exp $
---- codecs/gsm/Makefile.orig 2005-06-21 14:27:28.000000000 +0000
-+++ codecs/gsm/Makefile
-@@ -44,6 +44,7 @@ ifneq ($(shell uname -m),ppc)
- ifneq ($(shell uname -m),alpha)
- ifneq ($(shell uname -m),armv4l)
- ifneq (${PROC},sparc64)
-+ifneq (${PROC},powerpc)
- ifneq (${PROC},ppc)
- ifneq (${PROC},ppc64)
- OPTIMIZE+=-march=$(PROC)
-@@ -56,6 +57,7 @@ endif
- endif
- endif
- endif
-+endif
+--- codecs/gsm/Makefile.orig 2005-11-29 19:24:39.000000000 +0100
++++ codecs/gsm/Makefile 2005-12-25 12:55:32.000000000 +0100
+@@ -37,32 +37,6 @@ WAV49 = -DWAV49
+ ######### ppro's, etc, as well as the AMD K6 and K7. The compile will
+ ######### probably require gcc.
+-ifneq (${OSARCH},Darwin)
+-ifneq (${OSARCH},SunOS)
+-ifneq (${PROC},x86_64)
+-ifneq (${PROC},ultrasparc)
+-ifneq ($(shell uname -m),ppc)
+-ifneq ($(shell uname -m),ppc64)
+-ifneq ($(shell uname -m),alpha)
+-ifneq ($(shell uname -m),armv4l)
+-ifneq (${PROC},sparc64)
+-ifneq (${PROC},arm)
+-ifneq (${PROC},ppc)
+-ifneq (${PROC},ppc64)
+-OPTIMIZE+=-march=$(PROC)
+-endif
+-endif
+-endif
+-endif
+-endif
+-endif
+-endif
+-endif
+-endif
+-endif
+-endif
+-endif
+-
#The problem with sparc is the best stuff is in newer versions of gcc (post 3.0) only.
#This works for even old (2.96) versions of gcc and provides a small boost either way.
+ #A ultrasparc cpu is really v9 but the stock debian stable 3.0 gcc doesn't support it.
diff --git a/comms/asterisk/patches/patch-ah b/comms/asterisk/patches/patch-ah
deleted file mode 100644
index 350ed2f2dd4..00000000000
--- a/comms/asterisk/patches/patch-ah
+++ /dev/null
@@ -1,13 +0,0 @@
-$NetBSD: patch-ah,v 1.1 2006/01/02 16:02:10 joerg Exp $
-
---- md5.c.orig 2006-01-02 15:26:06.000000000 +0000
-+++ md5.c
-@@ -3,7 +3,7 @@
- #if defined( __OpenBSD__ )
- # include <machine/types.h>
- # include <sys/endian.h>
--#elif defined( __FreeBSD__ ) || defined( __NetBSD__ )
-+#elif defined( __FreeBSD__ ) || defined( __NetBSD__ ) || defined(__DragonFly__)
- # include <sys/types.h>
- # include <sys/endian.h>
- #elif defined( BSD ) && ( BSD >= 199103 ) || defined(__APPLE__)
diff --git a/comms/asterisk/patches/patch-ai b/comms/asterisk/patches/patch-ai
index 06fabde00d1..215788b01d5 100644
--- a/comms/asterisk/patches/patch-ai
+++ b/comms/asterisk/patches/patch-ai
@@ -1,13 +1,16 @@
-$NetBSD: patch-ai,v 1.1 2006/01/02 16:02:10 joerg Exp $
+$NetBSD: patch-ai,v 1.2 2006/01/13 20:32:38 riz Exp $
---- aesopt.h.orig 2006-01-02 15:28:16.000000000 +0000
-+++ aesopt.h
-@@ -151,7 +151,7 @@
- #if defined( __OpenBSD__ )
- # include <machine/types.h>
- # include <sys/endian.h>
--#elif defined( __FreeBSD__ ) || defined( __NetBSD__ )
-+#elif defined( __FreeBSD__ ) || defined( __NetBSD__ ) || defined(__DragonFly__)
- # include <sys/types.h>
- # include <sys/endian.h>
- #elif defined( BSD ) && ( BSD >= 199103 ) || defined(__APPLE__)
+--- include/asterisk/endian.h.orig 2006-01-13 00:17:16.000000000 +0000
++++ include/asterisk/endian.h
+@@ -32,6 +32,11 @@
+ #ifndef __BYTE_ORDER
+ #ifdef __linux__
+ #include <endian.h>
++#elif defined(__DragonFly__)
++#include <sys/endian.h>
++#define __BYTE_ORDER BYTE_ORDER
++#define __LITTLE_ENDIAN LITTLE_ENDIAN
++#define __BIG_ENDIAN BIG_ENDIAN
+ #elif defined(__OpenBSD__) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__APPLE__)
+ #if defined(__OpenBSD__)
+ #include <machine/types.h>
diff --git a/comms/asterisk/patches/patch-aj b/comms/asterisk/patches/patch-aj
index ba3498b9087..57d6aae7ef0 100644
--- a/comms/asterisk/patches/patch-aj
+++ b/comms/asterisk/patches/patch-aj
@@ -1,13 +1,13 @@
-$NetBSD: patch-aj,v 1.1 2006/01/02 16:02:10 joerg Exp $
+$NetBSD: patch-aj,v 1.2 2006/01/13 20:32:38 riz Exp $
---- utils.c.orig 2006-01-02 15:32:32.000000000 +0000
+--- utils.c.orig 2006-01-13 00:23:00.000000000 +0000
+++ utils.c
-@@ -28,7 +28,7 @@
+@@ -58,7 +58,7 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revisi
static char base64[64];
static char b2a[256];
--#if defined(__FreeBSD__) || defined(__OpenBSD__) || defined( __NetBSD__ ) || defined(__APPLE__)
-+#if defined(__FreeBSD__) || defined(__OpenBSD__) || defined( __NetBSD__ ) || defined(__APPLE__) || defined(__DragonFly__)
+-#if defined(__FreeBSD__) || defined(__OpenBSD__) || defined( __NetBSD__ ) || defined(__APPLE__) || defined(__CYGWIN__)
++#if defined(__FreeBSD__) || defined(__OpenBSD__) || defined( __NetBSD__ ) || defined(__APPLE__) || defined(__CYGWIN__) || defined(__DragonFly__)
/* duh? ERANGE value copied from web... */
#define ERANGE 34
diff --git a/comms/asterisk/patches/patch-ak b/comms/asterisk/patches/patch-ak
index 650ca078c5e..19713edfe4e 100644
--- a/comms/asterisk/patches/patch-ak
+++ b/comms/asterisk/patches/patch-ak
@@ -1,17 +1,8 @@
-$NetBSD: patch-ak,v 1.1 2006/01/02 16:02:10 joerg Exp $
+$NetBSD: patch-ak,v 1.2 2006/01/13 20:32:38 riz Exp $
---- channels/chan_oss.c.orig 2006-01-02 15:34:15.000000000 +0000
+--- channels/chan_oss.c.orig 2006-01-13 00:31:44.000000000 +0000
+++ channels/chan_oss.c
-@@ -37,7 +37,7 @@
-
- #if defined( __OpenBSD__ )
- # include <sys/endian.h>
--#elif defined( __FreeBSD__ ) || defined( __NetBSD__ )
-+#elif defined( __FreeBSD__ ) || defined( __NetBSD__ ) || defined(__DragonFly__)
- # include <sys/endian.h>
- #elif defined( BSD ) && ( BSD >= 199103 ) || defined(__APPLE__)
- # include <machine/endian.h>
-@@ -54,7 +54,7 @@
+@@ -42,7 +42,7 @@
#ifdef __linux
#include <linux/soundcard.h>
diff --git a/comms/asterisk/patches/patch-al b/comms/asterisk/patches/patch-al
index d3d11a4d341..213efa77908 100644
--- a/comms/asterisk/patches/patch-al
+++ b/comms/asterisk/patches/patch-al
@@ -1,13 +1,22 @@
-$NetBSD: patch-al,v 1.1 2006/01/02 16:02:10 joerg Exp $
+$NetBSD: patch-al,v 1.2 2006/01/13 20:32:38 riz Exp $
---- apps/app_sms.c.orig 2006-01-02 15:36:41.000000000 +0000
-+++ apps/app_sms.c
-@@ -208,7 +208,7 @@ static void
- packdate (unsigned char *o, time_t w)
- {
- struct tm *t = localtime (&w);
--#if defined(__FreeBSD__) || defined(__OpenBSD__) || defined( __NetBSD__ ) || defined(__APPLE__)
-+#if defined(__FreeBSD__) || defined(__OpenBSD__) || defined( __NetBSD__ ) || defined(__APPLE__) || defined(__DragonFly__)
- int z = - t->tm_gmtoff / 3600 / 15;
- #else
- int z = timezone / 3600 / 15;
+--- pbx/pbx_dundi.c.orig 2006-01-13 00:45:18.000000000 +0000
++++ pbx/pbx_dundi.c
+@@ -30,7 +30,7 @@
+ #include <sys/socket.h>
+ #include <string.h>
+ #include <errno.h>
+-#if defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__) || defined(SOLARIS) || defined(__Darwin__)
++#if defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__) || defined(SOLARIS) || defined(__Darwin__) || defined(__DragonFly__)
+ #include <sys/types.h>
+ #include <netinet/in_systm.h>
+ #endif
+@@ -38,7 +38,7 @@
+ #include <sys/ioctl.h>
+ #include <netinet/in.h>
+ #include <net/if.h>
+-#if defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__) || defined(__Darwin__)
++#if defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__) || defined(__Darwin__) || defined(__DragonFly__)
+ #include <net/if_dl.h>
+ #include <ifaddrs.h>
+ #endif
diff --git a/comms/asterisk/patches/patch-am b/comms/asterisk/patches/patch-am
index e63f4a4cbb6..84ad07dab5f 100644
--- a/comms/asterisk/patches/patch-am
+++ b/comms/asterisk/patches/patch-am
@@ -1,13 +1,13 @@
-$NetBSD: patch-am,v 1.1 2006/01/02 16:02:10 joerg Exp $
+$NetBSD: patch-am,v 1.2 2006/01/13 20:32:38 riz Exp $
---- apps/app_intercom.c.orig 2006-01-02 15:39:06.000000000 +0000
-+++ apps/app_intercom.c
-@@ -29,7 +29,7 @@
-
- #if defined(__linux__)
- #include <linux/soundcard.h>
--#elif defined(__FreeBSD__)
-+#elif defined(__FreeBSD__) || defined(__DragonFly__)
- #include <sys/soundcard.h>
+--- apps/app_sms.c.orig 2006-01-13 00:50:10.000000000 +0000
++++ apps/app_sms.c
+@@ -439,7 +439,7 @@ static int packsms (unsigned char dcs, u
+ static void packdate (unsigned char *o, time_t w)
+ {
+ struct tm *t = localtime (&w);
+-#if defined(__FreeBSD__) || defined(__OpenBSD__) || defined( __NetBSD__ ) || defined(__APPLE__)
++#if defined(__FreeBSD__) || defined(__OpenBSD__) || defined( __NetBSD__ ) || defined(__APPLE__) || defined(__DragonFly__)
+ int z = -t->tm_gmtoff / 60 / 15;
#else
- #include <soundcard.h>
+ int z = timezone / 60 / 15;
diff --git a/comms/asterisk/patches/patch-an b/comms/asterisk/patches/patch-an
new file mode 100644
index 00000000000..6a566539641
--- /dev/null
+++ b/comms/asterisk/patches/patch-an
@@ -0,0 +1,13 @@
+$NetBSD: patch-an,v 1.1 2006/01/13 20:32:38 riz Exp $
+
+--- utils/streamplayer.c.orig 2006-01-13 01:14:29.000000000 +0000
++++ utils/streamplayer.c
+@@ -31,7 +31,7 @@
+ #include <unistd.h>
+ #include <sys/types.h>
+ #include <sys/socket.h>
+-#if defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__) || defined(__Darwin__) || defined(__CYGWIN__)
++#if defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__) || defined(__Darwin__) || defined(__CYGWIN__) || defined(__DragonFly__)
+ #include <netinet/in.h>
+ #endif
+ #include <sys/time.h>