app-editors/kakoune: drop old 0_pre20160620
[gentoo.git] / net-misc / putty / putty-0.68.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 autotools eutils gnome2-utils toolchain-funcs
6
7 DESCRIPTION="A Free Telnet/SSH Client"
8 HOMEPAGE="http://www.chiark.greenend.org.uk/~sgtatham/putty/"
9 LICENSE="MIT"
10
11 SLOT="0"
12 KEYWORDS="alpha amd64 hppa ppc ppc64 sparc x86"
13 IUSE="doc +gtk ipv6 kerberos"
14 SRC_URI="
15         https://dev.gentoo.org/~jer/${PN}-icons.tar.bz2
16         http://the.earth.li/~sgtatham/${PN}/latest/${P}.tar.gz
17 "
18
19 RDEPEND="
20         !net-misc/pssh
21         gtk? (
22                 dev-libs/glib:2
23                 x11-libs/gdk-pixbuf
24                 x11-libs/gtk+:3[X]
25                 x11-libs/libX11
26                 x11-libs/pango
27         )
28         kerberos? ( virtual/krb5 )
29 "
30 DEPEND="
31         ${RDEPEND}
32         dev-lang/perl
33         virtual/pkgconfig
34 "
35
36 src_prepare() {
37         default
38
39         sed -i \
40                 -e '/AM_PATH_GTK(/d' \
41                 -e 's|-Werror||g' \
42                 configure.ac || die
43
44         eautoreconf
45 }
46
47 src_configure() {
48         cd "${S}"/unix || die
49         econf \
50                 $(use_with kerberos gssapi) \
51                 $(use_with gtk)
52 }
53
54 src_compile() {
55         cd "${S}"/unix || die
56         emake AR=$(tc-getAR) $(usex ipv6 '' COMPAT=-DNO_IPV6)
57 }
58
59 src_install() {
60         dodoc doc/puttydoc.txt
61
62         if use doc; then
63                 docinto html
64                 dodoc doc/*.html
65         fi
66
67         cd "${S}"/unix || die
68         default
69
70         if use gtk ; then
71                 for i in 16 22 24 32 48 64 128 256; do
72                         newicon -s ${i} "${WORKDIR}"/${PN}-icons/${PN}-${i}.png ${PN}.png
73                 done
74
75                 # install desktop file provided by Gustav Schaffter in #49577
76                 make_desktop_entry ${PN} PuTTY ${PN} Network
77         fi
78 }
79
80 pkg_preinst() {
81         use gtk && gnome2_icon_savelist
82 }
83
84 pkg_postinst() {
85         use gtk && gnome2_icon_cache_update
86 }
87
88 pkg_postrm() {
89         use gtk && gnome2_icon_cache_update
90 }