6acd556f7547e688a76a57b19c303392c59713d8
[feed/telephony.git] / net / siproxd / Makefile
1 #
2 # Copyright (C) 2014-2018 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:=siproxd
11 PKG_RELEASE:=$(AUTORELEASE)
12
13 PKG_SOURCE_PROTO:=git
14 PKG_SOURCE_URL:=https://github.com/hb9xar/siproxd.git
15 PKG_SOURCE_DATE:=2022-02-18
16 PKG_SOURCE_VERSION:=4750bea4ffedb4543a404dafc979c2b16b53e523
17 PKG_MIRROR_HASH:=e6c4266b9eba43792908cf7c4ee73c32eee7b3a227ee671a5381cc335295fc05
18
19 PKG_FIXUP:=autoreconf
20 PKG_INSTALL:=1
21 PKG_BUILD_PARALLEL:=1
22
23 PKG_CONFIG_DEPENDS:=CONFIG_SIPROXD_MAX_CLIENTS
24
25 PKG_LICENSE:=GPL-2.0+
26 PKG_LICENSE_FILES:=COPYING
27
28 include $(INCLUDE_DIR)/package.mk
29
30 define Package/siproxd/Default
31 SECTION:=net
32 CATEGORY:=Network
33 SUBMENU:=Telephony
34 URL:=http://siproxd.sourceforge.net/
35 endef
36
37 define Package/siproxd
38 $(call Package/siproxd/Default)
39 DEPENDS:=+libltdl +libpthread +libosip2
40 TITLE:=SIP (Session Initiation Protocol) proxy
41 MENU:=1
42 endef
43
44 define Package/siproxd/description
45 Siproxd is a proxy/masquerading daemon for the SIP protocol. Refer to https://openwrt.org/docs/guide-user/services/voip/siproxd for configuration details and examples.
46 endef
47
48 define Package/siproxd/conffiles
49 /etc/config/siproxd
50 endef
51
52 define Package/siproxd/config
53 config SIPROXD_MAX_CLIENTS
54 int "Max supported clients"
55 default 32
56 depends on PACKAGE_siproxd
57 help
58 Default 32 is sufficient for home environments. Larger values
59 consume more memory (e.g. RSS of 17 MB with upstream default 512).
60 endef
61
62 CONFIGURE_ARGS+= \
63 --enable-reproducible-build \
64 --with-libosip-prefix="$(STAGING_DIR)/usr" \
65 --without-included-ltdl \
66 --disable-doc
67
68 MAKE_FLAGS+= \
69 SUBDIRS="src scripts contrib"
70
71 TARGET_CFLAGS+= \
72 -Wno-unused-const-variable
73
74 URLMAP:=$(CONFIG_SIPROXD_MAX_CLIENTS)
75 RTPPROXY:=$(shell expr $(URLMAP) \* 2)
76
77 define Build/Configure
78 $(call Build/Configure/Default)
79 $(ESED) 's;^(#define[[:space:]]+URLMAP_SIZE).*$$$$;\1 $(URLMAP);' \
80 -e 's;^(#define[[:space:]]+RTPPROXY_SIZE).*$$$$;\1 $(RTPPROXY);' \
81 $(PKG_BUILD_DIR)/src/siproxd.h
82 endef
83
84 define Package/siproxd/install
85 $(INSTALL_DIR) $(1)/usr/sbin
86 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/siproxd $(1)/usr/sbin
87 $(INSTALL_DIR) $(1)/etc/config
88 $(INSTALL_CONF) ./files/siproxd.config $(1)/etc/config/siproxd
89 $(INSTALL_DIR) $(1)/etc/init.d
90 $(INSTALL_BIN) ./files/siproxd.init $(1)/etc/init.d/siproxd
91 endef
92
93 define BuildPlugin
94 define Package/siproxd-mod-$(subst _,-,$(1))
95 $$(call Package/siproxd/Default)
96 TITLE:= siproxd $(1) plugin
97 DEPENDS:=siproxd $(2)
98 endef
99
100 define Package/siproxd-mod-$(subst _,-,$(1))/install
101 $(INSTALL_DIR) $$(1)/usr/lib/siproxd
102 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/siproxd/plugin_$(1).so \
103 $$(1)/usr/lib/siproxd
104 endef
105
106 $$(eval $$(call BuildPackage,siproxd-mod-$(subst _,-,$(1))))
107 endef
108
109 $(eval $(call BuildPackage,siproxd))
110 $(eval $(call BuildPlugin,blacklist,+libsqlite3))
111 $(eval $(call BuildPlugin,codecfilter))
112 $(eval $(call BuildPlugin,defaulttarget))
113 $(eval $(call BuildPlugin,demo))
114 $(eval $(call BuildPlugin,fix_bogus_via))
115 $(eval $(call BuildPlugin,fix_DTAG))
116 $(eval $(call BuildPlugin,fix_fbox_anoncall))
117 $(eval $(call BuildPlugin,logcall))
118 $(eval $(call BuildPlugin,prefix))
119 $(eval $(call BuildPlugin,regex))
120 $(eval $(call BuildPlugin,shortdial))
121 $(eval $(call BuildPlugin,stats))
122 $(eval $(call BuildPlugin,stripheader))
123 $(eval $(call BuildPlugin,stun))
124 $(eval $(call BuildPlugin,siptrunk))