libsrtp-1.4.4_p20121108.ebuild 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. # Copyright 1999-2013 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI="4"
  4. inherit base multilib
  5. MY_PN="srtp"
  6. MY_P="${MY_PN}-${PV}"
  7. DESCRIPTION="Open-source implementation of the Secure Real-time Transport Protocol (SRTP)"
  8. HOMEPAGE="http://srtp.sourceforge.net/srtp.html"
  9. SRC_URI="https://dev.gentoo.org/~phajdan.jr/${MY_P}.tar.gz"
  10. LICENSE="BSD"
  11. SLOT="0"
  12. KEYWORDS="alpha amd64 ~arm ~hppa ia64 ppc ppc64 -sparc x86 ~x86-fbsd ~ppc-macos ~x64-macos ~x86-macos"
  13. IUSE="aesicm console debug doc static-libs syslog"
  14. PATCHES=( "${FILESDIR}/${P}-shared.patch" )
  15. S=${WORKDIR}/${MY_PN}
  16. src_configure() {
  17. # stdout: default error output for messages in debug
  18. # kernel-linux: breaks the build
  19. # gdoi: disabled by upstream and breaks the build
  20. econf \
  21. --enable-stdout \
  22. --disable-kernel-linux \
  23. --disable-gdoi \
  24. $(use_enable aesicm generic-aesicm) \
  25. $(use_enable console) \
  26. $(use_enable debug) \
  27. $(use_enable syslog)
  28. }
  29. src_compile() {
  30. if use static-libs; then
  31. emake ${PN}.a || die "Failed to build static library"
  32. fi
  33. emake ${PN}$(get_libname) || die "Failed to build dynamic library"
  34. }
  35. src_test() {
  36. # getopt returns an int, not a char
  37. sed -i -e "s/char q/int q/" \
  38. test/rdbx_driver.c test/srtp_driver.c test/dtls_srtp_driver.c \
  39. || die "fixing getopt errors failed"
  40. # test/rtpw_test.sh is assuming . is in $PATH
  41. sed -i -e "s:\$RTPW :./\$RTPW :" test/rtpw_test.sh \
  42. || die "patching test/rtpw_test.sh failed"
  43. # test/rtpw.c is using /usr/share/dict/words assuming it exists
  44. # using test/rtpw.c guaratees the file exists in any case
  45. sed -i -e "s:/usr/share/dict/words:rtpw.c:" test/rtpw.c \
  46. || die "patching test/rtpw.c failed"
  47. emake test || die "building test failed"
  48. emake -j1 runtest || die "tests failed"
  49. }
  50. src_install() {
  51. emake DESTDIR="${D}" install || die "emake install failed"
  52. dodoc CHANGES README TODO || die "dodoc failed"
  53. if use doc; then
  54. # libsrtp.pdf can also be generated with doxygen
  55. # but it would be a waste of time as an up-to-date version is built
  56. dodoc doc/*.txt doc/${PN}.pdf || die "dodoc failed"
  57. fi
  58. }