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.5
.1.1
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
:=170377d663f9f9da790aa1ff262001940bfc4e930547807182fcceb8d8ee987e
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
29 include $(INCLUDE_DIR
)/nls.mk
44 ENGINE_DEPENDS_TRANSCODING
:= \
51 RECORDING_DEPENDS
:= \
57 RTPENGINE_USERID
:=$(PKG_NAME
)=378:$(PKG_NAME
)=378
59 define Package
/rtpengine
/Default
60 URL
:=https
://github.com
/sipwise
/rtpengine
63 define Package
/rtpengine
/Template
64 $(call Package
/rtpengine
/Default
)
65 TITLE
:=Sipwise RTP Engine
69 USERID
:=$(RTPENGINE_USERID
)
72 define Package
/rtpengine
/description
/Template
73 The Sipwise NGCP rtpengine is a proxy for RTP traffic and other UDP
74 based media traffic. It
's meant to be used with the Kamailio SIP proxy
75 and forms a drop-in replacement for any of the other available RTP and
79 define Package/rtpengine
80 $(call Package/rtpengine/Template)
83 $(patsubst +%,+PACKAGE_rtpengine:%,$(ENGINE_DEPENDS_TRANSCODING)) \
87 define Package/rtpengine/conffiles
90 /etc/rtpengine/rtpengine.conf
93 define Package/rtpengine/description
94 $(call Package/rtpengine/description/Template)
96 Please consider installing kmod-ipt-rtpengine.
100 define Package/rtpengine/install
101 $(INSTALL_DIR) $(1)/usr/bin
102 $(INSTALL_BIN) $(PKG_BUILD_DIR)/daemon/rtpengine $(1)/usr/bin
104 $(INSTALL_DIR) $(1)/etc/init.d
105 $(INSTALL_BIN) ./files/rtpengine.init $(1)/etc/init.d/rtpengine
107 $(INSTALL_DIR) $(1)/etc/config
108 $(INSTALL_CONF) ./files/rtpengine.conf $(1)/etc/config/rtpengine
110 $(INSTALL_DIR) $(1)/etc/rtpengine
111 $(INSTALL_DATA) $(PKG_BUILD_DIR)/etc/rtpengine.sample.conf \
112 $(1)/etc/rtpengine/rtpengine.conf
114 $(INSTALL_DIR) $(1)/etc/hotplug.d/iface
115 $(INSTALL_BIN) ./files/rtpengine.hotplug \
116 $(1)/etc/hotplug.d/iface/90-rtpengine
119 define Package/rtpengine-no-transcode
120 $(call Package/rtpengine/Template)
121 TITLE+= (no transcoding)
122 VARIANT:=no-transcode
125 $(patsubst +%,+PACKAGE_rtpengine-no-transcode:%,$(ENGINE_DEPENDS)) \
129 Package/rtpengine-no-transcode/conffiles=$(Package/rtpengine/conffiles)
131 define Package/rtpengine-no-transcode/description
132 $(call Package/rtpengine/description/Template)
134 This package comes without transcoding support.
136 Please consider installing kmod-ipt-rtpengine.
140 Package/rtpengine-no-transcode/install=$(Package/rtpengine/install)
142 define Package/rtpengine-recording
143 $(call Package/rtpengine/Default)
144 TITLE:=Sipwise RTP Recording Daemon
148 USERID:=$(RTPENGINE_USERID)
149 DEPENDS:=$(patsubst +%,+PACKAGE_rtpengine-recording:%,$(RECORDING_DEPENDS))
152 define Package/rtpengine-recording/conffiles
153 /etc/config/rtpengine-recording
154 /etc/rtpengine/rtpengine-recording.conf
157 define Package/rtpengine-recording/install
158 $(INSTALL_DIR) $(1)/usr/bin
160 $(PKG_BUILD_DIR)/recording-daemon/rtpengine-recording \
163 $(INSTALL_DIR) $(1)/etc/init.d
164 $(INSTALL_BIN) ./files/rtpengine-recording.init \
165 $(1)/etc/init.d/rtpengine-recording
167 $(INSTALL_DIR) $(1)/etc/config
168 $(INSTALL_CONF) ./files/rtpengine-recording.conf \
169 $(1)/etc/config/rtpengine-recording
171 $(INSTALL_DIR) $(1)/etc/rtpengine
172 $(INSTALL_DATA) $(PKG_BUILD_DIR)/etc/rtpengine-recording.sample.conf \
173 $(1)/etc/rtpengine/rtpengine-recording.conf
176 define Package/iptables-mod-rtpengine
177 $(call Package/rtpengine/Default)
178 TITLE:=Sipwise rtpengine iptables extension
182 DEPENDS:=+PACKAGE_iptables-mod-rtpengine:libxtables
185 define Package/iptables-mod-rtpengine/install
186 $(INSTALL_DIR) $(1)/usr/lib/iptables
188 $(PKG_BUILD_DIR)/iptables-extension/libxt_RTPENGINE.so \
189 $(1)/usr/lib/iptables
192 define KernelPackage/ipt-rtpengine
193 $(call Package/rtpengine/Default)
194 TITLE:=Sipwise rtpengine netfilter module
195 SUBMENU:=Netfilter Extensions
196 FILES:=$(PKG_BUILD_DIR)/kernel-module/xt_RTPENGINE.$(LINUX_KMOD_SUFFIX)
197 AUTOLOAD:=$(call AutoProbe,xt_RTPENGINE)
199 +PACKAGE_kmod-ipt-rtpengine:kmod-crypto-hash \
200 +PACKAGE_kmod-ipt-rtpengine:kmod-ipt-core
201 MODPARAMS.xt_RTPENGINE := \
202 proc_uid=$(PKG_NAME) \
206 define KernelPackage/ipt-rtpengine/description
207 Netfilter kernel module for rtpengine
211 MAKE_VARS+=RTPENGINE_VERSION=$(PKG_VERSION)
213 ifeq ($(BUILD_VARIANT),no-transcode)
214 MAKE_VARS+=with_transcoding=no
217 # rtpengine uses Debian's dpkg utility programs if it can find them. But
218 # we don't want build host flags to leak into our cross-compile.
220 $(call Build
/Prepare
/Default
)
222 cd
"$(PKG_BUILD_DIR)" && \
223 $(FIND
) .
-maxdepth
2 -name
"*Makefile" | \
225 '/shell which dpkg-/s/dpkg/OpenWrt-has-no-dpkg/' {}
229 define Build
/Configure
234 ifneq ($(CONFIG_PACKAGE_kmod-ipt-rtpengine
),)
235 RTPENGINE_VERSION
=$(PKG_VERSION
) $(MAKE
) \
236 -C
$(PKG_BUILD_DIR
)/kernel-module \
238 ARCH
=$(LINUX_KARCH
) \
239 CROSS_COMPILE
=$(TARGET_CROSS
)
242 ifneq ($(CONFIG_PACKAGE_iptables-mod-rtpengine
),)
243 $(call Build
/Compile
/Default
,-C
$(PKG_BUILD_DIR
)/iptables-extension
)
246 ifneq ($(CONFIG_PACKAGE_rtpengine
)$(CONFIG_PACKAGE_rtpengine-no-transcode
),)
247 $(call Build
/Compile
/Default
,-C
$(PKG_BUILD_DIR
)/daemon
)
250 ifneq ($(CONFIG_PACKAGE_rtpengine-recording
),)
251 $(call Build
/Compile
/Default
,-C
$(PKG_BUILD_DIR
)/recording-daemon
)
256 define Build
/InstallDev
259 $(eval
$(call BuildPackage
,rtpengine-no-transcode
))
260 $(eval
$(call KernelPackage
,ipt-rtpengine
))
261 $(eval
$(call BuildPackage
,iptables-mod-rtpengine
))
262 $(eval
$(call BuildPackage
,rtpengine
))
263 $(eval
$(call BuildPackage
,rtpengine-recording
))