From 8240fcedf373ef6f33b050e48986d59e7191645c Mon Sep 17 00:00:00 2001 From: VittGam Date: Mon, 22 Dec 2014 11:34:05 +0100 Subject: [PATCH] Add dahdi-linux and dahdi-tools packages. Signed-off-by: Vittorio Gambaletta --- libs/dahdilinux/Makefile | 91 +++++++++++++++++++++++++++++++++++++ libs/dahditools/Makefile | 97 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 188 insertions(+) create mode 100644 libs/dahdilinux/Makefile create mode 100644 libs/dahditools/Makefile diff --git a/libs/dahdilinux/Makefile b/libs/dahdilinux/Makefile new file mode 100644 index 0000000..b35da1b --- /dev/null +++ b/libs/dahdilinux/Makefile @@ -0,0 +1,91 @@ +# +# Copyright (C) 2014 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk +include $(INCLUDE_DIR)/kernel.mk + +PKG_NAME:=dahdi-linux +PKG_VERSION:=2.10.0.1 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://downloads.asterisk.org/pub/telephony/dahdi-linux/releases/ +PKG_MD5SUM:=a23e91cc474f241616a5a038ae2b1e72 + +PKG_LICENSE:=GPL-2.0 +PKG_LICENSE_FILES:=LICENSE +PKG_MAINTAINER:=Vittorio Gambaletta + +DAHDI_MODULES_EXTRA:= + +include $(INCLUDE_DIR)/package.mk + +define KernelPackage/dahdi + SUBMENU:=Voice over IP + TITLE:=DAHDI basic infrastructure + DEPENDS:=@USB_SUPPORT +kmod-lib-crc-ccitt + URL:=http://www.asterisk.org/ + FILES:= $(PKG_BUILD_DIR)/drivers/dahdi/dahdi.$(LINUX_KMOD_SUFFIX) + AUTOLOAD:=$(call AutoProbe,dahdi) +endef + +define KernelPackage/dahdi/description + This package contains DAHDI basic infrastructure. +endef + +define KernelPackage/dahdi-echocan-oslec + SUBMENU:=Voice over IP + TITLE:=DAHDI OSLEC echo canceller support + DEPENDS:=kmod-dahdi + URL:=http://www.asterisk.org/ + FILES:= $(PKG_BUILD_DIR)/drivers/staging/echo/echo.$(LINUX_KMOD_SUFFIX) \ + $(PKG_BUILD_DIR)/drivers/dahdi/dahdi_echocan_oslec.$(LINUX_KMOD_SUFFIX) + AUTOLOAD:=$(call AutoProbe,echo dahdi_echocan_oslec) +endef + +define KernelPackage/dahdi-echocan-oslec/description + This package contains DAHDI OSLEC echo canceller support. +endef + +define Build/Configure +endef + +TARGET_CFLAGS += $(FPIC) + +define Build/Prepare + $(Build/Prepare/Default) + mkdir -p $(PKG_BUILD_DIR)/drivers/staging/echo/ + $(CP) $(PKG_BUILD_DIR)/../linux-$(LINUX_VERSION)/drivers/misc/echo/* $(PKG_BUILD_DIR)/drivers/staging/echo/ || $(CP) $(PKG_BUILD_DIR)/../linux-$(LINUX_VERSION)/drivers/staging/echo/* $(PKG_BUILD_DIR)/drivers/staging/echo/ +endef + +define Build/Compile + $(MAKE) -C $(PKG_BUILD_DIR) \ + ARCH="$(LINUX_KARCH)" \ + $(TARGET_CONFIGURE_OPTS) \ + CROSS_COMPILE="$(TARGET_CROSS)" \ + KERNELVERSION="$(KERNEL)" \ + KERNEL_VERSION="$(LINUX_VERSION)" \ + KERNELDIR="$(LINUX_DIR)" \ + KSRC:="$(LINUX_DIR)" \ + KVERS:="$(LINUX_VERSION)" \ + TOPDIR:="$(TOPDIR)" \ + INCLUDE_DIR:="$(INCLUDE_DIR)" \ + PWD:="$(PKG_BUILD_DIR)" \ + MODULES_EXTRA:="$(DAHDI_MODULES_EXTRA)" +endef + +define Build/InstallDev + mkdir -p $(1)/usr/include/dahdi + $(CP) $(PKG_BUILD_DIR)/include/dahdi/dahdi_config.h $(1)/usr/include/dahdi/ + $(CP) $(PKG_BUILD_DIR)/include/dahdi/fasthdlc.h $(1)/usr/include/dahdi/ + $(CP) $(PKG_BUILD_DIR)/include/dahdi/kernel.h $(1)/usr/include/dahdi/ + $(CP) $(PKG_BUILD_DIR)/include/dahdi/user.h $(1)/usr/include/dahdi/ + $(CP) $(PKG_BUILD_DIR)/include/dahdi/wctdm_user.h $(1)/usr/include/dahdi/ +endef + +$(eval $(call KernelPackage,dahdi)) +$(eval $(call KernelPackage,dahdi-echocan-oslec)) diff --git a/libs/dahditools/Makefile b/libs/dahditools/Makefile new file mode 100644 index 0000000..aa6b7c0 --- /dev/null +++ b/libs/dahditools/Makefile @@ -0,0 +1,97 @@ +# +# Copyright (C) 2014 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=dahdi-tools +PKG_VERSION:=2.10.0.1 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://downloads.asterisk.org/pub/telephony/dahdi-tools/releases/ +PKG_MD5SUM:=224c5b86195249d5ce462ca316332087 + +PKG_LICENSE:=GPL-2.0 +PKG_LICENSE_FILES:=LICENSE +PKG_MAINTAINER:=Vittorio Gambaletta + +include $(INCLUDE_DIR)/package.mk + +define Package/dahdi-cfg/Default + SECTION:=utils + CATEGORY:=Utilities + SUBMENU:=Telephony + DEPENDS=+kmod-dahdi +endef + +define Package/dahdi-cfg + $(call Package/dahdi-cfg/Default) + DEPENDS+=+libpthread + TITLE:=DAHDI tools dahdi_cfg and dahdi_scan +endef + +define Package/dahdi-monitor + $(call Package/dahdi-cfg/Default) + TITLE:=DAHDI tools dahdi_monitor, dahdi_speed and dahdi_test +endef + +define Package/dahdi-tools-libtonezone + $(call Package/dahdi-cfg/Default) + SECTION:=libs + CATEGORY:=Libraries + TITLE:=DAHDI tonezone library +endef + +TARGET_CFLAGS += $(FPIC) +EXTRA_CFLAGS:= $(TARGET_CPPFLAGS) + +# dahdi_tool build not included => need libnewt +define Build/Compile + $(MAKE) -C $(PKG_BUILD_DIR) \ + $(TARGET_CONFIGURE_OPTS) \ + HOSTCC="$(HOSTCC)" \ + CROSS_COMPILE="$(TARGET_CROSS)" \ + CFLAGS="$(TARGET_CFLAGS) -I. -DBUILDING_TONEZONE -I$(STAGING_DIR)/usr/include" \ + KSRC="$(LINUX_DIR)" \ + DESTDIR="$(PKG_INSTALL_DIR)" \ + INSTALL_PREFIX="$(PKG_INSTALL_DIR)" \ + DAHDI_INCLUDE="$(STAGING_DIR)/usr/include" \ + CONFIGURE_SILENT="--silent" \ + dahdi_cfg dahdi_monitor dahdi_scan dahdi_speed dahdi_test fxotune libs +endef + +define Build/InstallDev + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_BUILD_DIR)/libtonezone.so $(1)/usr/lib/ + $(CP) $(PKG_BUILD_DIR)/libtonezone.a $(1)/usr/lib/ + + $(INSTALL_DIR) $(1)/usr/include/dahdi + $(CP) $(PKG_BUILD_DIR)/tonezone.h $(1)/usr/include/dahdi/ +endef + +define Package/dahdi-cfg/install + $(INSTALL_DIR) $(1)/usr/sbin + $(CP) $(PKG_BUILD_DIR)/dahdi_cfg $(1)/usr/sbin/ + $(CP) $(PKG_BUILD_DIR)/dahdi_scan $(1)/usr/sbin/ +endef + +define Package/dahdi-monitor/install + $(INSTALL_DIR) $(1)/usr/sbin + $(CP) $(PKG_BUILD_DIR)/dahdi_monitor $(1)/usr/sbin/ + $(CP) $(PKG_BUILD_DIR)/dahdi_speed $(1)/usr/sbin/ + $(CP) $(PKG_BUILD_DIR)/dahdi_test $(1)/usr/sbin/ +endef + +define Package/dahdi-tools-libtonezone/install + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_BUILD_DIR)/libtonezone.so $(1)/usr/lib/ + cd $(1)/usr/lib/; ln -s libtonezone.so libtonezone.so.2.0 +endef + +$(eval $(call BuildPackage,dahdi-cfg)) +$(eval $(call BuildPackage,dahdi-monitor)) +$(eval $(call BuildPackage,dahdi-tools-libtonezone)) -- 2.30.2