libsrtp-1.5.4.ebuild 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. # Copyright 1999-2015 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=6
  4. inherit autotools
  5. DESCRIPTION="Open-source implementation of the Secure Real-time Transport Protocol (SRTP)"
  6. HOMEPAGE="https://github.com/cisco/libsrtp"
  7. SRC_URI="https://github.com/cisco/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
  8. LICENSE="BSD"
  9. SLOT="0/1"
  10. KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~ppc ~ppc64 -sparc ~x86 ~x86-fbsd ~ppc-macos ~x64-macos ~x86-macos"
  11. IUSE="aesicm console debug doc libressl openssl static-libs syslog test"
  12. RDEPEND="
  13. openssl? (
  14. !libressl? ( dev-libs/openssl:0= )
  15. libressl? ( dev-libs/libressl:0= )
  16. )
  17. "
  18. DEPEND="${RDEPEND}"
  19. DOCS=( CHANGES README TODO )
  20. PATCHES=( "${FILESDIR}/${PN}-pcap-automagic-r0.patch" )
  21. src_prepare() {
  22. default
  23. # test/rtpw.c is using /usr/share/dict/words assuming it exists
  24. # using test/rtpw.c guaratees the file exists in any case
  25. sed -i -e "s:/usr/share/dict/words:rtpw.c:" test/rtpw.c || die
  26. eautoreconf
  27. }
  28. src_configure() {
  29. # stdout: default error output for messages in debug
  30. # kernel-linux: breaks the build
  31. # gdoi: disabled by upstream and breaks the build
  32. # pcap: seems to be test-only
  33. econf \
  34. --enable-stdout \
  35. --disable-kernel-linux \
  36. --disable-gdoi \
  37. --disable-pcap \
  38. $(use_enable aesicm generic-aesicm) \
  39. $(use_enable console) \
  40. $(use_enable debug) \
  41. $(use_enable openssl) \
  42. $(use_enable syslog)
  43. }
  44. src_compile() {
  45. use static-libs && emake ${PN}.a
  46. emake shared_library
  47. use test && emake test
  48. }
  49. src_test() {
  50. LD_LIBRARY_PATH="${S}" emake -j1 runtest
  51. # Makefile.in has '$(testapp): libsrtp.a'
  52. if use !static-libs; then
  53. rm libsrtp.a || die
  54. fi
  55. }
  56. src_install() {
  57. # libsrtp.pdf can also be generated with doxygen
  58. # but it would be a waste of time as an up-to-date version is built
  59. use doc && DOCS+=( doc/*.txt doc/${PN}.pdf )
  60. default
  61. }