2023-01-08 08:43:25 +01:00
|
|
|
#
|
|
|
|
# Copyright (C) 2017 - 2023 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_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-master
|
|
|
|
PKG_MAINTAINER:=Lee Miller <lee.miller@tutanota.com>
|
|
|
|
PKG_LICENSE:=GPL-2.0
|
|
|
|
PKG_LICENSE_FILES:=COPYRIGHT.txt LICENSE.txt
|
|
|
|
|
|
|
|
|
|
|
|
MODULES_DIR:=/usr/lib/asterisk/modules
|
|
|
|
|
|
|
|
include $(INCLUDE_DIR)/package.mk
|
|
|
|
# asterisk-chan-quectel needs iconv
|
|
|
|
include $(INCLUDE_DIR)/nls.mk
|
|
|
|
|
2023-01-13 02:03:51 +01:00
|
|
|
define Package/$(PKG_NAME)
|
2023-01-08 08:43:25 +01:00
|
|
|
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
|
|
|
|
|
2023-01-13 02:03:51 +01:00
|
|
|
define Package/$(PKG_NAME)/description
|
2023-01-08 08:43:25 +01:00
|
|
|
Asterisk channel driver for mobile telephony.
|
|
|
|
endef
|
|
|
|
|
|
|
|
|
|
|
|
CONFIGURE_ARGS+= \
|
|
|
|
--with-asterisk=$(STAGING_DIR)/usr/include \
|
2023-01-13 02:03:51 +01:00
|
|
|
--with-astversion=20 \
|
|
|
|
--with-iconv=$(ICONV_PREFIX)/include
|
2023-01-08 08:43:25 +01:00
|
|
|
|
|
|
|
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
|
|
|
|
|
|
|
|
|
2023-01-13 02:03:51 +01:00
|
|
|
define Package/$(PKG_NAME)/conffiles
|
2023-01-08 08:43:25 +01:00
|
|
|
/etc/asterisk/quectel.conf
|
|
|
|
endef
|
|
|
|
|
|
|
|
|
2023-01-13 02:03:51 +01:00
|
|
|
define Package/$(PKG_NAME)/install
|
2023-01-08 08:43:25 +01:00
|
|
|
$(INSTALL_DIR) $(1)/etc/asterisk
|
2023-01-18 00:41:00 +01:00
|
|
|
$(INSTALL_DATA) $(PKG_BUILD_DIR)/uac/quectel.conf $(1)/etc/asterisk
|
2023-01-08 08:43:25 +01:00
|
|
|
$(INSTALL_DIR) $(1)$(MODULES_DIR)
|
|
|
|
$(INSTALL_BIN) $(PKG_BUILD_DIR)/chan_quectel.so $(1)$(MODULES_DIR)
|
|
|
|
endef
|
|
|
|
|
|
|
|
|
2023-01-18 00:41:00 +01:00
|
|
|
define Package/$(PKG_NAME)/postinst
|
|
|
|
#!/bin/sh
|
|
|
|
if [ -n "$${IPKG_INSTROOT}" ]; then
|
|
|
|
exit 0
|
|
|
|
fi
|
2023-01-18 06:01:34 +01:00
|
|
|
# Add asterisk user to audio and dialout groups
|
2023-01-18 06:14:02 +01:00
|
|
|
sed -i -E 's/((audio|dialout):x:[0-9]+:)/\1asterisk/' /etc/group
|
2023-01-18 00:41:00 +01:00
|
|
|
endef
|
|
|
|
|
|
|
|
|
2023-01-08 08:43:25 +01:00
|
|
|
$(eval $(call BuildPackage,$(PKG_NAME)))
|