telephony/net/asterisk-chan-dongle/Makefile
Sebastian Kemper 4e30b64604 asterisk-chan-dongle: adapt BUILD_NLS handling
openwrt recently stopped using libiconv-stub in the BUILD_NLS=n case.
Instead the libc's iconv has to be used.

This commit changes the iconv include path passed to
asterisk-chan-dongle for the BUILD_NLS=n case to
$(TOOLCHAIN_DIR)/include. That's where musl and glibc store iconv.h.

Also, the patch 200-fix-iconv-detection.patch gets replaced with a sed
script that only runs in the BUILD_NLS=y case.

And finally, $(AUTORELEASE) is added.

Signed-off-by: Sebastian Kemper <sebastian_ml@gmx.net>
2022-07-16 20:34:25 +02:00

97 lines
2.6 KiB
Makefile

#
# 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-dongle
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://github.com/wdoekes/asterisk-chan-dongle.git
PKG_SOURCE_VERSION:=3d046f7d6842298c6838b5ce5b51d495d383b158
PKG_SOURCE_DATE=2021-10-06
PKG_RELEASE:=$(AUTORELEASE)
PKG_MIRROR_HASH:=d485c89a7230ab8c318eed6c3a954b154d7e53cc7a0194abf96f4dcb83e6909c
PKG_FIXUP:=autoreconf
PKG_LICENSE:=GPL-2.0
PKG_LICENSE_FILES:=COPYRIGHT.txt LICENSE.txt
PKG_MAINTAINER:=Jiri Slachta <jiri@slachta.eu>
MODULES_DIR:=/usr/lib/asterisk/modules
include $(INCLUDE_DIR)/package.mk
# asterisk-chan-dongle needs iconv
include $(INCLUDE_DIR)/nls.mk
define Package/asterisk-chan-dongle
SUBMENU:=Telephony
SECTION:=net
CATEGORY:=Network
URL:=https://github.com/wdoekes/asterisk-chan-dongle
DEPENDS:=asterisk $(ICONV_DEPENDS) +libsqlite3
TITLE:=Huawei UMTS 3G dongle support
endef
define Package/asterisk-chan-dongle/description
Asterisk channel driver for Huawei UMTS 3G dongle.
endef
CONFIGURE_ARGS+= \
--with-asterisk=$(STAGING_DIR)/usr/include \
--with-astversion=18
ifeq ($(CONFIG_BUILD_NLS),y)
CONFIGURE_ARGS+=--with-iconv=$(ICONV_PREFIX)/include
else
CONFIGURE_ARGS+=--with-iconv=$(TOOLCHAIN_DIR)/include
endif
MAKE_FLAGS+=LD="$(TARGET_CC)"
CONFIGURE_VARS += \
DESTDIR="$(MODULES_DIR)" \
ac_cv_type_size_t=yes \
ac_cv_type_ssize_t=yes
define Package/asterisk-chan-dongle/conffiles
/etc/asterisk/dongle.conf
endef
define Package/asterisk-chan-dongle/install
$(INSTALL_DIR) $(1)/etc/asterisk
$(INSTALL_DATA) $(PKG_BUILD_DIR)/etc/dongle.conf $(1)/etc/asterisk
$(INSTALL_DIR) $(1)$(MODULES_DIR)
$(INSTALL_BIN) $(PKG_BUILD_DIR)/chan_dongle.so $(1)$(MODULES_DIR)
endef
define Package/asterisk-chan-dongle/postinst
#!/bin/sh
if [ -z "$${IPKG_INSTROOT}" ]; then
echo
echo "o-------------------------------------------------------------------o"
echo "| asterisk-chan-dongle note |"
echo "o-------------------------------------------------------------------o"
echo "| Adding the \"asterisk\" user to the \"dialout\" group might be |"
echo "| required for asterisk to be able to access the dongle. |"
echo "o-------------------------------------------------------------=^_^=-o"
echo
fi
exit 0
endef
define Build/Prepare
$(call Build/Prepare/Default)
ifeq ($(QUILT),)
ifeq ($(CONFIG_BUILD_NLS),y)
$(SED) 's/\[iconv\], \[c iconv\]/[libiconv], [iconv]/' \
"$(PKG_BUILD_DIR)/configure.ac"
endif
endif
endef
$(eval $(call BuildPackage,asterisk-chan-dongle))