app-editors/kakoune: drop old 0_pre20160620
[gentoo.git] / net-misc / whois / whois-5.2.18.ebuild
1 # Copyright 1999-2017 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=6
5 inherit toolchain-funcs
6
7 MY_P=${P/-/_}
8 DESCRIPTION="improved Whois Client"
9 HOMEPAGE="https://www.linux.it/~md/software/"
10 SRC_URI="mirror://debian/pool/main/w/whois/${MY_P}.tar.xz"
11
12 LICENSE="GPL-2"
13 SLOT="0"
14 KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~x86-fbsd ~amd64-linux ~x86-linux"
15 IUSE="iconv idn nls"
16 RESTRICT="test" #59327
17
18 RDEPEND="iconv? ( virtual/libiconv )
19         idn? ( net-dns/libidn )
20         nls? ( virtual/libintl )"
21 DEPEND="${RDEPEND}
22         app-arch/xz-utils
23         >=dev-lang/perl-5
24         nls? ( sys-devel/gettext )"
25
26 PATCHES=(
27         "${FILESDIR}"/${PN}-4.7.2-config-file.patch
28 )
29
30 src_prepare() {
31         default
32         if use nls ; then
33                 sed -i -e 's:#\(.*pos\):\1:' Makefile || die
34         else
35                 sed -i -e '/ENABLE_NLS/s:define:undef:' config.h || die
36
37                 # don't generate po files when nls is disabled (bug #419889)
38                 sed -i -e '/^all:/s/ pos//' \
39                         -e '/^install:/s/ install-pos//' Makefile || die
40         fi
41 }
42
43 src_configure() { :;} # expected no-op
44
45 src_compile() {
46         unset HAVE_ICONV HAVE_LIBIDN
47         use iconv && export HAVE_ICONV=1
48         use idn && export HAVE_LIBIDN=1
49         tc-export CC
50         emake CFLAGS="${CFLAGS} ${CPPFLAGS}"
51 }
52
53 src_install() {
54         emake BASEDIR="${ED}" prefix=/usr install
55         insinto /etc
56         doins whois.conf
57         dodoc README debian/changelog
58
59         if [[ ${USERLAND} != "GNU" ]]; then
60                 mv "${ED}"/usr/share/man/man1/{whois,mdwhois}.1 || die
61                 mv "${ED}"/usr/bin/{whois,mdwhois} || die
62         fi
63 }