2 # Copyright (C) 2020 Sebastian Kemper <sebastian_ml@gmx.net>
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
8 include $(TOPDIR
)/rules.mk
9 include $(INCLUDE_DIR
)/kernel.mk
12 PKG_VERSION
:=mr8.3
.1.4
15 PKG_SOURCE
:=$(PKG_NAME
)-$(PKG_VERSION
).
tar.gz
16 PKG_SOURCE_URL
:=https
://codeload.github.com
/sipwise
/rtpengine
/tar.gz
/$(PKG_VERSION
)?
17 PKG_HASH
:=18c998b776b36bec6d8c9d92ba21a38ffad76ccd20d66f99799420550eaa6fd4
20 PKG_LICENSE_FILES
:=LICENSE
22 PKG_MAINTAINER
:=Sebastian Kemper
<sebastian_ml@gmx.net
>
26 PKG_BUILD_DEPENDS
:=gperf
/host
28 include $(INCLUDE_DIR
)/package.mk
43 ENGINE_DEPENDS_TRANSCODING
:= \
50 RECORDING_DEPENDS
:= \
56 RTPENGINE_USERID
:=$(PKG_NAME
)=378:$(PKG_NAME
)=378
58 define Package
/rtpengine
/Default
59 URL
:=https
://github.com
/sipwise
/rtpengine
62 define Package
/rtpengine
/Template
63 $(call Package
/rtpengine
/Default
)
64 TITLE
:=Sipwise RTP Engine
68 USERID
:=$(RTPENGINE_USERID
)
71 define Package
/rtpengine
/description
/Template
72 The Sipwise NGCP rtpengine is a proxy for RTP traffic and other UDP
73 based media traffic. It
's meant to be used with the Kamailio SIP proxy
74 and forms a drop-in replacement for any of the other available RTP and
78 define Package/rtpengine
79 $(call Package/rtpengine/Template)
82 $(patsubst +%,+PACKAGE_rtpengine:%,$(ENGINE_DEPENDS_TRANSCODING)) \
86 define Package/rtpengine/conffiles
89 /etc/rtpengine/rtpengine.conf
92 define Package/rtpengine/description
93 $(call Package/rtpengine/description/Template)
95 Please consider installing kmod-ipt-rtpengine.
99 define Package/rtpengine/install
100 $(INSTALL_DIR) $(1)/usr/bin
101 $(INSTALL_BIN) $(PKG_BUILD_DIR)/daemon/rtpengine $(1)/usr/bin
103 $(INSTALL_DIR) $(1)/etc/init.d
104 $(INSTALL_BIN) ./files/rtpengine.init $(1)/etc/init.d/rtpengine
106 $(INSTALL_DIR) $(1)/etc/config
107 $(INSTALL_CONF) ./files/rtpengine.conf $(1)/etc/config/rtpengine
109 $(INSTALL_DIR) $(1)/etc/rtpengine
110 $(INSTALL_DATA) $(PKG_BUILD_DIR)/etc/rtpengine.sample.conf \
111 $(1)/etc/rtpengine/rtpengine.conf
113 $(INSTALL_DIR) $(1)/etc/hotplug.d/iface
114 $(INSTALL_BIN) ./files/rtpengine.hotplug \
115 $(1)/etc/hotplug.d/iface/90-rtpengine
118 define Package/rtpengine-no-transcode
119 $(call Package/rtpengine/Template)
120 TITLE+= (no transcoding)
121 VARIANT:=no-transcode
124 $(patsubst +%,+PACKAGE_rtpengine-no-transcode:%,$(ENGINE_DEPENDS)) \
128 Package/rtpengine-no-transcode/conffiles=$(Package/rtpengine/conffiles)
130 define Package/rtpengine-no-transcode/description
131 $(call Package/rtpengine/description/Template)
133 This package comes without transcoding support.
135 Please consider installing kmod-ipt-rtpengine.
139 Package/rtpengine-no-transcode/install=$(Package/rtpengine/install)
141 define Package/rtpengine-recording
142 $(call Package/rtpengine/Default)
143 TITLE:=Sipwise RTP Recording Daemon
147 USERID:=$(RTPENGINE_USERID)
148 DEPENDS:=$(patsubst +%,+PACKAGE_rtpengine-recording:%,$(RECORDING_DEPENDS))
151 define Package/rtpengine-recording/conffiles
152 /etc/config/rtpengine-recording
153 /etc/rtpengine/rtpengine-recording.conf
156 define Package/rtpengine-recording/install
157 $(INSTALL_DIR) $(1)/usr/bin
159 $(PKG_BUILD_DIR)/recording-daemon/rtpengine-recording \
162 $(INSTALL_DIR) $(1)/etc/init.d
163 $(INSTALL_BIN) ./files/rtpengine-recording.init \
164 $(1)/etc/init.d/rtpengine-recording
166 $(INSTALL_DIR) $(1)/etc/config
167 $(INSTALL_CONF) ./files/rtpengine-recording.conf \
168 $(1)/etc/config/rtpengine-recording
170 $(INSTALL_DIR) $(1)/etc/rtpengine
171 $(INSTALL_DATA) $(PKG_BUILD_DIR)/etc/rtpengine-recording.sample.conf \
172 $(1)/etc/rtpengine/rtpengine-recording.conf
175 define Package/iptables-mod-rtpengine
176 $(call Package/rtpengine/Default)
177 TITLE:=Sipwise rtpengine iptables extension
181 DEPENDS:=+PACKAGE_iptables-mod-rtpengine:libxtables
184 define Package/iptables-mod-rtpengine/install
185 $(INSTALL_DIR) $(1)/usr/lib/iptables
187 $(PKG_BUILD_DIR)/iptables-extension/libxt_RTPENGINE.so \
188 $(1)/usr/lib/iptables
191 define KernelPackage/ipt-rtpengine
192 $(call Package/rtpengine/Default)
193 TITLE:=Sipwise rtpengine netfilter module
194 SUBMENU:=Netfilter Extensions
195 FILES:=$(PKG_BUILD_DIR)/kernel-module/xt_RTPENGINE.$(LINUX_KMOD_SUFFIX)
196 AUTOLOAD:=$(call AutoProbe,xt_RTPENGINE)
198 +PACKAGE_kmod-ipt-rtpengine:kmod-crypto-hash \
199 +PACKAGE_kmod-ipt-rtpengine:kmod-ipt-core
200 MODPARAMS.xt_RTPENGINE := \
201 proc_uid=$(PKG_NAME) \
205 define KernelPackage/ipt-rtpengine/description
206 Netfilter kernel module for rtpengine
210 MAKE_VARS+=RTPENGINE_VERSION=$(PKG_VERSION)
212 ifeq ($(BUILD_VARIANT),no-transcode)
213 MAKE_VARS+=with_transcoding=no
216 # rtpengine uses Debian's dpkg utility programs if it can find them. But
217 # we don't want build host flags to leak into our cross-compile.
219 $(call Build
/Prepare
/Default
)
221 cd
"$(PKG_BUILD_DIR)" && \
222 $(FIND
) .
-maxdepth
2 -name
"*Makefile" | \
224 '/shell which dpkg-/s/dpkg/OpenWrt-has-no-dpkg/' {}
228 define Build
/Configure
233 ifneq ($(CONFIG_PACKAGE_kmod-ipt-rtpengine
),)
234 RTPENGINE_VERSION
=$(PKG_VERSION
) $(MAKE
) \
235 -C
$(PKG_BUILD_DIR
)/kernel-module \
237 ARCH
=$(LINUX_KARCH
) \
238 CROSS_COMPILE
=$(TARGET_CROSS
)
241 ifneq ($(CONFIG_PACKAGE_iptables-mod-rtpengine
),)
242 $(call Build
/Compile
/Default
,-C
$(PKG_BUILD_DIR
)/iptables-extension
)
245 ifneq ($(CONFIG_PACKAGE_rtpengine
)$(CONFIG_PACKAGE_rtpengine-no-transcode
),)
246 $(call Build
/Compile
/Default
,-C
$(PKG_BUILD_DIR
)/daemon
)
249 ifneq ($(CONFIG_PACKAGE_rtpengine-recording
),)
250 $(call Build
/Compile
/Default
,-C
$(PKG_BUILD_DIR
)/recording-daemon
)
255 define Build
/InstallDev
258 $(eval
$(call BuildPackage
,rtpengine-no-transcode
))
259 $(eval
$(call KernelPackage
,ipt-rtpengine
))
260 $(eval
$(call BuildPackage
,iptables-mod-rtpengine
))
261 $(eval
$(call BuildPackage
,rtpengine
))
262 $(eval
$(call BuildPackage
,rtpengine-recording
))