HACK: pinfo->private_data points to smb_info again
[wireshark-wip.git] / packaging / rpm / SPECS / wireshark.spec.in
blobe98fa00ec67080992a3a8e443b7f2f2f1b68d640
1 # Note that this is NOT a relocatable package
2 # $Id$
3 # @configure_input@
5 # Set these to 1 if you want to ensure your package inclues support for them:
6 %global with_adns 0
7 %global with_c_ares 1
8 %global with_lua 1
9 %global with_portaudio 0
11 # Set to 1 if you want GTK3 instead of GTK2:
12 %global with_gtk3 0
13 # Set to 1 if you want the Qt GUI too
14 %global with_qt 1
16 # Set at most one of these two:
17 # Note that setcap requires rpmbuild 4.7.0 or later.
18 %global setuid_dumpcap 0
19 %global setcap_dumpcap 1
21 # Set to 1 if you want a group called 'wireshark' which users must be a member
22 # of in order to run dumpcap. Only used if setuid_dumpcap or setcap_dumpcap
23 # are set.
24 %global use_wireshark_group 1
27 Summary: Network protocol analyzer
28 Name: wireshark
29 Version: @VERSION@
30 Release: 1
31 License: GPL+
32 Group: Applications/Internet
33 Source: http://wireshark.org/download/src/%{name}-%{version}.tar.bz2
34 # Or this URL for automated builds:
35 #Source: http://wireshark.org/download/automated/src/%{name}-%{version}.tar.bz2
36 URL: http://www.wireshark.org/
37 BuildRoot: /tmp/wireshark-%{PACKAGE_VERSION}-root
38 Packager: Gerald Combs <gerald[AT]wireshark.org>
39 # Some distributions create a wireshark-devel package; get rid of it
40 Obsoletes: wireshark-devel
42 BuildRequires: autoconf >= @AC_MIN_VERSION@
43 BuildRequires: automake
44 BuildRequires: libtool
45 BuildRequires: gcc
46 BuildRequires: flex
47 BuildRequires: bison
48 BuildRequires: python
49 BuildRequires: perl
51 BuildRequires: glib2-devel >= @GLIB_MIN_VERSION@
52 Requires: glib2 >= @GLIB_MIN_VERSION@
53 BuildRequires: libpcap-devel
54 Requires: libpcap
55 BuildRequires: zlib-devel
56 Requires: zlib
58 %if %{with_c_ares}
59 %if 0%{?suse_version}
60 # SuSE uses these package names (yes 2!):
61 BuildRequires: libcares-devel
62 Requires: libcares2
63 %else
64 # ... while Redhat uses this one:
65 # (What other RPM-based distros do will have to be determined...)
66 BuildRequires: c-ares-devel
67 Requires: c-ares
68 %endif
69 %endif
70 %if %{with_adns}
71 BuildRequires: adns-devel
72 Requires: adns
73 %endif
74 %if %{with_lua}
75 BuildRequires: lua-devel
76 Requires: lua
77 %endif
79 # Uncomment these if you want to be sure you get them...
80 #BuildRequires: krb5-devel
81 #BuildRequires: libsmi-devel
82 #BuildRequires: pcre-devel
83 #BuildRequires: libselinux
84 #BuildRequires: gnutls-devel
85 #BuildRequires: libcap-devel
87 %if %{use_wireshark_group}
88 %if 0%{?suse_version}
89 # SuSE's groupadd is in this package:
90 Requires(pre): pwdutils
91 %else
92 # ... while Redhat's is in this one:
93 Requires(pre): shadow-utils
94 %endif
95 %endif
97 %if %{setcap_dumpcap}
98 # Actually we require rpmbuild (the program) >= 4.7.0 but the package name
99 # where we can find it varies. So we check the 'rpm' version because either
100 # rpmbuild is in that package (e.g., in older distros) or it's in the
101 # 'rpm-build' package which generally requires a matching version of 'rpm'.
103 # All of this is to save users the trouble of getting through an full compile
104 # only to have rpmbuild barf because it doesn't understand capabilities.
105 BuildRequires: rpm >= 4.7.0
106 %endif
108 %description
109 Wireshark is a free network protocol analyzer for Unix and Windows. It
110 allows you to examine data from a live network or from a capture file
111 on disk. You can interactively browse the capture data, viewing summary
112 and detail information for each packet. Wireshark has several powerful
113 features, including a rich display filter language and the ability to
114 view the reconstructed stream of a TCP session.
116 This package contains command-line utilities, plugins, and documentation for
117 Wireshark. A GTK+ and a Qt graphical user interface are packaged separately.
119 %package gnome
120 Summary: Gnome desktop integration for Wireshark
121 Group: Applications/Internet
122 %if %{with_gtk3}
123 Requires: gtk3 >= @GTK3_MIN_VERSION@
124 BuildRequires: gtk3-devel >= @GTK3_MIN_VERSION@
125 %else
126 Requires: gtk2 >= @GTK2_MIN_VERSION@
127 BuildRequires: gtk2-devel >= @GTK2_MIN_VERSION@
128 %endif
129 Requires: %{name} = %{version}-%{release}
130 Requires: xdg-utils
131 Requires: hicolor-icon-theme
132 BuildRequires: desktop-file-utils
133 Requires(post): desktop-file-utils
134 Requires(post): %{_sbindir}/update-alternatives
135 Requires(postun): %{_sbindir}/update-alternatives
136 %if 0%{?suse_version}
137 # Need this for SuSE's suse_update_desktop_file macro
138 BuildRequires: update-desktop-files
139 %endif
140 %if %{with_portaudio}
141 BuildRequires: portaudio-devel
142 Requires: portaudio
143 %endif
145 # Uncomment these if you want to be sure you get them...
146 #BuildRequires: GeoIP-devel
147 #Requires: GeoIP
148 # Add this for more readable fonts on some distributions/versions
149 #Requires: dejavu-sans-mono-fonts
151 %description gnome
152 Contains the Gnome (GTK+) Wireshark GUI and desktop integration files.
154 %if %{with_qt}
155 %package qt
156 Summary: Qt GUI for Wireshark
157 Group: Applications/Internet
158 Requires: qt >= @QT_MIN_VERSION@
159 BuildRequires: qt-devel >= @QT_MIN_VERSION@
160 Requires: %{name} = %{version}-%{release}
161 Requires: xdg-utils
162 Requires: hicolor-icon-theme
163 BuildRequires: desktop-file-utils
164 Requires(post): desktop-file-utils
165 Requires(post): %{_sbindir}/update-alternatives
166 Requires(postun): %{_sbindir}/update-alternatives
167 BuildRequires: gcc-c++
168 %if 0%{?suse_version}
169 # Need this for SuSE's suse_update_desktop_file macro
170 BuildRequires: update-desktop-files
171 %endif
173 %description qt
174 Contains the Qt Wireshark GUI and desktop integration files.
175 %endif
178 %prep
179 %setup -q -n %{name}-%{version}
181 # Don't specify the prefix here: configure is a macro which expands to set
182 # the prefix and everything else too. If you need to change the prefix
183 # set _prefix (note the underscore) either in this file or on rpmbuild's
184 # command-line.
185 %configure \
186 --with-gnu-ld \
187 %if %{with_c_ares}
188 --with-c-ares \
189 %endif
190 %if %{with_adns}
191 --with-adns \
192 %endif
193 %if %{with_lua}
194 --with-lua \
195 %endif
196 %if %{with_portaudio}
197 --with-portaudio \
198 %endif
199 %if %{with_gtk3}
200 --with-gtk3 \
201 %else
202 --with-gtk2 \
203 %endif
204 %if %{with_qt}
205 --with-qt \
206 %endif
207 --disable-warnings-as-errors
209 # Suggestion: put this in your ~/.rpmmacros (without the hash sign, of course):
210 # %_smp_mflags -j %(grep -c processor /proc/cpuinfo)
211 make %{?_smp_mflags}
213 %install
214 rm -rf $RPM_BUILD_ROOT
215 make DESTDIR=$RPM_BUILD_ROOT install
216 # Change the program name for 'alternatives'
217 mv %{buildroot}%{_bindir}/wireshark %{buildroot}%{_bindir}/wireshark-gtk
218 # Create the 'alternative' file
219 touch %{buildroot}%{_bindir}/wireshark
220 make DESTDIR=$RPM_BUILD_ROOT install_desktop_files
221 %if 0%{?suse_version}
222 # SuSE's packaging conventions
223 # (http://en.opensuse.org/openSUSE:Packaging_Conventions_RPM_Macros#.25suse_update_desktop_file)
224 # require this:
225 %suse_update_desktop_file %{name}
226 %else
227 # Fedora's packaging guidelines (https://fedoraproject.org/wiki/Packaging:Guidelines)
228 # require this (at least if desktop-file-install was not used to install it).
229 desktop-file-validate %{buildroot}/usr/share/applications/wireshark.desktop
230 %endif
232 %clean
233 rm -rf $RPM_BUILD_ROOT
235 %if %{use_wireshark_group}
236 %pre
237 getent group wireshark >/dev/null || groupadd -r wireshark
238 %endif
240 %post -p /sbin/ldconfig
242 %postun -p /sbin/ldconfig
244 %post gnome
245 update-desktop-database &> /dev/null ||:
246 update-mime-database /usr/share/mime &> /dev/null || :
247 touch --no-create /usr/share/icons/hicolor &>/dev/null || :
248 %{_sbindir}/update-alternatives --install %{_bindir}/wireshark \
249 %{name} %{_bindir}/wireshark-gtk 50
251 %postun gnome
252 update-desktop-database &> /dev/null ||:
253 update-mime-database /usr/share/mime &> /dev/null || :
254 if [ $1 -eq 0 ] ; then
255 touch --no-create /usr/share/icons/hicolor &>/dev/null || :
256 gtk-update-icon-cache /usr/share/icons/hicolor &>/dev/null || :
257 %{_sbindir}/update-alternatives --remove %{name} %{_bindir}/wireshark-gtk
260 %if %{with_qt}
261 %post qt
262 update-desktop-database &> /dev/null ||:
263 update-mime-database /usr/share/mime &> /dev/null || :
264 touch --no-create /usr/share/icons/hicolor &>/dev/null || :
265 %{_sbindir}/update-alternatives --install %{_bindir}/wireshark \
266 %{name} %{_bindir}/wireshark-qt 10
268 %postun qt
269 update-desktop-database &> /dev/null ||:
270 update-mime-database /usr/share/mime &> /dev/null || :
271 if [ $1 -eq 0 ] ; then
272 touch --no-create /usr/share/icons/hicolor &>/dev/null || :
273 gtk-update-icon-cache /usr/share/icons/hicolor &>/dev/null || :
274 %{_sbindir}/update-alternatives --remove %{name} %{_bindir}/wireshark-qt
276 %endif
278 # Is this really needed?
279 %posttrans
280 gtk-update-icon-cache /usr/share/icons/hicolor &>/dev/null || :
283 %files
284 %defattr(-,root,root)
285 %doc AUTHORS COPYING ChangeLog INSTALL INSTALL.configure NEWS README*
286 # Don't pick up the wireshark (GUI) binary here
287 %exclude %{_bindir}/wireshark
288 %exclude %{_bindir}/wireshark-gtk
289 %exclude %{_bindir}/wireshark-qt
290 %{_bindir}/*
292 # This generates a warning because dumpcap is listed twice. That's
293 # probably preferable to listing each program (and keeping the list up to
294 # date)... Maybe if we can find a way to get the toplevel Makefile.am's
295 # bin_PROGRAMS in here?
296 %if %{use_wireshark_group} && %{setuid_dumpcap}
297 # Setuid but only executable by members of the 'wireshark' group
298 %attr(4750, root, wireshark) %{_bindir}/dumpcap
299 %else
300 %if %{use_wireshark_group} && %{setcap_dumpcap}
301 # Setcap but only executable by members of the 'wireshark' group
302 %attr(0750, root, wireshark) %caps(cap_net_raw,cap_net_admin=eip) %{_bindir}/dumpcap
303 %else
304 %if %{setuid_dumpcap}
305 # Setuid and executable by all
306 %attr(4755, root, root) %{_bindir}/dumpcap
307 %else
308 %if %{setcap_dumpcap}
309 # Setcap and executable by all
310 %attr(0755, root, root) %caps(cap_net_raw,cap_net_admin=eip) %{_bindir}/dumpcap
311 %else
312 # Executable by all but with no special permissions
313 %attr(0755, root, root) %{_bindir}/dumpcap
314 %endif
315 %endif
316 %endif
317 %endif
319 %{_libdir}/lib*.so*
320 %exclude %{_libdir}/%{name}/plugins/%{version}/*.la
321 %exclude %{_libdir}/*.la
322 %{_libdir}/wireshark
323 # Don't pick up the wireshark (GUI) man page
324 %exclude %{_mandir}/man1/wireshark.*
325 %{_mandir}/man1/*
326 %{_mandir}/man4/*
327 %{_datadir}/wireshark
329 %files gnome
330 %defattr(-,root,root)
331 /usr/share/applications/wireshark.desktop
332 /usr/share/icons/hicolor/*/apps/*
333 /usr/share/icons/hicolor/*/mimetypes/*
334 /usr/share/mime/packages/wireshark.xml
335 %{_bindir}/wireshark-gtk
336 %{_mandir}/man1/wireshark.*
337 %ghost %{_bindir}/wireshark
339 %if %{with_qt}
340 %files qt
341 %defattr(-,root,root)
342 /usr/share/applications/wireshark.desktop
343 /usr/share/icons/hicolor/*/apps/*
344 /usr/share/icons/hicolor/*/mimetypes/*
345 /usr/share/mime/packages/wireshark.xml
346 %{_bindir}/wireshark-qt
347 %{_mandir}/man1/wireshark.*
348 %ghost %{_bindir}/wireshark
349 %endif
351 %changelog
352 * Tue Nov 12 2013 Jeff Morriss
353 - Add q qt package using 'alternatives' to allow the administrator to choose
354 which one they actually use.
356 * Fri Sep 20 2013 Jeff Morriss
357 - If we're not using gtk3 add --with-gtk2 (since Wireshark now defaults to gtk3)
359 * Thu Mar 28 2013 Jeff Morriss
360 - Simplify check for rpmbuild's version.
362 * Fri Mar 8 2013 Jeff Morriss
363 - Put all icons in hicolor
364 - Use SuSE's desktop-update macro.
365 - Actually update MIME database when Wireshark's prefix is not /usr .
367 * Thu Mar 6 2013 Jeff Morriss
368 - List more build dependencies.
369 - Update to work on SuSE too: some of their package names are different.
371 * Thu Mar 6 2013 Gerald Combs
372 - Enable c-ares by default
374 * Mon Feb 6 2013 Jeff Morriss
375 - Overhaul to make this file more useful/up to date. Many changes are based
376 on Fedora's .spec file. Changes include:
377 - Create a separate wireshark-gnome package (like Redhat).
378 - Control some things with variables set at the top of the file.
379 - Allow the user to configure how dumpcap is installed.
380 - Allow the user to choose some options including GTK2 or GTK3.
381 - Greatly expand the BuildRequires entries; get the minimum versions of some
382 things from 'configure'.
383 - Install freedesktop files for better (free)desktop integration.
385 * Thu Aug 10 2006 Joerg Mayer
386 - Starting with X.org 7.x X11R6 is being phased out. Install wireshark
387 and manpage into the standard path.
389 * Mon Aug 01 2005 Gerald Combs
390 - Add a desktop file and icon for future use
392 - Take over the role of packager
394 - Update descriptions and source locations
396 * Thu Oct 28 2004 Joerg Mayer
397 - Add openssl requirement (heimdal and net-snmp are still automatic)
399 * Tue Jul 20 2004 Joerg Mayer
400 - Redo install and files section to actually work with normal builds
402 * Sat Feb 07 2004 Joerg Mayer
403 - in case there are shared libs: include them
405 * Tue Aug 24 1999 Gilbert Ramirez
406 - changed to ethereal.spec.in so that 'configure' can update
407 the version automatically
409 * Tue Aug 03 1999 Gilbert Ramirez <gram@xiexie.org>
410 - updated to 0.7.0 and changed gtk+ requirement
412 * Sun Jan 01 1999 Gerald Combs <gerald@zing.org>
413 - updated to 0.5.1
415 * Fri Nov 20 1998 FastJack <fastjack@i-s-o.net>
416 - updated to 0.5.0
418 * Sun Nov 15 1998 FastJack <fastjack@i-s-o.net>
419 - created .spec file