asterisk-chan-lantiq: Move to separate package

Currently chan-lantiq doesn't build on the build bots and users end up
having to build it themselves. The reason for this was explained by
Mathias Kresin here:
http://lists.infradead.org/pipermail/lede-dev/2017-September/008886.html.

To fix this put chan-lantiq into its own package and set
PKG_FLAGS:=nonshared. The new package uses variants already, so it is
easily extendable in the future.

Signed-off-by: Sebastian Kemper <sebastian_ml@gmx.net>
This commit is contained in:
Sebastian Kemper 2017-09-14 21:02:57 +02:00
parent b55daa66c9
commit fe2f6f996b
5 changed files with 95 additions and 34 deletions

View file

@ -81,32 +81,6 @@ $(foreach b,$(8),$(call Package/asterisk13/install/sbin,$$(1),$(b));)
$$(eval $$(call BuildPackage,asterisk13-$(1)))
endef
define BuildAsterisk13NonSharedModule
define Package/asterisk13-$(1)
$$(call Package/asterisk13/Default)
TITLE:=$(2) support
DEPENDS:= asterisk13 $(patsubst +%,+PACKAGE_asterisk13-$(1):%,$(4))
PKG_FLAGS:=nonshared
endef
define Package/asterisk13-$(1)/conffiles
$(subst $(space),$(newline),$(foreach c,$(5),/etc/asterisk/$(c)))
endef
define Package/asterisk13-$(1)/description
This package provides support for '$(3)' in Asterisk.
endef
define Package/asterisk13-$(1)/install
$(foreach c,$(5),$(call Package/asterisk13/install/conffile,$$(1),$(c));)
$(foreach m,$(6),$(call Package/asterisk13/install/module,$$(1),$(m));)
$(foreach s,$(7),$(call Package/asterisk13/install/sounds,$$(1),$(s));)
$(foreach b,$(8),$(call Package/asterisk13/install/sbin,$$(1),$(b));)
endef
$$(eval $$(call BuildPackage,asterisk13-$(1)))
endef
define Package/asterisk13/Default
SUBMENU:=Telephony
SECTION:=net
@ -276,13 +250,6 @@ AST_MENUSELECT_OPTS = \
--without-curses \
--with-libxml2="$(STAGING_DIR_HOSTPKG)/usr"
define Build/Prepare
$(call Build/Prepare/Default)
ifneq ($(CONFIG_TARGET_lantiq),)
$(CP) ./src-lantiq/* $(PKG_BUILD_DIR)/
endif
endef
define Build/Configure
cd $(PKG_BUILD_DIR); \
./bootstrap.sh
@ -375,7 +342,6 @@ $(eval $(call BuildAsterisk13Module,cdr-sqlite3,Provides CDR SQLITE3,Call Detail
$(eval $(call BuildAsterisk13Module,chan-alsa,ALSA channel,the channel chan_alsa,+alsa-lib,alsa.conf,chan_alsa,,))
$(eval $(call BuildAsterisk13Module,chan-dahdi,DAHDI channel,DAHDI channel support,+dahdi-tools-libtonezone +kmod-dahdi +libpri @!aarch64,chan_dahdi.conf,chan_dahdi,,))
$(eval $(call BuildAsterisk13Module,chan-iax2,IAX2 channel,IAX support,+asterisk13-res-timing-timerfd,iax.conf iaxprov.conf,chan_iax2,,))
$(eval $(call BuildAsterisk13NonSharedModule,chan-lantiq,Lantiq TAPI channel,An implementation of Lantiq TAPI channel,@TARGET_lantiq +kmod-ltq-vmmc,lantiq.conf,chan_lantiq,,))
$(eval $(call BuildAsterisk13Module,chan-motif,Jingle channel,Motif Jingle Channel Driver,+asterisk13-res-xmpp,motif.conf,chan_motif,,))
$(eval $(call BuildAsterisk13Module,chan-oss,OSS channel,the channel chan_oss,,oss.conf,chan_oss,,))
$(eval $(call BuildAsterisk13Module,chan-sip,SIP channel,the channel chan_sip,+asterisk13-app-confbridge,sip.conf sip_notify.conf,chan_sip,,))

View file

@ -0,0 +1,87 @@
#
# Copyright (C) 2017 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:=chan-lantiq
PKG_VERSION:=1.0
PKG_RELEASE:=1
PKG_LICENSE:=GPL-2.0
PKG_MAINTAINER:=Jiri Slachta <jiri@slachta.eu>
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
PKG_FLAGS:=nonshared
include $(INCLUDE_DIR)/package.mk
define Package/$(PKG_NAME)/Default
SUBMENU:=Telephony
SECTION:=net
CATEGORY:=Network
TITLE:=Lantiq channel driver
URL:=https://github.com/kochstefan/asterisk_channel_lantiq
DEPENDS:=@(TARGET_lantiq_falcon||TARGET_lantiq_xway||TARGET_lantiq_xrx200) +kmod-ltq-vmmc
endef
define Package/asterisk13-$(PKG_NAME)
$(call Package/$(PKG_NAME)/Default)
DEPENDS+=asterisk13
VARIANT:=asterisk13
endef
define Package/description/Default
An implementation of a Lantiq TAPI channel driver for Asterisk.
endef
Package/asterisk13-$(PKG_NAME)/description = $(Package/description/Default)
define Package/conffiles/Default
/etc/asterisk/lantiq.conf
endef
Package/asterisk13-$(PKG_NAME)/conffiles = $(Package/conffiles/Default)
define Package/Install/Default
$(INSTALL_DIR) $(1)/etc/asterisk
$(INSTALL_CONF) $(SOURCE)/files/lantiq-$(BUILD_VARIANT).conf.sample \
$(1)/etc/asterisk/lantiq.conf
$(INSTALL_DIR) $(1)/usr/lib/asterisk/modules
$(INSTALL_BIN) $(PKG_BUILD_DIR)/chan_lantiq.so \
$(1)/usr/lib/asterisk/modules
endef
Package/asterisk13-$(PKG_NAME)/install = $(Package/Install/Default)
ifeq ($(BUILD_VARIANT),asterisk13)
CHAN_LANTIQ_AST_INCLUDES:=-I$(STAGING_DIR)/usr/include/asterisk-13/include
endif
define Build/Prepare
$(CP) $(SOURCE)/files/chan_lantiq-$(BUILD_VARIANT).c $(PKG_BUILD_DIR)/chan_lantiq.c
$(CP) $(SOURCE)/files/default.exports $(PKG_BUILD_DIR)/chan_lantiq.exports
endef
define Build/Configure
endef
define Build/Compile
cd $(PKG_BUILD_DIR) && \
$(TARGET_CC) -o chan_lantiq.o -c chan_lantiq.c -MD -MT chan_lantiq.o \
-MF .chan_lantiq.o.d -MP -pthread \
$(CHAN_LANTIQ_AST_INCLUDES) \
$(TARGET_CFLAGS) \
$(TARGET_CPPFLAGS) \
-Wall -Wstrict-prototypes -Wmissing-prototypes \
-Wmissing-declarations $(FPIC) -DAST_MODULE=\"chan_lantiq\" && \
$(TARGET_CC) -o chan_lantiq.so -pthread $(TARGET_LDFLAGS) -shared \
-Wl,--version-script,chan_lantiq.exports,--warn-common \
chan_lantiq.o
endef
$(eval $(call BuildPackage,asterisk13-$(PKG_NAME)))

View file

@ -0,0 +1,8 @@
{
global:
/* See main/asterisk.exports.in for an explanation why this is
* needed. */
_IO_stdin_used;
local:
*;
};