From 823e5a637bbfb2f04ee76b1cc2ab737a6b7c8258 Mon Sep 17 00:00:00 2001 From: Andy Boyett Date: Mon, 29 Sep 2008 03:37:17 +0000 Subject: [PATCH] This was originally submitted by somebody else - and has been tidied up a bit -the original doesn't seem to have been aplied yet. Required for meetme support in asterisk. Signed-off-by: Michael Geddes SVN-Revision: 12793 --- libs/zaptel-1.4.x/Makefile | 116 ++++++++++++++++++ .../patches/200-Makefile-pwd.patch | 10 ++ .../patches/300-zaptel-base.patch | 23 ++++ 3 files changed, 149 insertions(+) create mode 100644 libs/zaptel-1.4.x/Makefile create mode 100644 libs/zaptel-1.4.x/patches/200-Makefile-pwd.patch create mode 100644 libs/zaptel-1.4.x/patches/300-zaptel-base.patch diff --git a/libs/zaptel-1.4.x/Makefile b/libs/zaptel-1.4.x/Makefile new file mode 100644 index 000000000..9688d59d9 --- /dev/null +++ b/libs/zaptel-1.4.x/Makefile @@ -0,0 +1,116 @@ +# +# Copyright (C) 2006 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# +# $Id: Makefile 5624 2006-11-23 00:29:07Z nbd $ + +include $(TOPDIR)/rules.mk +include $(INCLUDE_DIR)/kernel.mk + +PKG_NAME:=zaptel +PKG_VERSION:=1.4.9.2 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://ftp.digium.com/pub/zaptel/releases/ +PKG_MD5SUM:=f6af404cc0244b93a2fc88b237f374bd + +include $(INCLUDE_DIR)/package.mk + +define Package/zaptel14/Default + TITLE:=Zaptel + URL:=http://ftp.digium.com/pub/zaptel/releases +endef + +define KernelPackage/zaptel14 + SUBMENU:=Other modules + $(call Package/zaptel14/Default) + TITLE+= (kernel module) + VERSION:=$(LINUX_VERSION)-$(PKG_VERSION)-$(BOARD)-$(PKG_RELEASE) + FILES:=$(PKG_BUILD_DIR)/kernel/zaptel.$(LINUX_KMOD_SUFFIX) \ + $(PKG_BUILD_DIR)/kernel/ztdummy.$(LINUX_KMOD_SUFFIX) + AUTOLOAD:=$(call AutoLoad,70,zaptel ztdummy) +endef + +define KernelPackage/zaptel14/description + This package contains the Zaptel core module and ztdummy driver. +endef + +define Package/zaptel14-util + $(call Package/zaptel14/Default) + SECTION:=utils + CATEGORY:=Utilities + TITLE+= utils + DEPENDS := +kmod-zaptel14 +endef + +define Package/zaptel14-util/description + This package contains the zttest program +endef + +define Package/zaptel14-libtonezone + $(call Package/zaptel14/Default) + SECTION:=libs + CATEGORY:=Libraries + TITLE+= libtonezone (library) + DEPENDS := +kmod-zaptel14 +endef + +define Package/zaptel14-libtonezone/description + This package contains the libraries for accessing zaptel/dummy drivers. +endef + +define Build/Compile/zaptel14 + $(MAKE) -C $(PKG_BUILD_DIR) \ + DESTDIR="$(PKG_INSTALL_DIR)" \ + ARCH="$(LINUX_KARCH)" \ + CC=$(KERNEL_CC) \ + LD=$(TARGET_CROSS)ld \ + HOSTCC=$(HOSTCC) \ + KVERS=$(LINUX_VERSION) \ + KSRC=$(LINUX_DIR) \ + KFLAGS_PPC="-G 0 -mno-abicalls -fno-pic -pipe -finline-limit=100000 -mabi=32 $(TARGET_CFLAGS) -mlong-calls -fno-common -nostdinc -iwithprefix include" \ + TOPDIR_MODULES="zaptel ztdummy" \ + SUBDIR_MODULES="" \ + modules zttest +endef + +define Build/Compile/zaptel14-libtonezone + $(MAKE) -C $(PKG_BUILD_DIR) \ + DESTDIR="$(PKG_INSTALL_DIR)" \ + CC=$(TARGET_CC) \ + LD=$(TARGET_CROSS)ld \ + AR=$(TARGET_CROSS)ar \ + KSRC=$(LINUX_DIR) \ + HOSTCC=$(HOSTCC) \ + install-libs install-include +endef + +define Build/Compile + $(call Build/Compile/zaptel14) + $(call Build/Compile/zaptel14-libtonezone) +endef + +define Build/InstallDev + $(INSTALL_DIR) $(STAGING_DIR)/usr/include/zaptel/ + $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/include/zaptel/zaptel.h $(STAGING_DIR)/usr/include/zaptel/ + $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/include/zaptel/tonezone.h $(STAGING_DIR)/usr/include/zaptel/ + $(INSTALL_DIR) $(STAGING_DIR)/usr/lib/ + $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/libtonezone* $(STAGING_DIR)/usr/lib/ +endef + +define Package/zaptel14-util/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/zttest $(1)/usr/bin/ +endef + +define Package/zaptel14-libtonezone/install + $(INSTALL_DIR) $(1)/usr/lib + $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/libtonezone.so.* $(1)/usr/lib/ +endef + +$(eval $(call KernelPackage,zaptel14)) +$(eval $(call BuildPackage,zaptel14-util)) +$(eval $(call BuildPackage,zaptel14-libtonezone)) diff --git a/libs/zaptel-1.4.x/patches/200-Makefile-pwd.patch b/libs/zaptel-1.4.x/patches/200-Makefile-pwd.patch new file mode 100644 index 000000000..1193309bc --- /dev/null +++ b/libs/zaptel-1.4.x/patches/200-Makefile-pwd.patch @@ -0,0 +1,10 @@ +--- zaptel-1.4.6.org/Makefile 2007-09-20 20:42:35.000000000 +0200 ++++ zaptel-1.4.6/Makefile 2007-11-10 18:07:07.000000000 +0100 +@@ -10,6 +10,7 @@ + ifeq ($(MAKELEVEL),0) + PWD:=$(shell pwd) + endif ++PWD:=`pwd` + + ARCH:=$(shell uname -m | sed -e s/i.86/i386/) + diff --git a/libs/zaptel-1.4.x/patches/300-zaptel-base.patch b/libs/zaptel-1.4.x/patches/300-zaptel-base.patch new file mode 100644 index 000000000..1575d9a74 --- /dev/null +++ b/libs/zaptel-1.4.x/patches/300-zaptel-base.patch @@ -0,0 +1,23 @@ +diff -Nru zaptel-1.4.9.2.org/kernel/zaptel-base.c zaptel-1.4.9.2/kernel/zaptel-base.c +--- zaptel-1.4.9.2.org/kernel/zaptel-base.c 2008-02-28 20:00:47.000000000 +0100 ++++ zaptel-1.4.9.2/kernel/zaptel-base.c 2008-03-06 10:02:20.000000000 +0100 +@@ -7346,6 +7346,7 @@ + #endif /* CONFIG_ZAP_UDEV */ + + #ifdef CONFIG_DEVFS_FS ++ umode_t mode = S_IFCHR|S_IRUGO|S_IWUGO; + dev->devfs_handle = devfs_register(zaptel_devfs_dir, dev->name, DEVFS_FL_DEFAULT, ZT_MAJOR, dev->minor, mode, &zt_fops, NULL); + #endif /* CONFIG_DEVFS_FS */ + +diff -Nru zaptel-1.4.9.2.org/kernel/zaptel.h zaptel-1.4.9.2/kernel/zaptel.h +--- zaptel-1.4.9.2.org/kernel/zaptel.h 2008-02-05 00:00:48.000000000 +0100 ++++ zaptel-1.4.9.2/kernel/zaptel.h 2008-03-06 10:00:41.000000000 +0100 +@@ -1203,7 +1203,7 @@ + const char *name; + __u8 minor; + #ifdef CONFIG_DEVFS_FS +- static devfs_handle_t devfs_handle; ++ devfs_handle_t devfs_handle; + #endif + }; + -- 2.30.2