Merge pull request #248 from micmac1/master-mirror-hash-jiri
[feed/telephony.git] / net / asterisk-chan-sccp / Makefile
1 #
2 # Copyright (C) 2016 - 2017 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-20171123
13 PKG_RELEASE:=3
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:=ed272e974897f075573a358d169e5c77889f5905
19 PKG_MIRROR_HASH:=b2fa296e532154b864164a9bc8d64a40dddef2940902b61c3726c77f56b4e74e
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 # Asterisk 13 gets mistaken for Asterisk 15 because it was patched to include
97 # iostream support. To get it detected correctly make it impossible for the
98 # build system to find the iostream header.
99 define Build/Prepare
100 $(call Build/Prepare/Default)
101 ifeq ($(BUILD_VARIANT),asterisk13)
102 $(SED) 's|asterisk/iostream.h|asterisk/iostream.404|' \
103 $(PKG_BUILD_DIR)/autoconf/asterisk.m4
104 endif
105 endef
106
107 define Package/Install/Default
108 $(INSTALL_DIR) $(1)/etc/asterisk
109 $(INSTALL_CONF) $(PKG_INSTALL_DIR)/etc/asterisk/sccp.conf $(1)/etc/asterisk
110 $(INSTALL_DIR) $(1)/usr/lib/asterisk/modules
111 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/asterisk/modules/chan_sccp.so $(1)/usr/lib/asterisk/modules/
112 endef
113
114 Package/asterisk13-chan-sccp/install = $(Package/Install/Default)
115 Package/asterisk15-chan-sccp/install = $(Package/Install/Default)
116
117 $(eval $(call BuildPackage,asterisk13-chan-sccp))
118 $(eval $(call BuildPackage,asterisk15-chan-sccp))