freeswitch-stable: add mod_bcg729
[feed/telephony.git] / net / freeswitch-stable-mod-bcg729 / 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:=freeswitch-stable-mod-bcg729
11
12 PKG_VERSION:=20170629
13 PKG_RELEASE:=1
14 PKG_MAINTAINER:=Sebastian Kemper <sebastian_ml@gmx.net>
15
16 PKG_LICENSE:=MPL-1.1
17 PKG_LICENSE_FILES:=LICENSE
18
19 PRG_URL:=https://github.com/xadhoom/mod_bcg729
20
21 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
22 PKG_SOURCE_URL:=git://github.com/xadhoom/mod_bcg729.git
23 PKG_SOURCE_PROTO:=git
24 PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
25 PKG_SOURCE_VERSION:=686eb06d4a395d94c364efff4b63579af76ebec7
26
27 include $(INCLUDE_DIR)/package.mk
28
29 BCG729_MOD_DIR:=/usr/lib/freeswitch/mod
30
31 BCG729_CFLAGS:=\
32 $(FPIC) \
33 $(TARGET_CFLAGS) \
34 -fno-exceptions \
35 -Wall \
36 -std=c99 \
37 -pedantic
38
39 BCG729_INCLUDES:= \
40 $(TARGET_CPPFLAGS) \
41 -I$(STAGING_DIR)/usr/include/bcg729 \
42 -I$(STAGING_DIR)/usr/include/freeswitch
43
44 BCG729_LDFLAGS:=-lm -Wl,-shared -lbcg729 -Wl,-Bdynamic
45
46 define Package/$(PKG_NAME)
47 TITLE:=bcg729 module
48 SUBMENU:=Telephony
49 SECTION:=net
50 CATEGORY:=Network
51 URL:=https://www.freeswitch.org
52 DEPENDS:=freeswitch-stable +bcg729
53 endef
54
55 define Package/$(PKG_NAME)/description
56 FreeSWITCH G.729 module using the opensource bcg729 implementation by
57 Belledonne Communications.
58 endef
59
60 define Package/$(PKG_NAME)/install
61 $(INSTALL_DIR) $(1)$(BCG729_MOD_DIR)
62 $(INSTALL_BIN) $(PKG_BUILD_DIR)/mod_bcg729.so $(1)$(BCG729_MOD_DIR)
63 endef
64
65 define Build/Compile
66 cd $(PKG_BUILD_DIR) && \
67 $(TARGET_CC) \
68 $(BCG729_CFLAGS) \
69 $(BCG729_INCLUDES) \
70 -c mod_bcg729.c && \
71 $(TARGET_CC) \
72 $(BCG729_CFLAGS) \
73 $(BCG729_INCLUDES) \
74 -shared \
75 -Xlinker \
76 -x \
77 -o mod_bcg729.so \
78 mod_bcg729.o \
79 $(BCG729_LDFLAGS)
80 endef
81
82 $(eval $(call BuildPackage,$(PKG_NAME)))