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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.14 - (show annotations) (download)
Sun Mar 10 15:22:23 2013 UTC (21 months, 1 week ago) by jer
Branch: MAIN
CVS Tags: HEAD
Changes since 1.13: +1 -1 lines
FILE REMOVED
Old.

(Portage version: 2.2.0_alpha166/cvs/Linux x86_64, signed Manifest commit with key A792A613)

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

  ViewVC Help
Powered by ViewVC 1.1.20