diff options
author | Jeroen Roovers <jer@gentoo.org> | 2016-01-16 08:47:30 +0100 |
---|---|---|
committer | Jeroen Roovers <jer@gentoo.org> | 2016-01-16 08:47:55 +0100 |
commit | 3c2db784f3db102aa799656951d2979aac4471ad (patch) | |
tree | d6a3b05a33ee34de881e837777f22202b0b92f92 /net-analyzer | |
parent | dev-ruby/ruby-beautify: add 0.97.4 (diff) | |
download | gentoo-3c2db784f3db102aa799656951d2979aac4471ad.tar.gz gentoo-3c2db784f3db102aa799656951d2979aac4471ad.tar.bz2 gentoo-3c2db784f3db102aa799656951d2979aac4471ad.zip |
net-analyzer/driftnet: Fix building against media-libs/giflib-5 (bug #572036). Add USE=filecaps.
Package-Manager: portage-2.2.26
Diffstat (limited to 'net-analyzer')
-rw-r--r-- | net-analyzer/driftnet/driftnet-0.1.6_p20090401-r1.ebuild | 86 | ||||
-rw-r--r-- | net-analyzer/driftnet/files/driftnet-0.1.6-giflib-5.patch | 50 |
2 files changed, 136 insertions, 0 deletions
diff --git a/net-analyzer/driftnet/driftnet-0.1.6_p20090401-r1.ebuild b/net-analyzer/driftnet/driftnet-0.1.6_p20090401-r1.ebuild new file mode 100644 index 000000000000..860dee9355b6 --- /dev/null +++ b/net-analyzer/driftnet/driftnet-0.1.6_p20090401-r1.ebuild @@ -0,0 +1,86 @@ +# Copyright 1999-2014 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Id$ + +EAPI=5 +inherit eutils fcaps flag-o-matic toolchain-funcs + +DESCRIPTION="A program which listens to network traffic and picks out images from TCP streams it observes" +HOMEPAGE="http://www.ex-parrot.com/~chris/driftnet/" +SRC_URI="mirror://github/rbu/${PN}/${P}.tar.gz" + +LICENSE="GPL-2" +KEYWORDS="~amd64 ~ppc -sparc ~x86" +SLOT="0" +IUSE="gtk mp3 suid" + +CDEPEND=" + net-libs/libpcap + gtk? ( + x11-libs/gtk+:2 + virtual/jpeg:0 + media-libs/giflib:= + media-libs/libpng:= + ) +" + +DEPEND=" + ${CDEPEND} + virtual/pkgconfig +" +RDEPEND=" + ${CDEPEND} + mp3? ( media-sound/mpg123 ) +" + +src_prepare() { + epatch "${FILESDIR}"/${PN}-0.1.6-giflib-5.patch + + sed -i \ + -e 's:png_set_gray_1_2_4_to_8:png_set_expand_gray_1_2_4_to_8:' \ + png.c || die + + # With newer libpng, --cflags causes build failures. + sed -i \ + -e 's:pkg-config --cflags libpng:$(PKG_CONFIG) --libs libpng:' \ + -e 's:_BSD_SOURCE:_DEFAULT_SOURCE:g' \ + Makefile || die +} + +src_compile() { + tc-export CC PKG_CONFIG + + if use gtk; then + emake + mv driftnet driftnet-gtk || die + emake clean + fi + + # build a non-gtk version for all users + sed -i 's:^\(.*gtk.*\)$:#\1:g' Makefile || die "sed disable gtk failed" + append-flags -DNO_DISPLAY_WINDOW + emake +} + +src_install() { + dosbin driftnet + doman driftnet.1 + + use gtk && dosbin driftnet-gtk + + dodoc CHANGES CREDITS README TODO + + if use suid ; then + elog "marking the no-display driftnet as setuid root." + fowners root:wheel "/usr/sbin/driftnet" + fperms 710 "/usr/sbin/driftnet" + fperms u+s "/usr/sbin/driftnet" + fi +} + +pkg_postinst() { + fcaps cap_dac_read_search,cap_net_raw,cap_net_admin \ + "${EROOT}"/usr/sbin/driftnet + use gtk && fcaps cap_dac_read_search,cap_net_raw,cap_net_admin \ + "${EROOT}"/usr/sbin/driftnet-gtk +} diff --git a/net-analyzer/driftnet/files/driftnet-0.1.6-giflib-5.patch b/net-analyzer/driftnet/files/driftnet-0.1.6-giflib-5.patch new file mode 100644 index 000000000000..30ad62c38f47 --- /dev/null +++ b/net-analyzer/driftnet/files/driftnet-0.1.6-giflib-5.patch @@ -0,0 +1,50 @@ +--- a/gif.c ++++ b/gif.c +@@ -20,7 +20,12 @@ + */ + int gif_load_hdr(img I) { + GifFileType *g; ++#if GIFLIB_MAJOR > 4 ++ int *GifError = NULL; ++ g = I->us = DGifOpenFileHandle(fileno(I->fp), GifError); ++#else + g = I->us = DGifOpenFileHandle(fileno(I->fp)); ++#endif /* GIFLIB_MAJOR */ + if (!I->us) { + I->err = IE_HDRFORMAT; + return 0; +@@ -36,7 +41,12 @@ + * Abort loading a GIF file after the header is done. + */ + int gif_abort_load(img I) { ++#if GIFLIB_MAJOR > 4 ++ int *GifError = NULL; ++ DGifCloseFile((GifFileType*)I->us, GifError); ++#else + DGifCloseFile((GifFileType*)I->us); ++#endif /* GIFLIB_MAJOR */ + return 1; + } + +@@ -44,6 +54,9 @@ + * Load GIF image. + */ + int gif_load_img(img I) { ++#if GIFLIB_MAJOR > 4 ++ int *GifError = NULL; ++#endif /* GIFLIB_MAJOR */ + GifFileType *g = I->us; + struct SavedImage *si; + int ret = 0; +@@ -114,7 +127,11 @@ + ret = 1; + fail: + ++#if GIFLIB_MAJOR > 4 ++ DGifCloseFile(g, GifError); ++#else + DGifCloseFile(g); ++#endif /* GIFLIB_MAJOR */ + + return ret; + } |