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