Merge pull request #438 from micmac1/ast13-AST-2019-002-and-003
[feed/telephony.git] / net / asterisk-13.x-chan-lantiq / Makefile
1 #
2 # Copyright (C) 2018 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7
8 include $(TOPDIR)/rules.mk
9
10 PKG_NAME:=asterisk13-chan-lantiq
11 PKG_VERSION:=20180215
12 PKG_RELEASE:=2
13
14 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
15 PKG_SOURCE_URL:=https://github.com/kochstefan/asterisk_channel_lantiq.git
16 PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
17 PKG_SOURCE_VERSION:=f0d7ca7df8e5df802c5bcb79643e3bdc3956c190
18 PKG_MIRROR_HASH:=aaf5ce87a2e23b801318add79eaaa1b7c4a8aa497ca8e2a71ef5d452a7595a73
19 PKG_SOURCE_PROTO:=git
20
21 PKG_LICENSE:=GPL-2.0
22
23 PKG_MAINTAINER:=Jiri Slachta <jiri@slachta.eu>
24
25 PKG_FLAGS:=nonshared
26
27 include $(INCLUDE_DIR)/package.mk
28
29 define Package/$(PKG_NAME)
30 SUBMENU:=Telephony Lantiq
31 SECTION:=net
32 CATEGORY:=Network
33 TITLE:=Lantiq channel driver
34 URL:=https://github.com/kochstefan/asterisk_channel_lantiq
35 DEPENDS:=+asterisk13 +kmod-ltq-vmmc
36 endef
37
38 define Package/$(PKG_NAME)/description
39 An implementation of a Lantiq TAPI channel driver for Asterisk 13.
40 endef
41
42 define Package/$(PKG_NAME)/conffiles
43 /etc/asterisk/lantiq.conf
44 endef
45
46 define Build/Prepare
47 $(call Build/Prepare/Default)
48 $(INSTALL_DATA) ./files/default.exports \
49 $(PKG_BUILD_DIR)/src/channels/chan_lantiq.exports
50 endef
51
52 define Build/Compile
53 cd $(PKG_BUILD_DIR)/src/channels && \
54 $(TARGET_CC) -o chan_lantiq.o -c chan_lantiq.c -MD -MT chan_lantiq.o \
55 -MF .chan_lantiq.o.d -MP -pthread \
56 $(TARGET_CFLAGS) -DAST_MODULE_SELF_SYM=__internal_chan_lantiq_self \
57 -I$(STAGING_DIR)/usr/include/asterisk-13/include \
58 $(TARGET_CPPFLAGS) \
59 -Wall -Wstrict-prototypes -Wmissing-prototypes \
60 -Wmissing-declarations $(FPIC) -DAST_MODULE=\"chan_lantiq\" && \
61 $(TARGET_CC) -o chan_lantiq.so -pthread $(TARGET_LDFLAGS) -shared \
62 -Wl,--version-script,chan_lantiq.exports,--warn-common \
63 chan_lantiq.o
64 endef
65
66 define Package/$(PKG_NAME)/install
67 $(INSTALL_DIR) $(1)/etc/asterisk
68 $(INSTALL_CONF) \
69 $(PKG_BUILD_DIR)/src/configs/samples/lantiq.conf.sample \
70 $(1)/etc/asterisk/lantiq.conf
71 $(INSTALL_DIR) $(1)/usr/lib/asterisk/modules
72 $(INSTALL_BIN) \
73 $(PKG_BUILD_DIR)/src/channels/chan_lantiq.so \
74 $(1)/usr/lib/asterisk/modules
75 endef
76
77 $(eval $(call BuildPackage,$(PKG_NAME)))