Wireshark-dev: Re: [Wireshark-dev] RPM package error on Fedora-30

From: John Thacker <johnthacker@xxxxxxxxx>
Date: Fri, 5 Apr 2024 20:38:14 -0400

On Fri, Apr 5, 2024 at 8:06 PM Ben Greear <greearb@xxxxxxxxxxxxxxx> wrote:
Hello,

I cloned latest wireshark today, and tried to build an RPM package
on an fedora-30 system.

It fails with this error below..any ideas?

Fedora-36 worked as expected, and F30 could build with 'make', just not 'make wireshark_rpm'

....
-- Build files have been written to: /home/greearb/btbits/x64_btbits/3plibs/wireshark/build/packaging/rpm/BUILD/wireshark-4.3.0
+ %cmake_build
/var/tmp/rpm-tmp.IEg59q: line 87: fg: no job control
error: Bad exit status from /var/tmp/rpm-tmp.IEg59q (%build)


RPM build errors:
     Bad exit status from /var/tmp/rpm-tmp.IEg59q (%build)
make[3]: *** [CMakeFiles/wireshark_rpm.dir/build.make:78: CMakeFiles/wireshark_rpm] Error 1
make[2]: *** [CMakeFiles/Makefile2:4057: CMakeFiles/wireshark_rpm.dir/all] Error 2
make[1]: *** [CMakeFiles/Makefile2:4064: CMakeFiles/wireshark_rpm.dir/rule] Error 2
make: *** [Makefile:297: wireshark_rpm] Error 2

That error is because Fedora 30 doesn't have the %cmake_build macro (which is defined in /usr/lib/rpm/macros.d/macros.cmake in most Fedora systems).
You might be able to get it to build by tweaking the spec file template in packaging/rpm/wireshark.spec.in to be similar on what's done for earlier branches
before we dropped support for RHEL 7 (or before RHEL 8 added the %cmake_build macros - see this commit
and using one of the other macros instead (%ninja_build if you're using ninja, something else with make.

Fedora 30 has officially been EOL since 2020-05-26 ( https://docs.fedoraproject.org/en-US/releases/eol/ ) so most of the assumptions in the spec file in the last development branch are that people will be using Fedora 33 or later (which itself has been EOL for 2.5 years), even though Fedora 30 is roughly similar to RHEL 8 and thus is able to build, RHEL8 (in 8.4) gained support for the cmake macros and Fedora 30 didn't, being EOL at the time that RHEL 8.4 was released.

John Thacker