asterisk-chan-lantiq: Move to separate package
[feed/telephony.git] / net / asterisk-chan-lantiq / Makefile
1 #
2 # Copyright (C) 2017 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:=chan-lantiq
11 PKG_VERSION:=1.0
12 PKG_RELEASE:=1
13
14 PKG_LICENSE:=GPL-2.0
15 PKG_MAINTAINER:=Jiri Slachta <jiri@slachta.eu>
16
17 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
18
19 PKG_FLAGS:=nonshared
20
21 include $(INCLUDE_DIR)/package.mk
22
23 define Package/$(PKG_NAME)/Default
24 SUBMENU:=Telephony
25 SECTION:=net
26 CATEGORY:=Network
27 TITLE:=Lantiq channel driver
28 URL:=https://github.com/kochstefan/asterisk_channel_lantiq
29 DEPENDS:=@(TARGET_lantiq_falcon||TARGET_lantiq_xway||TARGET_lantiq_xrx200) +kmod-ltq-vmmc
30 endef
31
32 define Package/asterisk13-$(PKG_NAME)
33 $(call Package/$(PKG_NAME)/Default)
34 DEPENDS+=asterisk13
35 VARIANT:=asterisk13
36 endef
37
38 define Package/description/Default
39 An implementation of a Lantiq TAPI channel driver for Asterisk.
40 endef
41
42 Package/asterisk13-$(PKG_NAME)/description = $(Package/description/Default)
43
44 define Package/conffiles/Default
45 /etc/asterisk/lantiq.conf
46 endef
47
48 Package/asterisk13-$(PKG_NAME)/conffiles = $(Package/conffiles/Default)
49
50 define Package/Install/Default
51 $(INSTALL_DIR) $(1)/etc/asterisk
52 $(INSTALL_CONF) $(SOURCE)/files/lantiq-$(BUILD_VARIANT).conf.sample \
53 $(1)/etc/asterisk/lantiq.conf
54 $(INSTALL_DIR) $(1)/usr/lib/asterisk/modules
55 $(INSTALL_BIN) $(PKG_BUILD_DIR)/chan_lantiq.so \
56 $(1)/usr/lib/asterisk/modules
57 endef
58
59 Package/asterisk13-$(PKG_NAME)/install = $(Package/Install/Default)
60
61 ifeq ($(BUILD_VARIANT),asterisk13)
62 CHAN_LANTIQ_AST_INCLUDES:=-I$(STAGING_DIR)/usr/include/asterisk-13/include
63 endif
64
65 define Build/Prepare
66 $(CP) $(SOURCE)/files/chan_lantiq-$(BUILD_VARIANT).c $(PKG_BUILD_DIR)/chan_lantiq.c
67 $(CP) $(SOURCE)/files/default.exports $(PKG_BUILD_DIR)/chan_lantiq.exports
68 endef
69
70 define Build/Configure
71 endef
72
73 define Build/Compile
74 cd $(PKG_BUILD_DIR) && \
75 $(TARGET_CC) -o chan_lantiq.o -c chan_lantiq.c -MD -MT chan_lantiq.o \
76 -MF .chan_lantiq.o.d -MP -pthread \
77 $(CHAN_LANTIQ_AST_INCLUDES) \
78 $(TARGET_CFLAGS) \
79 $(TARGET_CPPFLAGS) \
80 -Wall -Wstrict-prototypes -Wmissing-prototypes \
81 -Wmissing-declarations $(FPIC) -DAST_MODULE=\"chan_lantiq\" && \
82 $(TARGET_CC) -o chan_lantiq.so -pthread $(TARGET_LDFLAGS) -shared \
83 -Wl,--version-script,chan_lantiq.exports,--warn-common \
84 chan_lantiq.o
85 endef
86
87 $(eval $(call BuildPackage,asterisk13-$(PKG_NAME)))