net-dns/bind-tools: Version bump
[gentoo.git] / net-dns / bind-tools / bind-tools-9.12.2_p1.ebuild
1 # Copyright 1999-2018 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI="5"
5
6 inherit eutils autotools flag-o-matic toolchain-funcs
7
8 MY_PN=${PN//-tools}
9 MY_PV=${PV/_p/-P}
10 MY_PV=${MY_PV/_rc/rc}
11 MY_P="${MY_PN}-${MY_PV}"
12
13 DESCRIPTION="bind tools: dig, nslookup, host, nsupdate, dnssec-keygen"
14 HOMEPAGE="http://www.isc.org/software/bind"
15 SRC_URI="https://www.isc.org/downloads/file/${MY_P}/?version=tar-gz -> ${MY_PN}-${PV}.tar.gz"
16
17 LICENSE="Apache-2.0 BSD BSD-2 GPL-2 HPND ISC MPL-2.0"
18 SLOT="0"
19 KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
20 IUSE="doc gost gssapi idn ipv6 libedit libidn2 libressl readline seccomp ssl urandom xml"
21 # no PKCS11 currently as it requires OpenSSL to be patched, also see bug 409687
22
23 REQUIRED_USE="gost? ( !libressl ssl )
24         idn? ( !libidn2 )
25         libidn2? ( !idn )"
26
27 CDEPEND="
28         ssl? (
29                 !libressl? ( dev-libs/openssl:0= )
30                 libressl? ( dev-libs/libressl:= )
31         )
32         gost? ( >=dev-libs/openssl-1.0.0:0=[-bindist] )
33         xml? ( dev-libs/libxml2 )
34         idn? ( <net-dns/idnkit-2:= )
35         libidn2? ( net-dns/libidn2 )
36         gssapi? ( virtual/krb5 )
37         libedit? ( dev-libs/libedit )
38         !libedit? (
39                 readline? ( sys-libs/readline:0= )
40         )
41         seccomp? ( sys-libs/libseccomp )"
42 DEPEND="${CDEPEND}
43         virtual/pkgconfig"
44 RDEPEND="${CDEPEND}
45         !<net-dns/bind-9.10.2"
46
47 S="${WORKDIR}/${MY_P}"
48
49 # bug 479092, requires networking
50 RESTRICT="test"
51
52 src_prepare() {
53         # Disable tests for now, bug 406399
54         sed -i '/^SUBDIRS/s:tests::' bin/Makefile.in lib/Makefile.in || die
55
56         # bug #220361
57         rm aclocal.m4
58         rm -rf libtool.m4/
59
60         mv configure.in configure.ac || die # configure.in is deprecated
61         eautoreconf
62 }
63
64 src_configure() {
65         local myconf=
66
67         if use urandom; then
68                 myconf="${myconf} --with-randomdev=/dev/urandom"
69         else
70                 myconf="${myconf} --with-randomdev=/dev/random"
71         fi
72
73         # bug 607400
74         if use libedit ; then
75                 myconf+=' --with-readline=-ledit'
76         elif use readline ; then
77                 myconf+=' --with-readline=-lreadline'
78         else
79                 myconf+=' --without-readline'
80         fi
81
82         # bug 344029
83         append-cflags "-DDIG_SIGCHASE"
84
85         # localstatedir for nsupdate -l, bug 395785
86         tc-export BUILD_CC
87         econf \
88                 --localstatedir="${EPREFIX}"/var \
89                 --without-python \
90                 --without-libjson \
91                 --without-zlib \
92                 --without-lmdb \
93                 $(use_enable ipv6) \
94                 $(use_with idn idnkit) \
95                 $(usex idn --with-idnlib=-lidnkit '') \
96                 $(use_with libidn2) \
97                 $(use_enable seccomp) \
98                 $(use_with ssl openssl "${EPREFIX}"/usr) \
99                 $(use_with xml libxml2) \
100                 $(use_with gssapi) \
101                 $(use_with readline) \
102                 $(use_with gost) \
103                 ${myconf}
104
105         # bug #151839
106         echo '#undef SO_BSDCOMPAT' >> config.h
107 }
108
109 src_compile() {
110         local AR=$(tc-getAR)
111
112         emake AR="${AR}" -C lib/
113         emake AR="${AR}" -C bin/delv/
114         emake AR="${AR}" -C bin/dig/
115         emake AR="${AR}" -C bin/nsupdate/
116         emake AR="${AR}" -C bin/dnssec/
117 }
118
119 src_install() {
120         dodoc README CHANGES
121
122         cd "${S}"/bin/delv
123         dobin delv
124         doman delv.1
125
126         cd "${S}"/bin/dig
127         dobin dig host nslookup
128         doman {dig,host,nslookup}.1
129
130         cd "${S}"/bin/nsupdate
131         dobin nsupdate
132         doman nsupdate.1
133         if use doc; then
134                 dohtml nsupdate.html
135         fi
136
137         cd "${S}"/bin/dnssec
138         for tool in dsfromkey importkey keyfromlabel keygen \
139           revoke settime signzone verify; do
140                 dobin dnssec-"${tool}"
141                 doman dnssec-"${tool}".8
142                 if use doc; then
143                         dohtml dnssec-"${tool}".html
144                 fi
145         done
146 }