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