Advertisement
gedia

Untitled

Oct 3rd, 2016
119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 2.59 KB | None | 0 0
  1. # Copyright 1999-2016 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. # $Id$
  4.  
  5. EAPI=6
  6.  
  7. inherit autotools eutils user systemd linux-mod linux-info
  8.  
  9. DESCRIPTION="A proxy for RTP traffic and other UDP based media traffic"
  10. HOMEPAGE="https://github.com/sipwise/rtpengine"
  11. SRC_URI="https://codeload.github.com/sipwise/rtpengine/tar.gz/mr${PV} -> ${P}.tar.gz"
  12.  
  13. LICENSE="GPL-3"
  14. SLOT="0"
  15. KEYWORDS="~amd64 ~x86"
  16. IUSE="kernelforwarding utils -ngcp"
  17.  
  18. DEPEND="
  19.     sys-libs/zlib
  20.     dev-libs/openssl
  21.     dev-libs/libpcre
  22.     net-misc/curl
  23.     dev-libs/xmlrpc-c
  24.     dev-libs/hiredis
  25.     net-libs/libpcap
  26.     dev-libs/libevent
  27.     kernelforwarding? ( net-firewall/iptables )
  28. "
  29.  
  30. RDEPEND="${DEPEND}
  31.     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 )
  32.     ngcp? ( net-misc/ngcp-system-tools )
  33.     "
  34.  
  35. S=${WORKDIR}/${PN}-mr${PV}
  36.  
  37. pkg_setup() {
  38.     if use kernelforwarding ; then
  39.         NETFILTER_MODULES="NETFILTER NETFILTER_XTABLES IP_NF_IPTABLES IP6_NF_IPTABLES"
  40.         CONFIG_CHECK_PRESENT="kernelforwarding? ( ${NETFILTER_MODULES} )"
  41.         objdir=${S}/kernel-module
  42.         if linux_config_exists; then
  43.                     if use kernelforwarding; then
  44.                             for module in ${NETFILTER_MODULES}; do
  45.                                     linux_chkconfig_present ${module} || die "${module} needs to be present or kernelforwarding won't build"
  46.                     done
  47.                     fi
  48.         linux-mod_pkg_setup
  49.         fi
  50.     fi
  51. }
  52.  
  53. src_prepare() {
  54.     epatch ${FILESDIR}/makefile.patch
  55.  
  56.         if use kernelforwarding ; then
  57.                 epatch ${FILESDIR}/kernel-makefiles.patch
  58.         epatch ${FILESDIR}/implicit-declaration.patch
  59.         fi
  60.  
  61.  
  62.     default_src_prepare
  63. }
  64.  
  65. src_compile() {
  66.     cd ${S}/daemon
  67.     emake all
  68.  
  69.     default_src_compile
  70.  
  71.     if use kernelforwarding ; then
  72.         cd ${S}/iptables-extension
  73.         emake all
  74.         cd ${S}/kernel-module
  75.         emake modules
  76.     fi
  77. }
  78.  
  79. src_install() {
  80.     insinto /usr/sbin
  81.     doins daemon/rtpengine
  82.     fperms 0700 /usr/sbin/rtpengine
  83.  
  84.     if use utils ; then
  85.         insinto /usr/sbin
  86.         doins utils/rtpengine-ctl
  87.         doins utils/rtpengine-ng-client
  88.         doins utils/srtp-debug-helper
  89.     fi
  90.  
  91.     dodoc debian/copyright debian/changelog
  92.  
  93.         if use kernelforwarding ; then
  94.         insinto /lib64
  95.         doins iptables-extension/libxt_RTPENGINE.so
  96.         fperms 0755 /lib64/libxt_RTPENGINE.so
  97.         linux-mod_src_install
  98.         fi
  99.  
  100.     default_src_install
  101. }
  102.  
  103. pkg_preinst() {
  104.     systemd_dounit "${FILESDIR}/${PN}.service"
  105.  
  106.         insinto /etc/default
  107.         newins "${FILESDIR}/${PN}.default" ${PN}
  108. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement