chan-sccp-b:
[feed/telephony.git] / net / chan-sccp-b / Makefile
1 #
2 # Copyright (C) 2015 OpenWrt.org
3 # Copyright (C) 2015 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-b
12 PKG_REV:=6139
13 PKG_VERSION:=v4.2-r$(PKG_REV)
14 PKG_RELEASE:=3
15
16 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
17 PKG_SOURCE_URL:=http://svn.code.sf.net/p/chan-sccp-b/code/branches/V4.2
18 PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
19 PKG_SOURCE_VERSION:=$(PKG_REV)
20 PKG_SOURCE_PROTO:=svn
21
22 PKG_FIXUP:=autoreconf -fi
23
24 PKG_LICENSE:=GPL-1.0
25 PKG_LICENSE_FILES:=COPYING LICENSE
26 PKG_MAINTAINER:=Jiri Slachta <slachta@cesnet.cz>
27
28 include $(INCLUDE_DIR)/package.mk
29
30 define Package/chan-sccp-b/Default
31 SUBMENU:=Telephony
32 SECTION:=net
33 CATEGORY:=Network
34 TITLE:=SCCP channel provider support
35 URL:=http://chan-sccp-b.sourceforge.net/
36 DEPENDS:= +libltdl
37 endef
38
39 define Package/asterisk18-chan-sccp-b
40 $(call Package/chan-sccp-b/Default)
41 DEPENDS+= asterisk18
42 VARIANT:=asterisk18
43 endef
44
45 define Package/asterisk13-chan-sccp-b
46 $(call Package/chan-sccp-b/Default)
47 DEPENDS+= asterisk13
48 VARIANT:=asterisk13
49 endef
50
51 define Package/asterisk11-chan-sccp-b
52 $(call Package/chan-sccp-b/Default)
53 DEPENDS+= asterisk11
54 VARIANT:=asterisk11
55 endef
56
57 define Package/description/Default
58 SCCP channel provider for asterisk. It delivers extended functionality for SCCP phones over chan_skinny delivered
59 by asterisk by default.
60 endef
61
62 Package/asterisk18-chan-sccp-b/description = $(Package/description/Default)
63 Package/asterisk11-chan-sccp-b/description = $(Package/description/Default)
64 Package/asterisk13-chan-sccp-b/description = $(Package/description/Default)
65
66 ifeq ($(BUILD_VARIANT),asterisk13)
67 CONFIGURE_ARGS += --with-asterisk=$(STAGING_DIR)/usr/include/asterisk-13
68 endif
69
70 ifeq ($(BUILD_VARIANT),asterisk11)
71 CONFIGURE_ARGS += --with-asterisk=$(STAGING_DIR)/usr/include/asterisk-11
72 endif
73
74 ifeq ($(BUILD_VARIANT),asterisk18)
75 CONFIGURE_ARGS += --with-asterisk=$(STAGING_DIR)/usr/include/asterisk-1.8
76 endif
77
78 define Package/conffiles/Default
79 /etc/asterisk/sccp.conf
80 /etc/asterisk/extconfig.conf.sccp_sample
81 /etc/asterisk/res_config_sqlite3.conf.sccp_sample
82 /etc/asterisk/sccp_sqlite3.sql
83 /etc/asterisk/sccp.conf.realtime_sample
84 endef
85
86 Package/asterisk18-chan-sccp-b/conffiles = $(Package/conffiles/Default)
87 Package/asterisk11-chan-sccp-b/conffiles = $(Package/conffiles/Default)
88 Package/asterisk13-chan-sccp-b/conffiles = $(Package/conffiles/Default)
89
90 define Build/Compile
91 $(MAKE) -C "$(PKG_BUILD_DIR)" \
92 CFLAGS="$(CFLAGS) -I$(PKG_BUILD_DIR)/src -DLOW_MEMORY -fno-stack-protector" \
93 DESTDIR="$(PKG_INSTALL_DIR)" \
94 all install
95 endef
96
97 define Package/Install/Default
98 $(INSTALL_DIR) $(1)/etc/asterisk
99 $(CP) ./files/sccp.conf $(1)/etc/asterisk/sccp.conf
100 $(INSTALL_DIR) $(1)/usr/lib/asterisk/modules
101 $(CP) $(PKG_INSTALL_DIR)/usr/lib/asterisk/modules/chan_sccp.so $(1)/usr/lib/asterisk/modules/
102 if [ -f /usr/bin/sqlite3 ]; then
103 $(CP) ./files/extconfig.conf.sccp_sample $(1)/etc/asterisk/extconfig.conf.sccp_sample
104 $(CP) ./files/res_config_sqlite3.conf.sccp_sample $(1)/etc/asterisk/res_config_sqlite3.conf.sccp_sample
105 $(CP) ./files/sccp_sqlite3.sql $(1)/etc/asterisk/sccp_sqlite3.sql
106 $(CP) ./files/sccp.conf.realtime_sample $(1)/etc/asterisk/sccp.conf.realtime_sample
107 /usr/bin/sqlite3 /usr/lib/asterisk/realtime.sqlite3 < /etc/asterisk/sccp_sqlite3.sql
108 fi
109 endef
110
111 Package/asterisk18-chan-sccp-b/install = $(Package/Install/Default)
112 Package/asterisk11-chan-sccp-b/install = $(Package/Install/Default)
113 Package/asterisk13-chan-sccp-b/install = $(Package/Install/Default)
114
115 $(eval $(call BuildPackage,asterisk18-chan-sccp-b))
116 $(eval $(call BuildPackage,asterisk11-chan-sccp-b))
117 $(eval $(call BuildPackage,asterisk13-chan-sccp-b))