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