summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--misc/Makefile1
-rw-r--r--misc/zaptel/Makefile49
-rw-r--r--misc/zaptel/distinfo2
-rw-r--r--misc/zaptel/files/patch-Makefile46
-rw-r--r--misc/zaptel/files/patch-test::Makefile19
-rw-r--r--misc/zaptel/files/patch-wcfxo::Makefile26
-rw-r--r--misc/zaptel/files/patch-zaptel::Makefile30
-rw-r--r--misc/zaptel/files/patch-ztcfg::Makefile38
-rw-r--r--misc/zaptel/files/patch-ztcfg::ztcfg.h13
-rw-r--r--misc/zaptel/files/zaptel.sh26
-rw-r--r--misc/zaptel/pkg-descr3
-rw-r--r--misc/zaptel/pkg-message34
-rw-r--r--misc/zaptel/pkg-plist12
-rw-r--r--net/zaptel12/Makefile49
-rw-r--r--net/zaptel12/distinfo2
-rw-r--r--net/zaptel12/files/patch-Makefile46
-rw-r--r--net/zaptel12/files/patch-test::Makefile19
-rw-r--r--net/zaptel12/files/patch-wcfxo::Makefile26
-rw-r--r--net/zaptel12/files/patch-zaptel::Makefile30
-rw-r--r--net/zaptel12/files/patch-ztcfg::Makefile38
-rw-r--r--net/zaptel12/files/patch-ztcfg::ztcfg.h13
-rw-r--r--net/zaptel12/files/zaptel.sh26
-rw-r--r--net/zaptel12/pkg-descr3
-rw-r--r--net/zaptel12/pkg-message34
-rw-r--r--net/zaptel12/pkg-plist12
25 files changed, 597 insertions, 0 deletions
diff --git a/misc/Makefile b/misc/Makefile
index 56f2799a4822..a847a6fd28c6 100644
--- a/misc/Makefile
+++ b/misc/Makefile
@@ -430,5 +430,6 @@
SUBDIR += yaucg
SUBDIR += yaunc
SUBDIR += ytree
+ SUBDIR += zaptel
.include <bsd.port.subdir.mk>
diff --git a/misc/zaptel/Makefile b/misc/zaptel/Makefile
new file mode 100644
index 000000000000..0d3f15159d0b
--- /dev/null
+++ b/misc/zaptel/Makefile
@@ -0,0 +1,49 @@
+# Ports collection makefile for: zaptel
+# Date created: 29 April 2004
+# Whom: Maxim Sobolev <sobomax@FreeBSD.org>
+#
+# $FreeBSD$
+#
+
+PORTNAME= zaptel
+PORTVERSION= 0.1
+CATEGORIES= misc
+MASTER_SITES= http://www.portaone.com/~sobomax/
+DISTNAME= ${PORTNAME}-freebsd-${PORTVERSION}
+
+MAINTAINER= sobomax@FreeBSD.org
+COMMENT= A FreeBSD Driver for Digium X100P Telephony Cards
+
+NO_PACKAGE= Should be in sync with the kernel to work correctly
+
+ONLY_FOR_ARCHS= i386
+
+PKGMESSAGE= ${WRKSRC}/.MESSAGE
+MAKE_ENV= KMODDIR=${PREFIX}/lib/zaptel
+
+.include <bsd.port.pre.mk>
+
+.if ${OSVERSION} < 500000
+IGNORE= "requires FreeBSD 5.x to build."
+.endif
+
+pre-everything::
+ @if [ ! -f /usr/src/sys/Makefile ]; then \
+ ${ECHO_MSG} ">> The zaptel port needs FreeBSD kernel source code to compile."; \
+ ${ECHO_MSG} ">> Please install FreeBSD kernel source code in /usr/src/sys."; \
+ ${FALSE}; \
+ fi
+
+pre-install:
+ @${SED} 's|%%PREFIX%%|${PREFIX}|g' ${PKGDIR}/pkg-message > \
+ ${PKGMESSAGE}
+ @${SED} 's|%%PREFIX%%|${PREFIX}|g' ${FILESDIR}/zaptel.sh > \
+ ${WRKDIR}/zaptel.sh.sample
+ @${MKDIR} ${PREFIX}/lib/zaptel
+
+post-install:
+ @${TOUCH} ${PREFIX}/lib/zaptel/linker.hints
+ @${INSTALL_SCRIPT} ${WRKDIR}/zaptel.sh.sample ${PREFIX}/etc/rc.d
+ @${CAT} ${PKGMESSAGE}
+
+.include <bsd.port.post.mk>
diff --git a/misc/zaptel/distinfo b/misc/zaptel/distinfo
new file mode 100644
index 000000000000..b5f17ef8fb8d
--- /dev/null
+++ b/misc/zaptel/distinfo
@@ -0,0 +1,2 @@
+MD5 (zaptel-freebsd-0.1.tar.gz) = 6081a3a637684500c2077adb70c8406b
+SIZE (zaptel-freebsd-0.1.tar.gz) = 105683
diff --git a/misc/zaptel/files/patch-Makefile b/misc/zaptel/files/patch-Makefile
new file mode 100644
index 000000000000..459d72a1fbfe
--- /dev/null
+++ b/misc/zaptel/files/patch-Makefile
@@ -0,0 +1,46 @@
+
+$FreeBSD$
+
+--- Makefile.orig Wed Apr 28 04:27:35 2004
++++ Makefile Thu Apr 29 18:00:11 2004
+@@ -1,29 +1,26 @@
+ # $Id: Makefile,v 1.1 2004/04/28 11:27:35 gonzo Exp $
+
+ all:
+- cd zaptel && make
+- cd wcfxo && make
+- cd ztcfg && make
++ cd zaptel && ${MAKE}
++ cd wcfxo && ${MAKE}
++ cd ztcfg && ${MAKE}
+
+ load:
+- cd zaptel && kldload ./zaptel/zaptel.ko
+- cd wcfxo && kldload ./wcfxo/wcfxo.ko
++ cd zaptel && kldload ${.CURDIR}/zaptel/zaptel.ko
++ cd wcfxo && kldload ${.CURDIR}/wcfxo/wcfxo.ko
+
+ unload:
+ cd wcfxo && kldunload wcfxo
+ cd zaptel && kldunload zaptel
+
+ clean:
+- cd zaptel && make clean
+- cd wcfxo && make clean
+- cd ztcfg && make clean
++ cd zaptel && ${MAKE} clean
++ cd wcfxo && ${MAKE} clean
++ cd ztcfg && ${MAKE} clean
+
+ install:
+- cd zaptel && make install
+- cd wcfxo && make install
+- cd ztcfg && make install
+-
+-
+-
++ cd zaptel && ${MAKE} install
++ cd wcfxo && ${MAKE} install
++ cd ztcfg && ${MAKE} install
+
+ reload: unload load
diff --git a/misc/zaptel/files/patch-test::Makefile b/misc/zaptel/files/patch-test::Makefile
new file mode 100644
index 000000000000..348b1ffce31b
--- /dev/null
+++ b/misc/zaptel/files/patch-test::Makefile
@@ -0,0 +1,19 @@
+
+$FreeBSD$
+
+--- test/Makefile.orig Wed Apr 28 04:27:36 2004
++++ test/Makefile Thu Apr 29 18:00:11 2004
+@@ -1,10 +1,10 @@
+ # $Id: Makefile,v 1.1 2004/04/28 11:27:36 gonzo Exp $
+-CFLAGS += -I/usr/local/include -I../zaptel -I../ztcfg
++CFLAGS+= -I${.CURDIR}/../zaptel -I${.CURDIR}/../ztcfg -I${LOCALBASE}/include
+
+ all: zttool fxo_test
+
+ fxo_test: fxo_test.o
+- gcc -o fxo_test fxo_test.o -ltonezone -L../ztcfg
++ ${CC} -o fxo_test fxo_test.o -L${.CURDIR}/../ztcfg -ltonezone
+
+ zttool: zttool.o
+- gcc -o zttool zttool.o -ltonezone -L/usr/local/lib -lnewt -L../ztcfg
++ ${CC} -o zttool zttool.o -L${.CURDIR}/../ztcfg -ltonezone -L${LOCALBASE}/lib -lnewt
diff --git a/misc/zaptel/files/patch-wcfxo::Makefile b/misc/zaptel/files/patch-wcfxo::Makefile
new file mode 100644
index 000000000000..04623b45aab7
--- /dev/null
+++ b/misc/zaptel/files/patch-wcfxo::Makefile
@@ -0,0 +1,26 @@
+
+$FreeBSD$
+
+--- wcfxo/Makefile.orig Wed Apr 28 04:27:36 2004
++++ wcfxo/Makefile Thu Apr 29 18:00:11 2004
+@@ -1,13 +1,14 @@
+ # $Id: Makefile,v 1.1 2004/04/28 11:27:36 gonzo Exp $
+ .PATH: /sys/dev/pci
+-SRCS=wcfxo.c wcfxovar.h
+-KMOD=wcfxo
+-CFLAGS+= -I../zaptel/ -g
+-SRCS += device_if.h bus_if.h isa_if.h pci_if.h
+-SRCS += wcfxovar.h
++
++KMOD= wcfxo
++SRCS= wcfxo.c wcfxovar.h
++SRCS+= device_if.h bus_if.h isa_if.h pci_if.h
++SRCS+= wcfxovar.h
++CFLAGS+= -I${.CURDIR}/../zaptel/ -g
+
+ load: wcfxo.ko
+- kldload ./wcfxo.ko
++ kldload ${.CURDIR}/wcfxo.ko
+
+ unload:
+ kldunload wcfxo
diff --git a/misc/zaptel/files/patch-zaptel::Makefile b/misc/zaptel/files/patch-zaptel::Makefile
new file mode 100644
index 000000000000..d08ffb911940
--- /dev/null
+++ b/misc/zaptel/files/patch-zaptel::Makefile
@@ -0,0 +1,30 @@
+
+$FreeBSD$
+
+--- zaptel/Makefile.orig Wed Apr 28 04:27:36 2004
++++ zaptel/Makefile Thu Apr 29 18:00:11 2004
+@@ -1,16 +1,17 @@
+ .PATH: /sys/dev/pci
+-SRCS=zaptel.c arith.h tones.h zaptel.h
+-KMOD=zaptel
+-CFLAGS += -g
+
+-SRCS+= device_if.h bus_if.h
++SRCS= zaptel.c arith.h tones.h zaptel.h
++KMOD= zaptel
++CFLAGS+= -g
++
++SRCS+= device_if.h bus_if.h
+
+ tones.h: gendigits.c
+- gcc -o gendigits gendigits.c -lm
+- ./gendigits
++ ${CC} ${CFLAGS} -o gendigits gendigits.c -lm
++ ${.CURDIR}/gendigits
+
+ load: zaptel.ko
+- kldload ./zaptel.ko
++ kldload ${.CURDIR}/zaptel.ko
+
+ unload:
+ kldunload zaptel
diff --git a/misc/zaptel/files/patch-ztcfg::Makefile b/misc/zaptel/files/patch-ztcfg::Makefile
new file mode 100644
index 000000000000..718343538a15
--- /dev/null
+++ b/misc/zaptel/files/patch-ztcfg::Makefile
@@ -0,0 +1,38 @@
+
+$FreeBSD$
+
+--- ztcfg/Makefile.orig Wed Apr 28 04:27:36 2004
++++ ztcfg/Makefile Thu Apr 29 18:04:14 2004
+@@ -1,10 +1,10 @@
+-CFLAGS+= -I/usr/local/include -I. -I../zaptel -DUSE_LOCAL_INCLUDE=1
+-INSTALL=/usr/bin/install
++CFLAGS+= -I${.CURDIR} -I${.CURDIR}/../zaptel -I${PREFIX}/include -DUSE_LOCAL_INCLUDE=1 \
++ -DPREFIX=\"${PREFIX}\"
+
+ all: ztcfg libtonezone.a
+
+ ztcfg: ztcfg.o tonezone.o zonedata.o
+- $(CC) -o ztcfg ztcfg.o tonezone.o zonedata.o -lm -L.
++ $(CC) -o ztcfg ztcfg.o tonezone.o zonedata.o -lm -L${.CURDIR}
+
+ ztcfg.c: ztcfg.h
+
+@@ -12,10 +12,14 @@
+ ar r libtonezone.a tonezone.o zonedata.o
+
+ install:
+- $(INSTALL) -o root -g wheel -m 644 libtonezone.a /usr/local/lib/
+- $(INSTALL) -o root -g wheel -m 644 tonezone.h /usr/local/include/
+- $(INSTALL) -o root -g wheel -m 644 ../zaptel/zaptel.h /usr/include/
++ ${BSD_INSTALL_PROGRAM} ztcfg ${PREFIX}/bin
++ ${BSD_INSTALL_DATA} libtonezone.a ${PREFIX}/lib
++ ${BSD_INSTALL_DATA} tonezone.h ${PREFIX}/include
++ ${BSD_INSTALL_DATA} ${.CURDIR}/../zaptel/zaptel.h ${PREFIX}/include
++ ${BSD_INSTALL_DATA} zaptel.conf.sample ${PREFIX}/etc
++ if [ ! -f %B/zaptel.conf ]; then \
++ ${BSD_INSTALL_DATA} zaptel.conf.sample ${PREFIX}/etc/zaptel.conf; \
++ fi
+
+ clean:
+ rm -f *.o ztcfg *.a
+-
diff --git a/misc/zaptel/files/patch-ztcfg::ztcfg.h b/misc/zaptel/files/patch-ztcfg::ztcfg.h
new file mode 100644
index 000000000000..1a83c9154aa7
--- /dev/null
+++ b/misc/zaptel/files/patch-ztcfg::ztcfg.h
@@ -0,0 +1,13 @@
+
+$FreeBSD$
+
+--- ztcfg/ztcfg.h 2004/04/30 01:01:39 1.1
++++ ztcfg/ztcfg.h 2004/04/30 01:01:48
+@@ -23,6 +23,6 @@
+ #ifndef _ZTCFG_H
+ #define _ZTCFG_H
+
+-#define CONFIG_FILENAME "/etc/zaptel.conf"
++#define CONFIG_FILENAME PREFIX "/etc/zaptel.conf"
+ #define MASTER_DEVICE "/dev/zap/ctl"
+ #endif
diff --git a/misc/zaptel/files/zaptel.sh b/misc/zaptel/files/zaptel.sh
new file mode 100644
index 000000000000..ff2753b788ae
--- /dev/null
+++ b/misc/zaptel/files/zaptel.sh
@@ -0,0 +1,26 @@
+#!/bin/sh
+
+PREFIX=%%PREFIX%%
+LIBDIR=${PREFIX}/lib/zaptel
+
+case "$1" in
+ start)
+ /sbin/kldload ${LIBDIR}/zaptel.ko || exit 1
+ /sbin/kldload ${LIBDIR}/wcfxo.ko || exit 1
+ /usr/sbin/devinfo | /usr/bin/grep -q wcfxo && ${PREFIX}/bin/ztcfg 2> /dev/null
+ echo -n " zaptel"
+ ;;
+
+ stop)
+ /sbin/kldunload wcfxo.ko || exit 1
+ /sbin/kldunload zaptel.ko || exit 1
+ echo -n " zaptel"
+ ;;
+
+ *)
+ echo ""
+ echo "Usage: `basename $0` { start | stop }"
+ echo ""
+ exit 64
+ ;;
+esac
diff --git a/misc/zaptel/pkg-descr b/misc/zaptel/pkg-descr
new file mode 100644
index 000000000000..f94c51092e76
--- /dev/null
+++ b/misc/zaptel/pkg-descr
@@ -0,0 +1,3 @@
+A FreeBSD Driver for Digium X100P Telephony Cards.
+
+WWW: http://www.digium.com/index.php?menu=wildcard_x100p
diff --git a/misc/zaptel/pkg-message b/misc/zaptel/pkg-message
new file mode 100644
index 000000000000..239e4c30b5c0
--- /dev/null
+++ b/misc/zaptel/pkg-message
@@ -0,0 +1,34 @@
+-------------------------------------------------------------------------------
+IMPORTANT! MAKE SURE TO READ THE FOLLOWING!
+
+To use the driver, make a copy of %%PREFIX%%/etc/rc.d/zaptel.sh.sample
+under %%PREFIX%%/etc/rc.d/zaptel.sh.
+
+To load the driver run (as root):
+
+# %%PREFIX%%/etc/rc.d/zaptel.sh start
+
+To unload it:
+
+# %%PREFIX%%/etc/rc.d/zaptel.sh stop
+
+It'll also load the driver automatically when the system is started.
+
+Report problems to Alexander Timoshenko <gonzo@portaone.com>. Please note that
+it is still "work in progress" so that your bug reports are welcome and will
+help to improve quality of the drivers.
+
+Great thanks to all companies and individuals who made this driver happen,
+including but not limited to, John Todd, Chris Coleman, Alexander Timoshenko,
+Porta Software Ltd and others contributors of the bounty project.
+
+Also, we would be grateful if anyone who uses this driver can send a short
+note to DigiumBSD@portaone.com, with brief description of what X100P is used
+for as well as with extimated number of cards deployed under FreeBSD. We will
+use this information to persuage Digium that in the order to sell more
+hardware they have to support FreeBSD drivers along with Linux ones.
+
+Thanks and enjoy!
+
+-Maxim
+-------------------------------------------------------------------------------
diff --git a/misc/zaptel/pkg-plist b/misc/zaptel/pkg-plist
new file mode 100644
index 000000000000..67e259b05965
--- /dev/null
+++ b/misc/zaptel/pkg-plist
@@ -0,0 +1,12 @@
+bin/ztcfg
+etc/rc.d/zaptel.sh.sample
+@unexec if cmp -s %D/etc/zaptel.conf %D/etc/zaptel.conf.sample; then rm -f %D/etc/zaptel.conf; fi
+etc/zaptel.conf.sample
+@exec [ -f %B/zaptel.conf ] || cp %B/%f %B/zaptel.conf
+include/tonezone.h
+include/zaptel.h
+lib/libtonezone.a
+lib/zaptel/linker.hints
+lib/zaptel/wcfxo.ko
+lib/zaptel/zaptel.ko
+@dirrm lib/zaptel
diff --git a/net/zaptel12/Makefile b/net/zaptel12/Makefile
new file mode 100644
index 000000000000..0d3f15159d0b
--- /dev/null
+++ b/net/zaptel12/Makefile
@@ -0,0 +1,49 @@
+# Ports collection makefile for: zaptel
+# Date created: 29 April 2004
+# Whom: Maxim Sobolev <sobomax@FreeBSD.org>
+#
+# $FreeBSD$
+#
+
+PORTNAME= zaptel
+PORTVERSION= 0.1
+CATEGORIES= misc
+MASTER_SITES= http://www.portaone.com/~sobomax/
+DISTNAME= ${PORTNAME}-freebsd-${PORTVERSION}
+
+MAINTAINER= sobomax@FreeBSD.org
+COMMENT= A FreeBSD Driver for Digium X100P Telephony Cards
+
+NO_PACKAGE= Should be in sync with the kernel to work correctly
+
+ONLY_FOR_ARCHS= i386
+
+PKGMESSAGE= ${WRKSRC}/.MESSAGE
+MAKE_ENV= KMODDIR=${PREFIX}/lib/zaptel
+
+.include <bsd.port.pre.mk>
+
+.if ${OSVERSION} < 500000
+IGNORE= "requires FreeBSD 5.x to build."
+.endif
+
+pre-everything::
+ @if [ ! -f /usr/src/sys/Makefile ]; then \
+ ${ECHO_MSG} ">> The zaptel port needs FreeBSD kernel source code to compile."; \
+ ${ECHO_MSG} ">> Please install FreeBSD kernel source code in /usr/src/sys."; \
+ ${FALSE}; \
+ fi
+
+pre-install:
+ @${SED} 's|%%PREFIX%%|${PREFIX}|g' ${PKGDIR}/pkg-message > \
+ ${PKGMESSAGE}
+ @${SED} 's|%%PREFIX%%|${PREFIX}|g' ${FILESDIR}/zaptel.sh > \
+ ${WRKDIR}/zaptel.sh.sample
+ @${MKDIR} ${PREFIX}/lib/zaptel
+
+post-install:
+ @${TOUCH} ${PREFIX}/lib/zaptel/linker.hints
+ @${INSTALL_SCRIPT} ${WRKDIR}/zaptel.sh.sample ${PREFIX}/etc/rc.d
+ @${CAT} ${PKGMESSAGE}
+
+.include <bsd.port.post.mk>
diff --git a/net/zaptel12/distinfo b/net/zaptel12/distinfo
new file mode 100644
index 000000000000..b5f17ef8fb8d
--- /dev/null
+++ b/net/zaptel12/distinfo
@@ -0,0 +1,2 @@
+MD5 (zaptel-freebsd-0.1.tar.gz) = 6081a3a637684500c2077adb70c8406b
+SIZE (zaptel-freebsd-0.1.tar.gz) = 105683
diff --git a/net/zaptel12/files/patch-Makefile b/net/zaptel12/files/patch-Makefile
new file mode 100644
index 000000000000..459d72a1fbfe
--- /dev/null
+++ b/net/zaptel12/files/patch-Makefile
@@ -0,0 +1,46 @@
+
+$FreeBSD$
+
+--- Makefile.orig Wed Apr 28 04:27:35 2004
++++ Makefile Thu Apr 29 18:00:11 2004
+@@ -1,29 +1,26 @@
+ # $Id: Makefile,v 1.1 2004/04/28 11:27:35 gonzo Exp $
+
+ all:
+- cd zaptel && make
+- cd wcfxo && make
+- cd ztcfg && make
++ cd zaptel && ${MAKE}
++ cd wcfxo && ${MAKE}
++ cd ztcfg && ${MAKE}
+
+ load:
+- cd zaptel && kldload ./zaptel/zaptel.ko
+- cd wcfxo && kldload ./wcfxo/wcfxo.ko
++ cd zaptel && kldload ${.CURDIR}/zaptel/zaptel.ko
++ cd wcfxo && kldload ${.CURDIR}/wcfxo/wcfxo.ko
+
+ unload:
+ cd wcfxo && kldunload wcfxo
+ cd zaptel && kldunload zaptel
+
+ clean:
+- cd zaptel && make clean
+- cd wcfxo && make clean
+- cd ztcfg && make clean
++ cd zaptel && ${MAKE} clean
++ cd wcfxo && ${MAKE} clean
++ cd ztcfg && ${MAKE} clean
+
+ install:
+- cd zaptel && make install
+- cd wcfxo && make install
+- cd ztcfg && make install
+-
+-
+-
++ cd zaptel && ${MAKE} install
++ cd wcfxo && ${MAKE} install
++ cd ztcfg && ${MAKE} install
+
+ reload: unload load
diff --git a/net/zaptel12/files/patch-test::Makefile b/net/zaptel12/files/patch-test::Makefile
new file mode 100644
index 000000000000..348b1ffce31b
--- /dev/null
+++ b/net/zaptel12/files/patch-test::Makefile
@@ -0,0 +1,19 @@
+
+$FreeBSD$
+
+--- test/Makefile.orig Wed Apr 28 04:27:36 2004
++++ test/Makefile Thu Apr 29 18:00:11 2004
+@@ -1,10 +1,10 @@
+ # $Id: Makefile,v 1.1 2004/04/28 11:27:36 gonzo Exp $
+-CFLAGS += -I/usr/local/include -I../zaptel -I../ztcfg
++CFLAGS+= -I${.CURDIR}/../zaptel -I${.CURDIR}/../ztcfg -I${LOCALBASE}/include
+
+ all: zttool fxo_test
+
+ fxo_test: fxo_test.o
+- gcc -o fxo_test fxo_test.o -ltonezone -L../ztcfg
++ ${CC} -o fxo_test fxo_test.o -L${.CURDIR}/../ztcfg -ltonezone
+
+ zttool: zttool.o
+- gcc -o zttool zttool.o -ltonezone -L/usr/local/lib -lnewt -L../ztcfg
++ ${CC} -o zttool zttool.o -L${.CURDIR}/../ztcfg -ltonezone -L${LOCALBASE}/lib -lnewt
diff --git a/net/zaptel12/files/patch-wcfxo::Makefile b/net/zaptel12/files/patch-wcfxo::Makefile
new file mode 100644
index 000000000000..04623b45aab7
--- /dev/null
+++ b/net/zaptel12/files/patch-wcfxo::Makefile
@@ -0,0 +1,26 @@
+
+$FreeBSD$
+
+--- wcfxo/Makefile.orig Wed Apr 28 04:27:36 2004
++++ wcfxo/Makefile Thu Apr 29 18:00:11 2004
+@@ -1,13 +1,14 @@
+ # $Id: Makefile,v 1.1 2004/04/28 11:27:36 gonzo Exp $
+ .PATH: /sys/dev/pci
+-SRCS=wcfxo.c wcfxovar.h
+-KMOD=wcfxo
+-CFLAGS+= -I../zaptel/ -g
+-SRCS += device_if.h bus_if.h isa_if.h pci_if.h
+-SRCS += wcfxovar.h
++
++KMOD= wcfxo
++SRCS= wcfxo.c wcfxovar.h
++SRCS+= device_if.h bus_if.h isa_if.h pci_if.h
++SRCS+= wcfxovar.h
++CFLAGS+= -I${.CURDIR}/../zaptel/ -g
+
+ load: wcfxo.ko
+- kldload ./wcfxo.ko
++ kldload ${.CURDIR}/wcfxo.ko
+
+ unload:
+ kldunload wcfxo
diff --git a/net/zaptel12/files/patch-zaptel::Makefile b/net/zaptel12/files/patch-zaptel::Makefile
new file mode 100644
index 000000000000..d08ffb911940
--- /dev/null
+++ b/net/zaptel12/files/patch-zaptel::Makefile
@@ -0,0 +1,30 @@
+
+$FreeBSD$
+
+--- zaptel/Makefile.orig Wed Apr 28 04:27:36 2004
++++ zaptel/Makefile Thu Apr 29 18:00:11 2004
+@@ -1,16 +1,17 @@
+ .PATH: /sys/dev/pci
+-SRCS=zaptel.c arith.h tones.h zaptel.h
+-KMOD=zaptel
+-CFLAGS += -g
+
+-SRCS+= device_if.h bus_if.h
++SRCS= zaptel.c arith.h tones.h zaptel.h
++KMOD= zaptel
++CFLAGS+= -g
++
++SRCS+= device_if.h bus_if.h
+
+ tones.h: gendigits.c
+- gcc -o gendigits gendigits.c -lm
+- ./gendigits
++ ${CC} ${CFLAGS} -o gendigits gendigits.c -lm
++ ${.CURDIR}/gendigits
+
+ load: zaptel.ko
+- kldload ./zaptel.ko
++ kldload ${.CURDIR}/zaptel.ko
+
+ unload:
+ kldunload zaptel
diff --git a/net/zaptel12/files/patch-ztcfg::Makefile b/net/zaptel12/files/patch-ztcfg::Makefile
new file mode 100644
index 000000000000..718343538a15
--- /dev/null
+++ b/net/zaptel12/files/patch-ztcfg::Makefile
@@ -0,0 +1,38 @@
+
+$FreeBSD$
+
+--- ztcfg/Makefile.orig Wed Apr 28 04:27:36 2004
++++ ztcfg/Makefile Thu Apr 29 18:04:14 2004
+@@ -1,10 +1,10 @@
+-CFLAGS+= -I/usr/local/include -I. -I../zaptel -DUSE_LOCAL_INCLUDE=1
+-INSTALL=/usr/bin/install
++CFLAGS+= -I${.CURDIR} -I${.CURDIR}/../zaptel -I${PREFIX}/include -DUSE_LOCAL_INCLUDE=1 \
++ -DPREFIX=\"${PREFIX}\"
+
+ all: ztcfg libtonezone.a
+
+ ztcfg: ztcfg.o tonezone.o zonedata.o
+- $(CC) -o ztcfg ztcfg.o tonezone.o zonedata.o -lm -L.
++ $(CC) -o ztcfg ztcfg.o tonezone.o zonedata.o -lm -L${.CURDIR}
+
+ ztcfg.c: ztcfg.h
+
+@@ -12,10 +12,14 @@
+ ar r libtonezone.a tonezone.o zonedata.o
+
+ install:
+- $(INSTALL) -o root -g wheel -m 644 libtonezone.a /usr/local/lib/
+- $(INSTALL) -o root -g wheel -m 644 tonezone.h /usr/local/include/
+- $(INSTALL) -o root -g wheel -m 644 ../zaptel/zaptel.h /usr/include/
++ ${BSD_INSTALL_PROGRAM} ztcfg ${PREFIX}/bin
++ ${BSD_INSTALL_DATA} libtonezone.a ${PREFIX}/lib
++ ${BSD_INSTALL_DATA} tonezone.h ${PREFIX}/include
++ ${BSD_INSTALL_DATA} ${.CURDIR}/../zaptel/zaptel.h ${PREFIX}/include
++ ${BSD_INSTALL_DATA} zaptel.conf.sample ${PREFIX}/etc
++ if [ ! -f %B/zaptel.conf ]; then \
++ ${BSD_INSTALL_DATA} zaptel.conf.sample ${PREFIX}/etc/zaptel.conf; \
++ fi
+
+ clean:
+ rm -f *.o ztcfg *.a
+-
diff --git a/net/zaptel12/files/patch-ztcfg::ztcfg.h b/net/zaptel12/files/patch-ztcfg::ztcfg.h
new file mode 100644
index 000000000000..1a83c9154aa7
--- /dev/null
+++ b/net/zaptel12/files/patch-ztcfg::ztcfg.h
@@ -0,0 +1,13 @@
+
+$FreeBSD$
+
+--- ztcfg/ztcfg.h 2004/04/30 01:01:39 1.1
++++ ztcfg/ztcfg.h 2004/04/30 01:01:48
+@@ -23,6 +23,6 @@
+ #ifndef _ZTCFG_H
+ #define _ZTCFG_H
+
+-#define CONFIG_FILENAME "/etc/zaptel.conf"
++#define CONFIG_FILENAME PREFIX "/etc/zaptel.conf"
+ #define MASTER_DEVICE "/dev/zap/ctl"
+ #endif
diff --git a/net/zaptel12/files/zaptel.sh b/net/zaptel12/files/zaptel.sh
new file mode 100644
index 000000000000..ff2753b788ae
--- /dev/null
+++ b/net/zaptel12/files/zaptel.sh
@@ -0,0 +1,26 @@
+#!/bin/sh
+
+PREFIX=%%PREFIX%%
+LIBDIR=${PREFIX}/lib/zaptel
+
+case "$1" in
+ start)
+ /sbin/kldload ${LIBDIR}/zaptel.ko || exit 1
+ /sbin/kldload ${LIBDIR}/wcfxo.ko || exit 1
+ /usr/sbin/devinfo | /usr/bin/grep -q wcfxo && ${PREFIX}/bin/ztcfg 2> /dev/null
+ echo -n " zaptel"
+ ;;
+
+ stop)
+ /sbin/kldunload wcfxo.ko || exit 1
+ /sbin/kldunload zaptel.ko || exit 1
+ echo -n " zaptel"
+ ;;
+
+ *)
+ echo ""
+ echo "Usage: `basename $0` { start | stop }"
+ echo ""
+ exit 64
+ ;;
+esac
diff --git a/net/zaptel12/pkg-descr b/net/zaptel12/pkg-descr
new file mode 100644
index 000000000000..f94c51092e76
--- /dev/null
+++ b/net/zaptel12/pkg-descr
@@ -0,0 +1,3 @@
+A FreeBSD Driver for Digium X100P Telephony Cards.
+
+WWW: http://www.digium.com/index.php?menu=wildcard_x100p
diff --git a/net/zaptel12/pkg-message b/net/zaptel12/pkg-message
new file mode 100644
index 000000000000..239e4c30b5c0
--- /dev/null
+++ b/net/zaptel12/pkg-message
@@ -0,0 +1,34 @@
+-------------------------------------------------------------------------------
+IMPORTANT! MAKE SURE TO READ THE FOLLOWING!
+
+To use the driver, make a copy of %%PREFIX%%/etc/rc.d/zaptel.sh.sample
+under %%PREFIX%%/etc/rc.d/zaptel.sh.
+
+To load the driver run (as root):
+
+# %%PREFIX%%/etc/rc.d/zaptel.sh start
+
+To unload it:
+
+# %%PREFIX%%/etc/rc.d/zaptel.sh stop
+
+It'll also load the driver automatically when the system is started.
+
+Report problems to Alexander Timoshenko <gonzo@portaone.com>. Please note that
+it is still "work in progress" so that your bug reports are welcome and will
+help to improve quality of the drivers.
+
+Great thanks to all companies and individuals who made this driver happen,
+including but not limited to, John Todd, Chris Coleman, Alexander Timoshenko,
+Porta Software Ltd and others contributors of the bounty project.
+
+Also, we would be grateful if anyone who uses this driver can send a short
+note to DigiumBSD@portaone.com, with brief description of what X100P is used
+for as well as with extimated number of cards deployed under FreeBSD. We will
+use this information to persuage Digium that in the order to sell more
+hardware they have to support FreeBSD drivers along with Linux ones.
+
+Thanks and enjoy!
+
+-Maxim
+-------------------------------------------------------------------------------
diff --git a/net/zaptel12/pkg-plist b/net/zaptel12/pkg-plist
new file mode 100644
index 000000000000..67e259b05965
--- /dev/null
+++ b/net/zaptel12/pkg-plist
@@ -0,0 +1,12 @@
+bin/ztcfg
+etc/rc.d/zaptel.sh.sample
+@unexec if cmp -s %D/etc/zaptel.conf %D/etc/zaptel.conf.sample; then rm -f %D/etc/zaptel.conf; fi
+etc/zaptel.conf.sample
+@exec [ -f %B/zaptel.conf ] || cp %B/%f %B/zaptel.conf
+include/tonezone.h
+include/zaptel.h
+lib/libtonezone.a
+lib/zaptel/linker.hints
+lib/zaptel/wcfxo.ko
+lib/zaptel/zaptel.ko
+@dirrm lib/zaptel