From fe2f6f996bf0066f4462502926478aab1e4cce73 Mon Sep 17 00:00:00 2001 From: Sebastian Kemper Date: Thu, 14 Sep 2017 21:02:57 +0200 Subject: [PATCH] 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 --- net/asterisk-13.x/Makefile | 34 -------- net/asterisk-chan-lantiq/Makefile | 87 +++++++++++++++++++ .../files/chan_lantiq-asterisk13.c} | 0 .../files/default.exports | 8 ++ .../files/lantiq-asterisk13.conf.sample} | 0 5 files changed, 95 insertions(+), 34 deletions(-) create mode 100644 net/asterisk-chan-lantiq/Makefile rename net/{asterisk-13.x/src-lantiq/channels/chan_lantiq.c => asterisk-chan-lantiq/files/chan_lantiq-asterisk13.c} (100%) create mode 100644 net/asterisk-chan-lantiq/files/default.exports rename net/{asterisk-13.x/src-lantiq/configs/samples/lantiq.conf.sample => asterisk-chan-lantiq/files/lantiq-asterisk13.conf.sample} (100%) diff --git a/net/asterisk-13.x/Makefile b/net/asterisk-13.x/Makefile index 299faa4..b98ab9b 100644 --- a/net/asterisk-13.x/Makefile +++ b/net/asterisk-13.x/Makefile @@ -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,,)) diff --git a/net/asterisk-chan-lantiq/Makefile b/net/asterisk-chan-lantiq/Makefile new file mode 100644 index 0000000..9ab35e3 --- /dev/null +++ b/net/asterisk-chan-lantiq/Makefile @@ -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 + +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))) diff --git a/net/asterisk-13.x/src-lantiq/channels/chan_lantiq.c b/net/asterisk-chan-lantiq/files/chan_lantiq-asterisk13.c similarity index 100% rename from net/asterisk-13.x/src-lantiq/channels/chan_lantiq.c rename to net/asterisk-chan-lantiq/files/chan_lantiq-asterisk13.c diff --git a/net/asterisk-chan-lantiq/files/default.exports b/net/asterisk-chan-lantiq/files/default.exports new file mode 100644 index 0000000..6d9344d --- /dev/null +++ b/net/asterisk-chan-lantiq/files/default.exports @@ -0,0 +1,8 @@ +{ + global: + /* See main/asterisk.exports.in for an explanation why this is + * needed. */ + _IO_stdin_used; + local: + *; +}; diff --git a/net/asterisk-13.x/src-lantiq/configs/samples/lantiq.conf.sample b/net/asterisk-chan-lantiq/files/lantiq-asterisk13.conf.sample similarity index 100% rename from net/asterisk-13.x/src-lantiq/configs/samples/lantiq.conf.sample rename to net/asterisk-chan-lantiq/files/lantiq-asterisk13.conf.sample -- 2.30.2