/[gentoo-x86]/net-analyzer/wireshark/wireshark-1.8.1.ebuild
Gentoo

Contents of /net-analyzer/wireshark/wireshark-1.8.1.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.6 - (hide annotations) (download)
Fri Jul 27 21:23:33 2012 UTC (23 months, 3 weeks ago) by zerochaos
Branch: MAIN
Changes since 1.5: +1 -5 lines
remove eautoreconf which is no longer needed

(Portage version: 2.1.11.9/cvs/Linux x86_64)

1 zerochaos 1.1 # Copyright 1999-2012 Gentoo Foundation
2     # Distributed under the terms of the GNU General Public License v2
3 zerochaos 1.6 # $Header: /var/cvsroot/gentoo-x86/net-analyzer/wireshark/wireshark-1.8.1.ebuild,v 1.5 2012/07/26 18:06:38 jer Exp $
4 zerochaos 1.1
5     EAPI="4"
6     PYTHON_DEPEND="python? 2"
7     inherit autotools eutils flag-o-matic python toolchain-funcs user
8    
9     [[ -n ${PV#*_rc} && ${PV#*_rc} != ${PV} ]] && MY_P=${PN}-${PV/_} || MY_P=${P}
10     DESCRIPTION="A network protocol analyzer formerly known as ethereal"
11     HOMEPAGE="http://www.wireshark.org/"
12     SRC_URI="http://www.wireshark.org/download/src/all-versions/${MY_P}.tar.bz2"
13    
14     LICENSE="GPL-2"
15     SLOT="0"
16 jer 1.5 KEYWORDS="~alpha amd64 hppa ~ia64 ~ppc ~ppc64 ~sparc ~x86 ~x86-fbsd"
17 zerochaos 1.1 IUSE="adns ares doc doc-pdf gtk ipv6 lua gcrypt geoip kerberos
18     profile +pcap portaudio python +caps selinux smi ssl zlib"
19    
20     RDEPEND=">=dev-libs/glib-2.14:2
21     zlib? ( sys-libs/zlib
22     !=sys-libs/zlib-1.2.4 )
23     smi? ( net-libs/libsmi )
24     gtk? ( >=x11-libs/gtk+-2.4.0:2
25     x11-libs/pango
26     dev-libs/atk
27     x11-misc/xdg-utils )
28     ssl? ( <net-libs/gnutls-3 )
29     gcrypt? ( dev-libs/libgcrypt )
30     pcap? ( net-libs/libpcap )
31     caps? ( sys-libs/libcap )
32     kerberos? ( virtual/krb5 )
33     portaudio? ( media-libs/portaudio )
34     ares? ( >=net-dns/c-ares-1.5 )
35     !ares? ( adns? ( net-libs/adns ) )
36     geoip? ( dev-libs/geoip )
37     lua? ( >=dev-lang/lua-5.1 )
38     selinux? ( sec-policy/selinux-wireshark )"
39    
40     DEPEND="${RDEPEND}
41     doc? ( dev-libs/libxslt
42     dev-libs/libxml2
43     app-doc/doxygen
44     doc-pdf? ( dev-java/fop ) )
45     virtual/pkgconfig
46     dev-lang/perl
47     sys-devel/bison
48     sys-apps/sed
49     sys-devel/flex
50     !!<net-analyzer/wireshark-1.8.0"
51    
52     S=${WORKDIR}/${MY_P}
53    
54     # borrowed from GSoC2010_Gentoo_Capabilities by constanze and flameyeys
55     # @FUNCTION: fcaps
56     # @USAGE: fcaps {uid:gid} {file-mode} {cap1[,cap2,...]} {file}
57     # @RETURN: 0 if all okay; non-zero if failure and fallback
58     # @DESCRIPTION:
59     # fcaps sets the specified capabilities in the effective and permitted set of
60     # the given file. In case of failure fcaps sets the given file-mode.
61     fcaps() {
62     local uid_gid=$1
63     local perms=$2
64     local capset=$3
65     local path=$4
66     local res
67    
68     chmod $perms $path && \
69     chown $uid_gid $path
70     res=$?
71    
72     use caps || return $res
73    
74     #set the capability
75     setcap "$capset=ep" "$path" &> /dev/null
76     #check if the capabilitiy got set correctly
77     setcap -v "$capset=ep" "$path" &> /dev/null
78     res=$?
79    
80     if [ $res -ne 0 ]; then
81     ewarn "Failed to set capabilities. Probable reason is missed kernel support."
82     ewarn "Kernel must have <FS>_FS_SECURITY enabled where <FS> is the filesystem"
83     ewarn "to store ${path} (e.g. EXT3_FS_SECURITY). For kernels version before"
84     ewarn "2.6.33_rc1 SECURITY_FILE_CAPABILITIES must be enabled as well."
85     ewarn
86     ewarn "Falling back to suid now..."
87     chmod u+s ${path}
88     fi
89     return $res
90     }
91    
92     pkg_setup() {
93     if ! use gtk; then
94     ewarn "USE=-gtk disables gtk-based gui called wireshark."
95     ewarn "Only command line utils will be built available"
96     fi
97     if use python; then
98     python_set_active_version 2
99     python_pkg_setup
100     fi
101     # Add group for users allowed to sniff.
102     enewgroup wireshark
103     }
104    
105     src_configure() {
106     local myconf
107    
108     if [[ $(gcc-major-version) -lt 3 ||
109     ( $(gcc-major-version) -eq 3 &&
110     $(gcc-minor-version) -le 4 ) ]] ; then
111     die "Unsupported compiler version, please upgrade."
112     fi
113    
114     if use ares && use adns; then
115     elog "You asked for both, ares and adns, but we can use only one of them."
116     elog "c-ares supersedes adns resolver thus using c-ares (ares USE flag)."
117     myconf="$(use_with ares c-ares) --without-adns"
118     else
119     myconf="$(use_with adns) $(use_with ares c-ares)"
120     fi
121    
122     # profile and pie are incompatible #215806, #292991
123     if use profile; then
124     ewarn "You've enabled the 'profile' USE flag, building PIE binaries is disabled."
125     ewarn "Also ignore \"unrecognized option '-nopie'\" gcc warning #358101."
126     append-flags $(test-flags-CC -nopie)
127     fi
128    
129     # Workaround bug #213705. If krb5-config --libs has -lcrypto then pass
130     # --with-ssl to ./configure. (Mimics code from acinclude.m4).
131     if use kerberos; then
132     case `krb5-config --libs` in
133     *-lcrypto*)
134     ewarn "Kerberos was built with ssl support: linkage with openssl is enabled."
135     ewarn "Note there are annoying license incompatibilities between the OpenSSL"
136     ewarn "license and the GPL, so do your check before distributing such package."
137     myconf+=" --with-ssl"
138     ;;
139     esac
140     fi
141    
142     # Hack around inability to disable doxygen/fop doc generation
143     use doc || export ac_cv_prog_HAVE_DOXYGEN=false
144     use doc-pdf || export ac_cv_prog_HAVE_FOP=false
145    
146     # dumpcap requires libcap, setuid-install requires dumpcap
147     econf $(use_enable gtk wireshark) \
148     $(use_enable profile profile-build) \
149     $(use_with ssl gnutls) \
150     $(use_with gcrypt) \
151     $(use_enable ipv6) \
152     $(use_with lua) \
153     $(use_with kerberos krb5) \
154     $(use_with smi libsmi) \
155     $(use_with zlib) \
156     $(use_with geoip) \
157     $(use_with portaudio) \
158     $(use_with python) \
159     $(use_with caps libcap) \
160     $(use_with pcap) \
161     $(use_with pcap dumpcap-group wireshark) \
162     $(use pcap && use_enable caps setcap-install) \
163     $(use pcap && use_enable !caps setuid-install) \
164     --sysconfdir="${EPREFIX}"/etc/wireshark \
165     --disable-extra-gcc-checks \
166     ${myconf}
167     }
168    
169     src_compile() {
170     default
171     use doc && emake -C docbook
172     }
173    
174     src_install() {
175     default
176     if use doc; then
177     dohtml -r docbook/{release-notes.html,ws{d,u}g_html{,_chunked}}
178     if use doc-pdf; then
179     insinto /usr/share/doc/${PF}/pdf/
180     doins docbook/{{developer,user}-guide,release-notes}-{a4,us}.pdf
181     fi
182     fi
183    
184     # FAQ is not required as is installed from help/faq.txt
185     dodoc AUTHORS ChangeLog NEWS README{,.bsd,.linux,.macos,.vmware} \
186     doc/{randpkt.txt,README*}
187    
188     insinto /usr/include/wiretap
189     doins wiretap/wtap.h
190    
191     if use gtk; then
192     for c in hi lo; do
193     for d in 16 32 48; do
194     insinto /usr/share/icons/${c}color/${d}x${d}/apps
195     newins image/${c}${d}-app-wireshark.png wireshark.png
196     done
197     done
198     domenu wireshark.desktop
199     fi
200     use pcap && chmod o-x "${ED}"/usr/bin/dumpcap #357237
201     }
202    
203     pkg_postinst() {
204     if use caps && use pcap; then
205     fcaps 0:wireshark 550 cap_net_raw,cap_net_admin "${EROOT}"/usr/bin/dumpcap
206     fi
207     echo
208     ewarn "NOTE: To run wireshark as normal user you have to add yourself to"
209     ewarn "the wireshark group. This security measure ensures that only trusted"
210     ewarn "users are allowed to sniff your traffic."
211     echo
212     }

  ViewVC Help
Powered by ViewVC 1.1.20