From b3534eaedce52819ee3f61db6d191ed35177b955 Mon Sep 17 00:00:00 2001 From: IchthysMaranatha <94102122+IchthysMaranatha@users.noreply.github.com> Date: Thu, 8 Sep 2022 12:14:15 +0530 Subject: [PATCH] Makefile - Asterisk 18 with latest master always This is based on https://gh.fakev.cn/kiddin9/openwrt-packages/blob/master/asterisk-chan-quectel/Makefile Haven't tested it myself, make sure unzip is installed on build system. --- openwrt/urlmakefile/current/Ast18/makefile | 81 ++++++++++++++++++++++ 1 file changed, 81 insertions(+) create mode 100644 openwrt/urlmakefile/current/Ast18/makefile diff --git a/openwrt/urlmakefile/current/Ast18/makefile b/openwrt/urlmakefile/current/Ast18/makefile new file mode 100644 index 00000000..51608788 --- /dev/null +++ b/openwrt/urlmakefile/current/Ast18/makefile @@ -0,0 +1,81 @@ +# +# Copyright (C) 2017 - 2018 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:=asterisk-chan-quectel +PKG_VERSION:=3.6 +PKG_RELEASE:=3.6 + +PKG_SOURCE:=master.zip +PKG_SOURCE_URL:=https://github.com/IchthysMaranatha/asterisk-chan-quectel/archive/refs/heads/ +PKG_CAT:=unzip +PKG_HASH:=skip + +PKG_FIXUP:=autoreconf + +PKG_LICENSE:=GPL-2.0 +PKG_LICENSE_FILES:=COPYRIGHT.txt LICENSE.txt +PKG_MAINTAINER:=Jiri Slachta + +define Build/Prepare +PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION) +$(CP) ./src/* $(PKG_BUILD_DIR)/ +endef + + + +MODULES_DIR:=/usr/lib/asterisk/modules + +include $(INCLUDE_DIR)/package.mk +# asterisk-chan-quectel needs iconv +include $(INCLUDE_DIR)/nls.mk + +define Package/$(PKG_NAME) + SUBMENU:=Telephony + SECTION:=net + CATEGORY:=Network + URL:=https://github.com/IchthysMaranatha/asterisk-chan-quectel + DEPENDS:=asterisk $(ICONV_DEPENDS) +kmod-usb-acm +kmod-usb-serial +kmod-usb-serial-option +libusb-1.0 +alsa-lib + TITLE:=Asterisk Mobile Telephony Module +endef + +define Package/$(PKG_NAME)/description + Asterisk channel driver for mobile telephony. +endef + + +CONFIGURE_ARGS+= \ + --with-asterisk=$(STAGING_DIR)/usr/include \ + --with-astversion=18 \ + --with-iconv=$(ICONV_PREFIX)/include + +TARGET_CFLAGS+= \ + -I$(CHAN_quectel_AST_HEADERS) + +MAKE_FLAGS+=LD="$(TARGET_CC)" + +CONFIGURE_VARS += \ + DESTDIR="$(MODULES_DIR)" \ + ac_cv_type_size_t=yes \ + ac_cv_type_ssize_t=yes + + +define Package/$(PKG_NAME)/conffiles + /etc/asterisk/quectel.conf +endef + + +define Package/$(PKG_NAME)/install + $(INSTALL_DIR) $(1)/etc/asterisk + $(INSTALL_DATA) $(PKG_BUILD_DIR)/etc/quectel.conf $(1)/etc/asterisk + $(INSTALL_DIR) $(1)$(MODULES_DIR) + $(INSTALL_BIN) $(PKG_BUILD_DIR)/chan_quectel.so $(1)$(MODULES_DIR) +endef + + +$(eval $(call BuildPackage,$(PKG_NAME)))