Merge pull request #297 from micmac1/sccp-up
[feed/telephony.git] / net / asterisk-chan-sccp / Makefile
1 #
2 # Copyright (C) 2016 - 2018 OpenWrt.org
3 # Copyright (C) 2016 Cesnet, z.s.p.o.
4 #
5 # This is free software, licensed under the GNU General Public License v2.
6 # See /LICENSE for more information.
7 #
8
9 include $(TOPDIR)/rules.mk
10
11 PKG_NAME:=chan-sccp
12 PKG_VERSION:=v4.3.0-20180308
13 PKG_RELEASE:=1
14
15 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
16 PKG_SOURCE_URL:=https://github.com/chan-sccp/chan-sccp.git
17 PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
18 PKG_SOURCE_VERSION:=7764d2f2b65e62329ceff501b06a2eb2db68dafb
19 PKG_MIRROR_HASH:=39047994c85b4bb7e8e85d9c93b3a3a5517576b594f9898970e93d741f850e37
20 PKG_SOURCE_PROTO:=git
21
22 PKG_FIXUP:=autoreconf
23
24 PKG_LICENSE:=GPL-1.0
25 PKG_LICENSE_FILES:=COPYING LICENSE
26 PKG_MAINTAINER:=Jiri Slachta <jiri@slachta.eu>
27
28 PKG_INSTALL:=1
29
30 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
31
32 include $(INCLUDE_DIR)/package.mk
33
34 # musl and glibc include their own iconv, but uclibc does not
35 ifneq ($(CONFIG_USE_UCLIBC),)
36 TARGET_CPPFLAGS+= \
37 -I$(STAGING_DIR)/usr/lib/libiconv-full/include
38 TARGET_LDFLAGS+= \
39 -L$(STAGING_DIR)/usr/lib/libiconv-full/lib -liconv
40 endif
41
42 define Package/chan-sccp/Default
43 SUBMENU:=Telephony
44 SECTION:=net
45 CATEGORY:=Network
46 TITLE:=SCCP channel support
47 URL:=https://github.com/chan-sccp/chan-sccp
48 DEPENDS:=+USE_UCLIBC:libiconv-full +libltdl
49 PKG_BUILD_DEPENDS:=libiconv
50 endef
51
52 define Package/asterisk13-chan-sccp
53 $(call Package/chan-sccp/Default)
54 DEPENDS+=asterisk13
55 VARIANT:=asterisk13
56 CONFLICTS:=asterisk13-chan-skinny
57 endef
58
59 define Package/asterisk15-chan-sccp
60 $(call Package/chan-sccp/Default)
61 DEPENDS+=asterisk15
62 VARIANT:=asterisk15
63 CONFLICTS:=asterisk15-chan-skinny
64 endef
65
66 define Package/description/Default
67 Replacement for the SCCP channel driver (chan_skinny) in Asterisk.
68 Extended features include shared lines, presence / BLF, customizable
69 feature buttons and custom device state.
70 endef
71
72 Package/asterisk13-chan-sccp/description = $(Package/description/Default)
73 Package/asterisk15-chan-sccp/description = $(Package/description/Default)
74
75 CONFIGURE_ARGS += \
76 --disable-debug \
77 --enable-advanced-functions \
78 --enable-conference \
79 --enable-video
80
81 ifeq ($(BUILD_VARIANT),asterisk13)
82 CONFIGURE_ARGS += --with-asterisk=$(STAGING_DIR)/usr/include/asterisk-13
83 endif
84
85 ifeq ($(BUILD_VARIANT),asterisk15)
86 CONFIGURE_ARGS += --with-asterisk=$(STAGING_DIR)/usr/include/asterisk-15
87 endif
88
89 define Package/conffiles/Default
90 /etc/asterisk/sccp.conf
91 endef
92
93 Package/asterisk13-chan-sccp/conffiles = $(Package/conffiles/Default)
94 Package/asterisk15-chan-sccp/conffiles = $(Package/conffiles/Default)
95
96 define Package/Install/Default
97 $(INSTALL_DIR) $(1)/etc/asterisk
98 $(INSTALL_CONF) $(PKG_INSTALL_DIR)/etc/asterisk/sccp.conf $(1)/etc/asterisk
99 $(INSTALL_DIR) $(1)/usr/lib/asterisk/modules
100 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/asterisk/modules/chan_sccp.so $(1)/usr/lib/asterisk/modules/
101 endef
102
103 Package/asterisk13-chan-sccp/install = $(Package/Install/Default)
104 Package/asterisk15-chan-sccp/install = $(Package/Install/Default)
105
106 $(eval $(call BuildPackage,asterisk13-chan-sccp))
107 $(eval $(call BuildPackage,asterisk15-chan-sccp))