*/*: Drop stable ia64 keywords
[gentoo.git] / dev-libs / libdnet / libdnet-1.12.ebuild
1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=5
5
6 AT_M4DIR="config"
7 PYTHON_COMPAT=( python2_7 )
8 DISTUTILS_OPTIONAL=1
9
10 inherit autotools distutils-r1 eutils ltprune
11
12 DESCRIPTION="simplified, portable interface to several low-level networking routines"
13 HOMEPAGE="https://github.com/dugsong/libdnet"
14 SRC_URI="https://libdnet.googlecode.com/files/${P}.tgz
15         ipv6? ( https://fragroute-ipv6.googlecode.com/files/${P}.ipv6-1.patch.gz )"
16
17 LICENSE="LGPL-2"
18 SLOT="0"
19 KEYWORDS="~alpha amd64 arm hppa ~ia64 ~mips ppc ppc64 sparc x86"
20 IUSE="ipv6 python static-libs test"
21
22 #DEPEND="test? ( dev-libs/check )"
23 DEPEND="python? ( ${PYTHON_DEPS} )"
24 RDEPEND="${DEPEND}"
25 RESTRICT="test"
26 REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
27
28 DOCS=( README THANKS TODO )
29
30 src_prepare() {
31         # Useless copy
32         rm -r trunk/ || die
33
34         sed -i \
35                 -e 's/libcheck.a/libcheck.so/g' \
36                 -e 's|AM_CONFIG_HEADER|AC_CONFIG_HEADERS|g' \
37                 configure.in || die
38         sed -i -e 's|-L@libdir@ ||g' dnet-config.in || die
39         use ipv6 && epatch "${WORKDIR}/${P}.ipv6-1.patch"
40         sed -i -e '/^SUBDIRS/s|python||g' Makefile.am || die
41         eautoreconf
42         if use python; then
43                 cd python
44                 distutils-r1_src_prepare
45         fi
46 }
47
48 src_configure() {
49         econf \
50                 $(use_with python) \
51                 $(use_enable static-libs static)
52 }
53
54 src_compile() {
55         default
56         if use python; then
57                 cd python
58                 distutils-r1_src_compile
59         fi
60 }
61
62 src_install() {
63         default
64         if use python; then
65                 cd python
66                 unset DOCS
67                 distutils-r1_src_install
68         fi
69         prune_libtool_files
70 }