Huge thanks to our Platinum Members Endace and LiveAction,
and our Silver Member Veeam, for supporting the Wireshark Foundation and project.

Wireshark-dev: Re: [Wireshark-dev] RPM generation

From: Joakim Karlsson <oakimk@xxxxxxxxx>
Date: Mon, 23 Apr 2018 14:11:46 +0200
Hi,

From what I notice when trying create rpm on RHEL7, is that CMake utilize pkg-config, which is nice. But when ninja/make rpm-package is executed, that part seems to stop. Instead we rely on rpm instead.

which cmake
/app/vbuild/RHEL7-x86_64/cmake/3.7.2-1/bin/cmake

cmake -G Ninja -DENABLE_GNUTLS=OFF -DENABLE_LZ4=OFF -DENABLE_CARES=OFF ../
..

ninja rpm-package
..
Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.wOs6eR
..
+ /usr/bin/cmake -DCMAKE_C_FLAGS_RELEASE:STRING=-DNDEBUG -DCMAKE_CXX_FLAGS_RELEASE:STRING=-DNDEBUG -DCMAKE_Fortran_FLAGS_RELEASE:STRING=-DNDEBUG -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON -DCMAKE_INSTALL_PREFIX:PATH=/usr/local -DINCLUDE_INSTALL_DIR:PATH=/usr/local/include -DLIB_INSTALL_DIR:PATH=/usr/local/lib64 -DSYSCONF_INSTALL_DIR:PATH=/etc -DSHARE_INSTALL_PREFIX:PATH=/usr/local/share -DLIB_SUFFIX=64 -DBUILD_SHARED_LIBS:BOOL=ON -DBUILD_wireshark=ON -DENABLE_LUA=OFF -DBUILD_mmdbresolve=ON -DENABLE_LZ4=OFF -DENABLE_SNAPPY=OFF -DENABLE_CARES=OFF -DENABLE_SPANDSP=ON -DENABLE_BCG729=ON -DENABLE_LIBXML2=ON -DENABLE_NGHTTP2=OFF -DDISABLE_WERROR=ON -G Ninja
CMake Error: CMake was unable to find a build program corresponding to "Ninja".  CMAKE_MAKE_PROGRAM is not set.  You probably need to select a different build tool.
CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly.
Missing variable is:
CMAKE_C_COMPILER_ENV_VAR
..
and more error...


Problem is the version of CMake, not the one I wanted.
/usr/bin/cmake --version
cmake version 2.8.12.2

What I found is in package/rpm/wireshark.spec.in:
BuildRequires: cmake
..
%cmake

This part will utilize rpm instead of what CMake setup for us, same for all packages.
rpm --eval %cmake
..
  /usr/bin/cmake \
        -DCMAKE_C_FLAGS_RELEASE:STRING="-DNDEBUG" \
        -DCMAKE_CXX_FLAGS_RELEASE:STRING="-DNDEBUG" \
        -DCMAKE_Fortran_FLAGS_RELEASE:STRING="-DNDEBUG" \
        -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON \
        -DCMAKE_INSTALL_PREFIX:PATH=/usr \
        -DINCLUDE_INSTALL_DIR:PATH=/usr/include \
        -DLIB_INSTALL_DIR:PATH=/usr/lib64 \
        -DSYSCONF_INSTALL_DIR:PATH=/etc \
        -DSHARE_INSTALL_PREFIX:PATH=/usr/share \
%if "lib64" == "lib64" 
        -DLIB_SUFFIX=64 \
%endif 
        -DBUILD_SHARED_LIBS:BOOL=ON


A workaround I found was to create ~/.rpmmacros with content:
%__cmake %(which cmake)

Should we maybe have rpmmacros directly in package/rpm ?

And it doesn't seems that it respect the compile parameter check either, same problem Anders had regarding
cc: error: unrecognized command line option '-Wheader-guard'
..
I see this faults too, but haven't found a solution for it


//Joakim




On 19 April 2018 at 22:09, Peter Wu <peter@xxxxxxxxxxxxx> wrote:
Hi Anders,
On Thu, Apr 19, 2018 at 06:40:27PM +0000, Anders Broman wrote:
> Hi,
> Running cmake and make works
> Cmake and make rpm-package fails on the make rpm-package part.
> Included log from make rpm-package.

I cannot see an obvious error, is it possible that you ran out of memory
or disk space? Maybe there is something in CMakeError.log or something
related to the custom CMake includes in your project.
--
Kind regards,
Peter Wu
https://lekensteyn.nl
___________________________________________________________________________
Sent via:    Wireshark-dev mailing list <wireshark-dev@xxxxxxxxxxxxx>
Archives:    https://www.wireshark.org/lists/wireshark-dev
Unsubscribe: https://www.wireshark.org/mailman/options/wireshark-dev
             mailto:wireshark-dev-request@wireshark.org?subject=unsubscribe