Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Copyright 1999-2016 Gentoo Foundation
- # Distributed under the terms of the GNU General Public License v2
- # $Id$
- EAPI=6
- inherit autotools eutils user systemd linux-mod linux-info
- DESCRIPTION="A proxy for RTP traffic and other UDP based media traffic"
- HOMEPAGE="https://github.com/sipwise/rtpengine"
- SRC_URI="https://codeload.github.com/sipwise/rtpengine/tar.gz/mr${PV} -> ${P}.tar.gz"
- LICENSE="GPL-3"
- SLOT="0"
- KEYWORDS="~amd64 ~x86"
- IUSE="kernelforwarding utils -ngcp"
- DEPEND="
- sys-libs/zlib
- dev-libs/openssl
- dev-libs/libpcre
- net-misc/curl
- dev-libs/xmlrpc-c
- dev-libs/hiredis
- net-libs/libpcap
- dev-libs/libevent
- kernelforwarding? ( net-firewall/iptables )
- "
- RDEPEND="${DEPEND}
- utils? ( dev-lang/perl dev-perl/Crypt-Rijndael dev-perl/Digest-HMAC dev-perl/IO-Socket-INET6 virtual/perl-IO-Socket-IP dev-perl/Socket6 net-analyzer/openbsd-netcat )
- ngcp? ( net-misc/ngcp-system-tools )
- "
- S=${WORKDIR}/${PN}-mr${PV}
- pkg_setup() {
- if use kernelforwarding ; then
- NETFILTER_MODULES="NETFILTER NETFILTER_XTABLES IP_NF_IPTABLES IP6_NF_IPTABLES"
- CONFIG_CHECK_PRESENT="kernelforwarding? ( ${NETFILTER_MODULES} )"
- objdir=${S}/kernel-module
- if linux_config_exists; then
- if use kernelforwarding; then
- for module in ${NETFILTER_MODULES}; do
- linux_chkconfig_present ${module} || die "${module} needs to be present or kernelforwarding won't build"
- done
- fi
- linux-mod_pkg_setup
- fi
- fi
- }
- src_prepare() {
- epatch ${FILESDIR}/makefile.patch
- if use kernelforwarding ; then
- epatch ${FILESDIR}/kernel-makefiles.patch
- epatch ${FILESDIR}/implicit-declaration.patch
- fi
- default_src_prepare
- }
- src_compile() {
- cd ${S}/daemon
- emake all
- default_src_compile
- if use kernelforwarding ; then
- cd ${S}/iptables-extension
- emake all
- cd ${S}/kernel-module
- emake modules
- fi
- }
- src_install() {
- insinto /usr/sbin
- doins daemon/rtpengine
- fperms 0700 /usr/sbin/rtpengine
- if use utils ; then
- insinto /usr/sbin
- doins utils/rtpengine-ctl
- doins utils/rtpengine-ng-client
- doins utils/srtp-debug-helper
- fi
- dodoc debian/copyright debian/changelog
- if use kernelforwarding ; then
- insinto /lib64
- doins iptables-extension/libxt_RTPENGINE.so
- fperms 0755 /lib64/libxt_RTPENGINE.so
- linux-mod_src_install
- fi
- default_src_install
- }
- pkg_preinst() {
- systemd_dounit "${FILESDIR}/${PN}.service"
- insinto /etc/default
- newins "${FILESDIR}/${PN}.default" ${PN}
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement