aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGerald Combs <gerald@wireshark.org>2018-03-20 23:15:33 +0000
committerAnders Broman <a.broman58@gmail.com>2018-03-26 14:00:35 +0000
commit1cd92c496102a7cd0d396ad94da767287a1c990c (patch)
tree8acc1fbbc77432e60b155edd1f9115420a18cc98
parenta0fd52dcae8d365b68dfdf2d7f99ddf79d6e49bc (diff)
CMake: Add an rpm-package target.
Copy the current wireshark.spec.in and update it for use with CMake. Remove the Qt4, GTK+2, and GTK+3 options. Add Ninja and mmdbresolve options. The rpm-package target builds a tarball using git-export-release.sh and therefore must be run from a git checkout. The RPM _prefix macro is set to CMAKE_INSTALL_PREFIX, so you'll probably want to run cmake -DCMAKE_INSTALL_PREFIX=/usr ... Change-Id: Ib014494d8858a0059126404cd91528ded5d8a9f6 Reviewed-on: https://code.wireshark.org/review/26579 Reviewed-by: Gerald Combs <gerald@wireshark.org> Petri-Dish: Gerald Combs <gerald@wireshark.org> Tested-by: Petri Dish Buildbot Reviewed-by: Jaap Keuter <jaap.keuter@xs4all.nl> Reviewed-by: Anders Broman <a.broman58@gmail.com>
-rw-r--r--CMakeLists.txt76
-rw-r--r--INSTALL8
-rw-r--r--configure.ac1
-rw-r--r--docbook/wsdg_src/WSDG_chapter_sources.asciidoc62
-rw-r--r--packaging/rpm/Makefile.am2
-rw-r--r--packaging/rpm/wireshark.spec.in549
-rwxr-xr-xtools/git-export-release.sh4
7 files changed, 671 insertions, 31 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 18a238f7ee..8f2ecac8d2 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -2981,6 +2981,82 @@ if(ENABLE_APPLICATION_BUNDLE)
endif()
+if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
+ find_program(RPMBUILD_EXECUTABLE rpmbuild)
+ find_program(GIT_EXECUTABLE git)
+endif()
+
+# This will fail if we're not building from a git checkout.
+if(RPMBUILD_EXECUTABLE AND GIT_EXECUTABLE)
+ foreach(_rpm_dir BUILD RPMS SOURCES SPECS SRPMS)
+ file(MAKE_DIRECTORY "${CMAKE_BINARY_DIR}/packaging/rpm/${_rpm_dir}")
+ endforeach()
+
+ set(_rpmbuild_with_args)
+ if(CMAKE_GENERATOR STREQUAL "Ninja")
+ list(APPEND _rpmbuild_with_args --with ninja)
+ endif()
+ if (BUILD_wireshark)
+ list(APPEND _rpmbuild_with_args --with qt5)
+ endif()
+ if (BUILD_mmdbresolve)
+ list(APPEND _rpmbuild_with_args --with mmdbresolve)
+ endif()
+ if (LUA_FOUND)
+ list(APPEND _rpmbuild_with_args --with lua)
+ endif()
+ if (LZ4_FOUND AND SNAPPY_FOUND)
+ list(APPEND _rpmbuild_with_args --define "with_lz4_and_snappy 1")
+ endif()
+ if (CARES_FOUND)
+ list(APPEND _rpmbuild_with_args --define "with_c_ares 1")
+ endif()
+ if (SPANDSP_FOUND)
+ list(APPEND _rpmbuild_with_args --define "with_spandsp 1")
+ endif()
+ if (BCG729_FOUND)
+ list(APPEND _rpmbuild_with_args --define "with_bcg729 1")
+ endif()
+ if (LIBXML2_FOUND)
+ list(APPEND _rpmbuild_with_args --define "with_libxml2 1")
+ endif()
+ if (NGHTTP2_FOUND)
+ list(APPEND _rpmbuild_with_args --define "with_nghttp2 1")
+ endif()
+
+ execute_process(
+ COMMAND git describe --abbrev=8 --match v[1-9]*
+ OUTPUT_VARIABLE _git_description
+ OUTPUT_STRIP_TRAILING_WHITESPACE
+ WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
+ )
+ string(SUBSTRING "${_git_description}" 1 -1 RPM_TARBALL_VERSION)
+ string(REPLACE "-" "_" RPM_VERSION "${RPM_TARBALL_VERSION}")
+ configure_file(packaging/rpm/wireshark.spec.in ${CMAKE_BINARY_DIR}/packaging/rpm/SPECS/wireshark.spec)
+
+ set(_export_tarball "${CPACK_PACKAGE_NAME}-${RPM_TARBALL_VERSION}.tar.xz")
+ add_custom_command(
+ OUTPUT "${CMAKE_SOURCE_DIR}/${_export_tarball}"
+ COMMAND ./tools/git-export-release.sh "${_git_description}"
+ # XXX Add an option to git-export-release.sh to write to a
+ # specific directory so that we can get rid of `ln` below.
+ WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
+ )
+ add_custom_target(rpm-package
+ COMMAND ${CMAKE_COMMAND} -E create_symlink
+ "${CMAKE_SOURCE_DIR}/${_export_tarball}"
+ "SOURCES/${_export_tarball}"
+ COMMAND ${RPMBUILD_EXECUTABLE}
+ --define "_topdir ${CMAKE_BINARY_DIR}/packaging/rpm"
+ --define "_prefix ${CMAKE_INSTALL_PREFIX}"
+ ${_rpmbuild_with_args}
+ --clean -ba SPECS/wireshark.spec
+ DEPENDS "${CMAKE_SOURCE_DIR}/${_export_tarball}"
+ WORKING_DIRECTORY "${CMAKE_BINARY_DIR}/packaging/rpm"
+ COMMENT "Create a tarball from the current git commit."
+ )
+endif()
+
set(CLEAN_C_FILES
${wireshark_FILES}
${tshark_FILES}
diff --git a/INSTALL b/INSTALL
index 412168f12c..5fbc9f8583 100644
--- a/INSTALL
+++ b/INSTALL
@@ -181,7 +181,13 @@ README.windows for those instructions.
make rpm-package
- to make an installable package for your system.
+ or
+
+ ninja rpm-package
+
+ to make an installable package for your system. The installation path
+ defaults to /usr/local, so you'll probably want to pass
+ -DCMAKE_INSTALL_PREFIX=/usr to CMake.
11/b. If you 're running a system that supports APT (Debian/Ubuntu/etc.)
run
diff --git a/configure.ac b/configure.ac
index b5ee1f0626..e4febe2b35 100644
--- a/configure.ac
+++ b/configure.ac
@@ -3040,7 +3040,6 @@ echo " Use Snappy library : $have_snappy"
# - docbook/wsdg_src/WSDG_chapter_dissection.asciidoc
# - docbook/wsdg_src/WSDG_chapter_sources.asciidoc
# - docbook/wsug_src/WSUG_chapter_build_install.asciidoc
-# - packaging/rpm/SPECS/wireshark.spec.in
# - tools/git-compare-abis.sh
echo ""
AC_MSG_NOTICE([Builds using Autotools might be removed in the future.])
diff --git a/docbook/wsdg_src/WSDG_chapter_sources.asciidoc b/docbook/wsdg_src/WSDG_chapter_sources.asciidoc
index b77535b6ee..822d1b0037 100644
--- a/docbook/wsdg_src/WSDG_chapter_sources.asciidoc
+++ b/docbook/wsdg_src/WSDG_chapter_sources.asciidoc
@@ -1012,7 +1012,6 @@ the binary packages are made.
[[ChSrcDeb]]
-
==== Debian: .deb packages
The Debian Package is built using dpkg-buildpackage, based on information
@@ -1034,55 +1033,62 @@ to build the Debian Package.
==== Red Hat: .rpm packages
-The RPM is built using rpmbuild (http://www.rpm.org/), which comes as standard on many flavours of Linux, including
-Red Hat and Fedora. The process creates a clean build environment in _packaging/rpm/BUILD_ every
-time the RPM is built. The settings controlling the build are in _packaging/rpm/SPECS/wireshark.spec.in_.
-After editing the settings in this file, _./configure_ must be run again in the wireshark directory to
-generate the actual specification script.
+You can build an RPM package using the `rpm-package` target. The package
+version is derived from the current git HEAD, so you must build from a
+git checkout.
+The package is built using http://www.rpm.org/[rpmbuild], which comes as
+standard on many flavours of Linux, including Red Hat, Fedora, and
+openSUSE. The process creates a clean build environment in
+_$\{CMAKE_BINARY_DIR}/packaging/rpm/BUILD_ each time the RPM is built.
+The settings that control the build are in
+_$\{CMAKE_SOURCE_DIR}/packaging/rpm/wireshark.spec.in_. The generated
+SPEC file contains CMake flags and other settings for the RPM build
+environment. Many of these come from the parent CMake environment.
+Notable ones are:
-.Careful with that `configure` setting
-[NOTE]
-====
-The SPEC file contains settings for the _configure_ used to set the RPM build
-environment. These are mostly independent of any settings passed to the
-usual Wireshark `./configure`. The exceptions to this rule are:
+* _\_prefix_ is set to _CMAKE_INSTALL_PREFIX_. By default this is
+ _/usr/local_. Pass `-DCMAKE_INSTALL_PREFIX=/usr` to create a package
+ that installs into _/usr_.
-* The _prefix_ given to `configure --prefix` is passed to rpmbuild.
+* Whether or not to create the “wireshark-qt” package
+ (`-DBUILD_wireshark`).
-* The selection of the GUI (Qt, Gtk+, or both) is passed to rpmbuild.
+* Lua, c-ares, nghttp2, and other library support (`-DENABLE_...`).
-* The selection of whether to include Lua support is passed to rpmbuild.
-====
+* Building with Ninja (`-G Ninja`).
-In the wireshark directory, type:
+In your build directory, type:
[source,sh]
----
+$ ninja rpm-package
+# ...or, if you're using GNU make...
$ make rpm-package
----
-to build the RPM and source RPM. Once it is done, there will be a message stating where the built RPM can be found.
+to build the binary and source RPMs. When it is finished there will be a
+message stating where the built RPM can be found.
.This might take a while
[TIP]
====
-Because this does a clean build as well as constructing the package this can
-take quite a long time. Suggestion: add the following to your `~/.rpmmacros`
-file to allow parallel builds:
+This creates a tarball, extracts it, compiles Wireshark, and constructs
+a package. This can take quite a long time. You can speed up the process
+by using Ninja. If you're using GNU make you can add the following to
+your `~/.rpmmacros` file to enable parallel builds:
----
%_smp_mflags -j %(grep -c processor /proc/cpuinfo)
----
====
-.Build requirements differ from run requirements
-[TIP]
-====
-Building the RPM requires building a source distribution which itself requires
-the Qt development tools `uic` and `moc`. These can usually be obtained by
-installing the _qt-devel_ package.
-====
+Building the RPM package requires quite a few packages and libraries
+including GLib, `gcc`, `bison`, `flex`, Asciidoctor, and Qt development
+tools such as `uic` and `moc`. The required Qt packages can usually be
+obtained by installing the _qt5-devel_ package. For a complete list of
+build requirements, look for the “BuildRequires” lines in
+_packaging/rpm/wireshark.spec.in_.
[[ChSrcOSX]]
diff --git a/packaging/rpm/Makefile.am b/packaging/rpm/Makefile.am
index a8fcf76cca..229f766a04 100644
--- a/packaging/rpm/Makefile.am
+++ b/packaging/rpm/Makefile.am
@@ -1,6 +1,8 @@
DIST_SUBDIRS = SPECS
+EXTRA_DIST = wireshark.spec.in
+
clean-local:
rm -rf BUILD RPMS SOURCES SRPMS
diff --git a/packaging/rpm/wireshark.spec.in b/packaging/rpm/wireshark.spec.in
new file mode 100644
index 0000000000..de4c346eb5
--- /dev/null
+++ b/packaging/rpm/wireshark.spec.in
@@ -0,0 +1,549 @@
+# Note that this is NOT a relocatable package
+# XXX is this still true? https://fedoraproject.org/wiki/Packaging:Cmake
+# says that recent CMake versions take care of rpathification.
+#
+# BUILD_wireshark: @BUILD_wireshark@
+# CMAKE_INSTALL_PREFIX: @CMAKE_INSTALL_PREFIX@
+
+# To do:
+# - Find a better way to sync with git-export-release.sh.
+# - We currently install into /usr/local.
+
+%bcond_without qt5
+%bcond_with lua
+%bcond_with mmdbresolve
+%bcond_with ninja
+# To do: Add bcond_with clang
+
+# Set these to 1 if you want to ensure your package includes support for them:
+# Should we use bcond_with and bcond_without here?
+%global with_lz4_and_snappy 1
+%global with_c_ares 1
+%global with_spandsp 0
+%global with_bcg729 0
+%global with_libxml2 1
+%global with_nghttp2 1
+
+# Set at most one of these two:
+# Note that setcap requires rpmbuild 4.7.0 or later.
+%global setuid_dumpcap 0
+%global setcap_dumpcap 1
+
+# Set to 1 if you want a group called 'wireshark' which users must be a member
+# of in order to run dumpcap. Only used if setuid_dumpcap or setcap_dumpcap
+# are set.
+%global use_wireshark_group 1
+
+%global package_version @RPM_TARBALL_VERSION@
+
+
+Summary: Wireshark is the world's foremost protocol analyzer
+Name: wireshark
+Version: @RPM_VERSION@
+Release: 1
+License: GPLv2+
+Group: Applications/Internet
+Source: https://www.wireshark.org/download/src/%{name}-%{package_version}.tar.xz
+# Or this URL for automated builds:
+#Source: https://www.wireshark.org/download/automated/src/%%{name}-%%{package_version}.tar.xz
+URL: https://www.wireshark.org/
+Packager: Gerald Combs <gerald[AT]wireshark.org>
+# Some distributions create a wireshark-devel package; get rid of it
+Obsoletes: wireshark-devel
+
+BuildRoot: /tmp/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
+
+BuildRequires: cmake
+BuildRequires: gcc
+BuildRequires: python
+BuildRequires: perl
+BuildRequires: flex
+BuildRequires: bison
+# HTML guides
+BuildRequires: asciidoctor
+
+BuildRequires: glib2-devel >= @GLIB2_MIN_VERSION@
+Requires: glib2 >= @GLIB2_MIN_VERSION@
+BuildRequires: libpcap-devel
+Requires: libpcap
+BuildRequires: zlib-devel
+Requires: zlib
+BuildRequires: libgcrypt-devel
+Requires: libgcrypt
+
+%if %{with_lz4_and_snappy}
+%if 0%{?suse_version}
+BuildRequires: liblz4-devel
+BuildRequires: snappy-devel
+Requires: libsnappy1
+Requires: liblz4-1
+%else
+BuildRequires: lz4-devel
+BuildRequires: snappy-devel
+Requires: snappy
+Requires: lz4
+%endif
+%endif
+
+%if %{with_c_ares}
+%if 0%{?suse_version}
+# SuSE uses these package names (yes 2!):
+BuildRequires: libcares-devel
+Requires: libcares2
+%else
+# ... while Red Hat uses this one:
+# (What other RPM-based distros do will have to be determined...)
+BuildRequires: c-ares-devel
+Requires: c-ares
+%endif
+%endif
+
+%if %{with lua}
+BuildRequires: lua-devel < 5.3
+Requires: lua < 5.3
+%endif
+
+%if %{with_nghttp2}
+BuildRequires: libnghttp2-devel
+Requires: libnghttp2
+%endif
+
+# Uncomment these if you want to be sure you get them...
+#BuildRequires: krb5-devel
+#BuildRequires: libsmi-devel
+#BuildRequires: pcre-devel
+#BuildRequires: libselinux
+#BuildRequires: gnutls-devel
+#BuildRequires: libcap-devel
+
+%if %{use_wireshark_group}
+%if 0%{?suse_version}
+# SuSE's groupadd is in this package:
+Requires(pre): pwdutils
+%else
+# ... while Red Hat's is in this one:
+Requires(pre): shadow-utils
+%endif
+%endif
+
+%if %{setcap_dumpcap}
+# Actually we require rpmbuild (the program) >= 4.7.0 but the package name
+# where we can find it varies. So we check the 'rpm' version because either
+# rpmbuild is in that package (e.g., in older distros) or it's in the
+# 'rpm-build' package which generally requires a matching version of 'rpm'.
+#
+# All of this is to save users the trouble of getting through an full compile
+# only to have rpmbuild barf because it doesn't understand capabilities.
+BuildRequires: rpm >= 4.7.0
+%endif
+
+# NOTE: the below description has been copied to wireshark.appdata.xml (in the
+# top-level directory).
+%description
+Wireshark allows you to examine protocol data stored in files or as it is
+captured from wired or wireless (WiFi or Bluetooth) networks, USB devices,
+and many other sources. It supports dozens of protocol capture file formats
+and understands more than a thousand protocols.
+
+It has many powerful features including a rich display filter language
+and the ability to reassemble multiple protocol packets in order to, for
+example, view a complete TCP stream, save the contents of a file which was
+transferred over HTTP or CIFS, or play back an RTP audio stream.
+
+This package contains command-line utilities, plugins, and documentation for
+Wireshark. A Qt graphical user interface is packaged separately.
+
+%if %{with qt5}
+%package qt
+Summary: Wireshark's Qt-based GUI
+Group: Applications/Internet
+%if 0%{?suse_version}
+Requires: libQt5Core5
+Requires: libQt5Gui5
+Requires: libQt5Widgets5
+Requires: libQt5PrintSupport5
+Requires: libQt5Multimedia5
+BuildRequires: libQt5Core-devel
+BuildRequires: libQt5Gui-devel
+BuildRequires: libQt5Widgets-devel
+BuildRequires: libQt5PrintSupport-devel
+BuildRequires: libqt5-qtmultimedia-devel
+%else
+Requires: qt5-qtbase
+Requires: qt5-qtbase-gui
+Requires: qt5-qtmultimedia
+BuildRequires: qt5-qtbase-devel
+BuildRequires: qt5-qtmultimedia-devel
+%endif
+Requires: %{name} = %{version}-%{release}
+Requires: xdg-utils
+Requires: hicolor-icon-theme
+BuildRequires: desktop-file-utils
+Requires(post): desktop-file-utils
+BuildRequires: gcc-c++
+%if 0%{?suse_version}
+# Need this for SuSE's suse_update_desktop_file macro
+BuildRequires: update-desktop-files
+%endif
+
+%description qt
+This package contains the Qt Wireshark GUI and desktop integration files.
+%endif
+
+
+%if %{with mmdbresolve}
+BuildRequires: libmaxminddb-devel
+Requires: libmaxminddb
+%endif
+
+# Uncomment these if you want to be sure you get them...
+# Add this for more readable fonts on some distributions/versions
+#Requires: dejavu-sans-mono-fonts
+
+
+%prep
+%setup -q -n %{name}-%{package_version}
+
+# Don't specify the prefix here: configure is a macro which expands to set
+# the prefix and everything else too. If you need to change the prefix
+# set _prefix (note the underscore) either in this file or on rpmbuild's
+# command-line.
+%cmake \
+%if %{with qt5}
+ -DBUILD_wireshark=ON \
+%else
+ -DBUILD_wireshark=OFF \
+%endif
+%if %{with lua}
+ -DENABLE_LUA=ON \
+%else
+ -DENABLE_LUA=OFF \
+%endif
+%if %{with mmdbresolve}
+ -DBUILD_mmdbresolve=ON \
+%else
+ -DBUILD_mmdbresolve=OFF \
+%endif
+%if %{with_lz4_and_snappy}
+ -DENABLE_LZ4=ON \
+ -DENABLE_SNAPPY=ON \
+%else
+ -DENABLE_LZ4=OFF \
+ -DENABLE_SNAPPY=OFF \
+%endif
+%if %{with_c_ares}
+ -DENABLE_CARES=ON \
+%else
+ -DENABLE_CARES=OFF \
+%endif
+%if %{with_spandsp}
+ -DENABLE_SPANDSP=ON \
+%else
+ -DENABLE_SPANDSP=OFF \
+%endif
+%if %{with_bcg729}
+ -DENABLE_BCG729=ON \
+%else
+ -DENABLE_BCG729=OFF \
+%endif
+%if %{with_libxml2}
+ -DENABLE_LIBXML2=ON \
+%else
+ -ENABLE_LIBXML2=OFF \
+%endif
+%if %{with_nghttp2}
+ -DENABLE_NGHTTP2=ON \
+%else
+ -DENABLE_NGHTTP2=OFF \
+%endif
+ -DDISABLE_WERROR=ON \
+%if %{with ninja}
+ -G Ninja \
+%endif
+ .
+
+%if %{with ninja}
+ninja
+%else
+# Suggestion: put this in your ~/.rpmmacros (without the hash sign, of course):
+# %_smp_mflags -j %(grep -c processor /proc/cpuinfo)
+make %{?_smp_mflags}
+%endif
+
+%install
+rm -rf $RPM_BUILD_ROOT
+%if %{with ninja}
+DESTDIR=$RPM_BUILD_ROOT ninja install
+DESTDIR=$RPM_BUILD_ROOT ninja install_guides
+%else
+make DESTDIR=$RPM_BUILD_ROOT install
+%endif
+
+# If we're being installed in an unusual prefix tell the loader where
+# to find our libraries.
+%if "%{_prefix}" != "/usr"
+ %define install_ld_so_conf 1
+ mkdir -p $RPM_BUILD_ROOT/etc/ld.so.conf.d
+ echo %{_libdir} > $RPM_BUILD_ROOT/etc/ld.so.conf.d/wireshark.conf
+%endif
+
+%if %{with qt5}
+%if 0%{?suse_version}
+# SuSE's packaging conventions
+# (http://en.opensuse.org/openSUSE:Packaging_Conventions_RPM_Macros#.25suse_update_desktop_file)
+# require this:
+%suse_update_desktop_file %{name}
+%else
+# Fedora's packaging guidelines (https://fedoraproject.org/wiki/Packaging:Guidelines)
+# require this (at least if desktop-file-install was not used to install it).
+desktop-file-validate %{buildroot}%{_datadir}/applications/wireshark.desktop
+%endif
+%endif
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+%pre
+%if %{use_wireshark_group}
+getent group wireshark >/dev/null || groupadd -r wireshark
+%endif
+
+%post -p /sbin/ldconfig
+
+%postun -p /sbin/ldconfig
+
+%if %{with qt5}
+%post qt
+update-desktop-database %{_datadir}/applications &> /dev/null || :
+update-mime-database %{_datadir}/mime &> /dev/null || :
+touch --no-create %{_datadir}/icons/hicolor &>/dev/null || :
+
+%postun qt
+update-desktop-database %{_datadir}/applications &> /dev/null ||:
+update-mime-database %{_datadir}/mime &> /dev/null || :
+%endif
+
+%files
+%defattr(-,root,root)
+%doc AUTHORS COPYING ChangeLog INSTALL NEWS README*
+
+# Include the User Guide:
+%if %{with ninja}
+%docdir %{_datadir}/doc/Wireshark/
+%{_datadir}/doc/Wireshark/
+%else
+%docdir %{_datadir}/doc/wireshark/guides/
+%{_datadir}/doc/wireshark/guides/
+%else
+%endif
+
+# Don't pick up any of the wireshark (GUI) binaries here
+%exclude %{_bindir}/wireshark*
+%{_bindir}/*
+
+# This generates a warning because dumpcap is listed twice. That's
+# probably preferable to listing each program (and keeping the list up to
+# date)... Maybe if we can find a way to get the toplevel Makefile.am's
+# bin_PROGRAMS in here?
+%if %{use_wireshark_group} && %{setuid_dumpcap}
+# Setuid but only executable by members of the 'wireshark' group
+%attr(4750, root, wireshark) %{_bindir}/dumpcap
+%else
+%if %{use_wireshark_group} && %{setcap_dumpcap}
+# Setcap but only executable by members of the 'wireshark' group
+%attr(0750, root, wireshark) %caps(cap_net_raw,cap_net_admin=ep) %{_bindir}/dumpcap
+%else
+%if %{setuid_dumpcap}
+# Setuid and executable by all
+%attr(4755, root, root) %{_bindir}/dumpcap
+%else
+%if %{setcap_dumpcap}
+# Setcap and executable by all
+%attr(0755, root, root) %caps(cap_net_raw,cap_net_admin=ep) %{_bindir}/dumpcap
+%else
+# Executable by all but with no special permissions
+%attr(0755, root, root) %{_bindir}/dumpcap
+%endif
+%endif
+%endif
+%endif
+
+%{_libdir}/lib*.so*
+%{_libdir}/wireshark
+%{_libdir}/pkgconfig/wireshark.pc
+# Don't pick up the wireshark (GUI) man page
+%exclude %{_mandir}/man1/wireshark.*
+%{_mandir}/man1/*
+%{_mandir}/man4/*
+%{_datadir}/wireshark
+%{_includedir}/wireshark
+%if 0%{?install_ld_so_conf}
+/etc/ld.so.conf.d/wireshark.conf
+%endif
+
+%if %{with qt5}
+%files qt
+%defattr(-,root,root)
+%{_datadir}/applications/wireshark.desktop
+%{_datadir}/appdata/wireshark.appdata.xml
+%{_datadir}/icons/hicolor/*/apps/*
+%{_datadir}/icons/hicolor/*/mimetypes/*
+%{_datadir}/mime/packages/wireshark.xml
+%{_bindir}/wireshark
+%{_mandir}/man1/wireshark.*
+%endif
+
+%changelog
+* Tue Mar 20 2018 Gerald Combs
+- Migrate from Autotools to CMake.
+- Remove Qt4, GTK+ 2, and GTK+ 3 sections.
+- Require flex, bison, and libgcrypt.
+- Optionally build with Ninja.
+
+* Sat Dec 2 2017 Jeff Morriss
+- Include the User Guide (now installed by default by autotools).
+
+* Wed Jul 26 2017 Pascal Quantin
+- Added bcg729 (as an option, defaulting to not required).
+
+* Tue Apr 4 2017 Ahmad Fatoum
+- Added libxml2 (as an option, defaulting to required).
+
+* Tue Dec 20 2016 Anders Broman
+- Add with extcap (as an option, defaulting to yes).
+
+* Mon Dec 5 2016 Jeff Morriss
+- Add spandsp (as an option, defaulting to not required).
+
+* Tue Oct 18 2016 Benoit Canet
+- Add LZ4 and snappy compression support.
+
+* Mon Aug 29 2016 Jeff Morriss
+- Add libnghttp2 (as an option, defaulting to required).
+
+* Wed Aug 17 2016 Jeff Morriss
+- wireshark.pc is now installed with Wireshark, include it in the RPM.
+
+* Mon May 9 2016 Jeff Morriss
+- Make autoconf, automake, flex, and bison optional: most users (who aren't
+ patching Wireshark) don't need them to build an RPM.
+
+* Tue Nov 10 2015 Jeff Morriss
+- Rename the gnome package to gtk: Wireshark uses Gtk+ but isn't part of GNOME.
+
+* Mon Sep 14 2015 Jeff Morriss
+- Follow ./configure's decision on whether to configure Lua or not rather than
+ forcing it to be enabled (and thus failing on some distros which don't ship
+ a compatible version of Lua any more).
+
+* Sat Sep 12 2015 Jeffrey Smith
+- Begin support for Qt5
+
+* Thu Jan 22 2015 Jeff Morriss
+- Add appdata file.
+
+* Tue Jan 20 2015 Jeff Morriss
+- Make the license tag more specific: Wireshark is GPLv2+.
+
+* Mon Jan 12 2015 Jeff Morriss
+- Modernize the (base package) %description.
+
+* Wed Dec 3 2014 Jeff Morriss
+- Don't run gtk-update-icon-cache when uninstalling the Qt package. But do run
+ it when installing the gnome package.
+- Tell the loader where to find our libraries if we're being installed
+ someplace other than /usr .
+- Attempt to get RPMs working with a prefix other than /usr (now that the
+ (free)desktop files are no longer always installed /usr). Desktop
+ integration doesn't work for prefixes other than "/usr" or "/usr/local".
+
+* Fri Aug 29 2014 Gerald Combs
+- The Qt UI is now the default. Update logic and prioritization to
+ reflect this.
+
+* Mon Aug 4 2014 Jeff Morriss
+- Fix RPM builds with a prefix other than /usr: The location of
+ update-alternatives does not depend on Wireshark's installation prefix:
+ it's always in /usr/sbin/.
+
+* Fri Aug 1 2014 Jeff Morriss
+- Remove the old wireshark binary during RPM upgrades: this is needed because
+ we now declare wireshark to be %ghost so it doesn't get overwritten during an
+ upgrade (but in older RPMs it was the real program).
+
+* Tue Jul 1 2014 Jeff Morriss
+- Get rid of rpath when we're building RPMs: Fedora prohibits it, we don't
+ need it, and it gets in the way some times.
+
+* Tue Nov 26 2013 Jeff Morriss
+- Overhaul options handling to pull in the UI choice from ./configure.
+- Make it possible to not build the GNOME package.
+
+* Tue Nov 12 2013 Jeff Morriss
+- Add a qt package using 'alternatives' to allow the administrator to choose
+ which one they actually use.
+
+* Fri Sep 20 2013 Jeff Morriss
+- If we're not using gtk3 add --with-gtk2 (since Wireshark now defaults to gtk3)
+
+* Thu Mar 28 2013 Jeff Morriss
+- Simplify check for rpmbuild's version.
+
+* Fri Mar 8 2013 Jeff Morriss
+- Put all icons in hicolor
+- Use SuSE's desktop-update macro.
+- Actually update MIME database when Wireshark's prefix is not /usr .
+
+* Thu Mar 7 2013 Jeff Morriss
+- List more build dependencies.
+- Update to work on SuSE too: some of their package names are different.
+
+* Wed Mar 6 2013 Gerald Combs
+- Enable c-ares by default
+
+* Thu Feb 7 2013 Jeff Morriss
+- Overhaul to make this file more useful/up to date. Many changes are based
+ on Fedora's .spec file. Changes include:
+ - Create a separate wireshark-gnome package (like Red Hat).
+ - Control some things with variables set at the top of the file.
+ - Allow the user to configure how dumpcap is installed.
+ - Allow the user to choose some options including GTK2 or GTK3.
+ - Greatly expand the BuildRequires entries; get the minimum versions of some
+ things from 'configure'.
+ - Install freedesktop files for better (free)desktop integration.
+
+* Thu Aug 10 2006 Joerg Mayer
+- Starting with X.org 7.x X11R6 is being phased out. Install wireshark
+ and manpage into the standard path.
+
+* Mon Aug 01 2005 Gerald Combs
+- Add a desktop file and icon for future use
+
+- Take over the role of packager
+
+- Update descriptions and source locations
+
+* Thu Oct 28 2004 Joerg Mayer
+- Add openssl requirement (heimdal and net-snmp are still automatic)
+
+* Tue Jul 20 2004 Joerg Mayer
+- Redo install and files section to actually work with normal builds
+
+* Sat Feb 07 2004 Joerg Mayer
+- in case there are shared libs: include them
+
+* Tue Aug 24 1999 Gilbert Ramirez
+- changed to ethereal.spec.in so that 'configure' can update
+ the version automatically
+
+* Tue Aug 03 1999 Gilbert Ramirez <gram@xiexie.org>
+- updated to 0.7.0 and changed gtk+ requirement
+
+* Sun Jan 03 1999 Gerald Combs <gerald@zing.org>
+- updated to 0.5.1
+
+* Fri Nov 20 1998 FastJack <fastjack@i-s-o.net>
+- updated to 0.5.0
+
+* Sun Nov 15 1998 FastJack <fastjack@i-s-o.net>
+- created .spec file
diff --git a/tools/git-export-release.sh b/tools/git-export-release.sh
index 0e851ca5e7..577e5ea2b0 100755
--- a/tools/git-export-release.sh
+++ b/tools/git-export-release.sh
@@ -10,6 +10,8 @@
#
# SPDX-License-Identifier: GPL-2.0-or-later
+set -e
+
# First paremeter, if set, is a git commit, like v1.12.0-rc1 or 54819e5699f
# By default HEAD is used.
# Note, that filtering takes place base on the _exported_ version's
@@ -17,7 +19,7 @@
# the whole tree.
COMMIT="HEAD"
if test -n "$1"; then
- COMMIT="$1"
+ COMMIT="$1"
fi
if [ ! -e "${GIT_DIR:-.git}" ] ; then