3.11. Binary packaging

Delivering binary packages makes it much easier for the end-users to install Wireshark on their target system. This section will explain how the binary packages are made.

3.11.1. Debian: .deb packages

The Debian Package is built using dpkg-buildpackage, based on information found in the source tree under debian. See http://www.debian-administration.org/articles/336 for a more in-depth discussion of the build process.

In the wireshark directory, type:

$ dpkg-buildpackage -rfakeroot -us -uc

to build the Debian Package.

3.11.2. Red Hat: .rpm packages

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 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:

  • \_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.
  • Whether or not to create the “wireshark-qt” package (-DBUILD_wireshark).
  • Lua, c-ares, nghttp2, and other library support (-DENABLE_...).
  • Building with Ninja (-G Ninja).

In your build directory, type:

$ ninja rpm-package
# ...or, if you're using GNU make...
$ make rpm-package

to build the binary and source RPMs. When it is finished there will be a message stating where the built RPM can be found.

[Tip]This might take a while

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)

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.

3.11.3. macOS: .dmg packages

The macOS Package is built using macOS packaging tools, based on information found in the source tree under packaging/macosx. It must be built using CMake. In your build directory, type:

$ make dmg_package

to build the macOS Package.

3.11.4. Win32: NSIS .exe installer

The Nullsoft Install System is a free installer generator for Windows systems. Instructions on installing it can be found in Section 4.17, “Windows: NSIS (optional)”. NSIS is script based. You can find the main Wireshark installer generation script at packaging/nsis/wireshark.nsi.

When building with CMake you must first build the nsis_package_prep target, followed by the nsis_package target, e.g.

> msbuild /m /p:Configuration=RelWithDebInfo nsis_package_prep.vcxproj
> msbuild /m /p:Configuration=RelWithDebInfo nsis_package.vcxproj

Splitting the packaging projects in this way allows for code signing.

[Tip]This might take a while

Please be patient while the package is compressed. It might take some time, even on fast machines.

If everything went well, you will now find something like: wireshark-setup-2.9.0.exe in the packaging/nsis directory in your build directory.

3.11.5. Win32: PortableApps .paf.exe package

PortableApps.com is an environment that lets users run popular applications from portable media such as flash drives and cloud drive services.

Install the PortableApps.com Platform. Install for “all users”, which will place it in C:\PortableApps. Add the following apps:

  • NSIS Portable (Unicode)
  • PortableApps.com Installer
  • PortableApps.com Launcher
  • PortableApps.com AppCompactor

When building with CMake you must first build the nsis_package_prep target (which takes care of general packaging dependencies), followed by the portableapps_package target, e.g.

> msbuild /m /p:Configuration=RelWithDebInfo nsis_package_prep.vcxproj
> msbuild /m /p:Configuration=RelWithDebInfo portableapps_package.vcxproj
[Tip]This might take a while

Please be patient while the package is compressed. It might take some time, even on fast machines.

If everything went well, you will now find something like: WiresharkPortable2.9.0.paf.exe_ in the packaging/portableapps directory.