net-libs/nghttp2: stable 1.29.0 for ppc64, bug #646100
[gentoo.git] / net-libs / libsrtp / libsrtp-1.5.2.ebuild
1 # Copyright 1999-2015 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI="5"
5
6 inherit autotools base multilib
7
8 DESCRIPTION="Open-source implementation of the Secure Real-time Transport Protocol (SRTP)"
9 HOMEPAGE="https://github.com/cisco/libsrtp"
10 SRC_URI="https://github.com/cisco/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
11
12 LICENSE="BSD"
13 SLOT="0"
14 KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~ppc ~ppc64 -sparc ~x86 ~x86-fbsd ~ppc-macos ~x64-macos ~x86-macos"
15 IUSE="aesicm console debug doc openssl static-libs syslog"
16
17 DEPEND="openssl? ( dev-libs/openssl:0 )"
18 RDEPEND="${DEPEND}"
19
20 src_prepare() {
21         epatch "${FILESDIR}/${PN}-pcap-automagic-r0.patch"
22         eautoreconf || die
23 }
24
25 src_configure() {
26         # stdout: default error output for messages in debug
27         # kernel-linux: breaks the build
28         # gdoi: disabled by upstream and breaks the build
29         # pcap: seems to be test-only
30         econf \
31                 --enable-stdout \
32                 --disable-kernel-linux \
33                 --disable-gdoi \
34                 --disable-pcap \
35                 $(use_enable aesicm generic-aesicm) \
36                 $(use_enable console) \
37                 $(use_enable debug) \
38                 $(use_enable openssl) \
39                 $(use_enable syslog)
40 }
41
42 src_compile() {
43         if use static-libs; then
44                 emake ${PN}.a || die
45         fi
46         emake shared_library || die
47 }
48
49 src_test() {
50         # getopt returns an int, not a char
51         sed -i -e "s/char q/int q/" \
52                 test/rdbx_driver.c test/srtp_driver.c test/dtls_srtp_driver.c || die
53
54         # test/rtpw_test.sh is assuming . is in $PATH
55         sed -i -e "s:\$RTPW :./\$RTPW :" test/rtpw_test.sh || die
56
57         # test/rtpw.c is using /usr/share/dict/words assuming it exists
58         # using test/rtpw.c guaratees the file exists in any case
59         sed -i -e "s:/usr/share/dict/words:rtpw.c:" test/rtpw.c || die
60
61         emake test || die
62         emake -j1 runtest || die
63 }
64
65 src_install() {
66         emake DESTDIR="${D}" install || die
67
68         dodoc CHANGES README TODO || die
69
70         if use doc; then
71                 # libsrtp.pdf can also be generated with doxygen
72                 # but it would be a waste of time as an up-to-date version is built
73                 dodoc doc/*.txt doc/${PN}.pdf || die
74         fi
75 }