Wireshark-dev: Re: [Wireshark-dev] Cmake and RPM
From: Jonne Zutt <jonne.zutt.ml@xxxxxxxxx>
Date: Thu, 18 Aug 2016 17:56:31 +0200
I did not make changes to my $PATH.
Well, after verifying and searching for a while, that did happen actually, because of the qtchooser package:

$ rpm -qf /etc/profile.d/qtchooser.sh
qtchooser-39-1.fc20.x86_64

$ cat /etc/profile.d/qtchooser.sh

case ":${PATH:-}:" in
    *:/usr/lib/qtchooser:*) ;;
    *) PATH="/usr/lib/qtchooser${PATH:+:$PATH}" ;;
esac


What I did earlier to make it work for me was:
sed -i -e 's/-qt=/-qt=qt/g' configure
but I understand that's not the way to go.

Maybe I should not have installed qtchooser-39-1.fc20.x86_64?
(/usr/lib/qtchooser is a directory on my system, the executable next to it you don't seem to have)

$ whereis qtchooser
qtchooser: /usr/lib/qtchooser /usr/lib/qtchooser/qtchooser

$ ./configure --with-qt=5 --with-gtk=no
---
checking for qtchooser... /usr/lib/qtchooser/qtchooser
checking for uic... /usr/lib/qtchooser/uic
checking for qtchooser... (cached) /usr/lib/qtchooser/qtchooser
checking for moc... /usr/lib/qtchooser/moc
checking for qtchooser... (cached) /usr/lib/qtchooser/qtchooser
checking for rcc... /usr/lib/qtchooser/rcc
checking for qtchooser... (cached) /usr/lib/qtchooser/qtchooser
checking for lrelease... /usr/lib/qtchooser/lrelease
checking whether lrelease -version works... no
configure: error: /usr/lib/qtchooser/lrelease -qt=5 -version returned non-zero exit status
---

$ lrelease-qt5 -version
lrelease version 5.3.2

$ lrelease -qt=5 -version
lrelease: could not find a Qt installation of '5'

$ lrelease -qt=qt5 -version
lrelease version 5.3.2

Removing the qtchooser package seems to fix the issue I had:

checking for qtchooser... no
checking for uic-qt5... /usr/bin/uic-qt5
checking for qtchooser... no
checking for moc-qt5... /usr/bin/moc-qt5
checking for qtchooser... no
checking for rcc-qt5... /usr/bin/rcc-qt5
checking for qtchooser... no
checking for lrelease-qt5... /usr/bin/lrelease-qt5
checking whether lrelease -version works... ok, lrelease version 5.3.2

Oops, sorry about that?


On Thu, Aug 18, 2016 at 3:30 PM, João Valverde <joao.valverde@xxxxxxxxxxxxxxxxxx> wrote:
I'm not sure what you did to make configure find qtchooser in /usr/lib/qtchooser (changed your $PATH?) but this works out of the box for me on Fedora 20:

$ whereis qtchooser
qtchooser: /usr/lib/qtchooser

$ ./configure --with-qt=5 --with-gtk=no
---
configure:47210: checking for qtchooser
configure:47243: result: no
configure:47322: checking for lrelease-qt5
configure:47340: found /usr/bin/lrelease-qt5
configure:47352: result: /usr/bin/lrelease-qt5
configure:47372: checking whether lrelease -version works
configure:47382: result: ok, lrelease version 5.4.1
---

$ lrelease-qt5 -version
lrelease version 5.4.1

The "checking whether lrelease -version works" message could be make more explicit by using $LRELEASE instead.

On 08/16/2016 05:12 PM, Jonne Zutt wrote:
Thanks to Jeff's suggestion I was able to install qt5-qttools-devel
which provided me with lrelease-qt5
$ dzdo yum whatprovides /usr/bin/lrelease-qt5
qt5-qttools-devel-5.2.0-0.5.beta1.fc20.i686 : Development files for
qt5-qttools

"./configure --with-qt=5 --with-gtk=no" now ends with:
checking for qtchooser... /usr/lib/qtchooser/qtchooser
checking for uic... /usr/lib/qtchooser/uic
checking for qtchooser... (cached) /usr/lib/qtchooser/qtchooser
checking for moc... /usr/lib/qtchooser/moc
checking for qtchooser... (cached) /usr/lib/qtchooser/qtchooser
checking for rcc... /usr/lib/qtchooser/rcc
checking for qtchooser... (cached) /usr/lib/qtchooser/qtchooser
checking for lrelease... /usr/lib/qtchooser/lrelease
checking whether lrelease -version works... no
configure: error: /usr/lib/qtchooser/lrelease -qt=5 -version returned
non-zero exit status
make: *** No targets specified and no makefile found.  Stop.


Ok, so configure fails when trying "lrelease -qt=5 -version", it seems
my lrelease doesn't like the -qt=5 argument.

$ lrelease -qt=4 -version
lrelease: could not find a Qt installation of '4'
$ lrelease -qt=5 -version
lrelease: could not find a Qt installation of '5'
$ lrelease -qt=default -version
lrelease version 4.8.6

It seems to like -qt=qt5 though:

$ /usr/lib/qtchooser/lrelease -qt=qt5 -version
lrelease version 5.3.2

I changed:
                LRELEASE="$LRELEASE -qt=$qt_version"
into
                LRELEASE="$LRELEASE -qt=qt$qt_version"


Then configure seems to work:
checking for qtchooser... /usr/lib/qtchooser/qtchooser
checking for uic... /usr/lib/qtchooser/uic
checking for qtchooser... (cached) /usr/lib/qtchooser/qtchooser
checking for moc... /usr/lib/qtchooser/moc
checking for qtchooser... (cached) /usr/lib/qtchooser/qtchooser
checking for rcc... /usr/lib/qtchooser/rcc
checking for qtchooser... (cached) /usr/lib/qtchooser/qtchooser
checking for lrelease... /usr/lib/qtchooser/lrelease
checking whether lrelease -version works... ok, lrelease version 5.3.2


It seems I need to do the same for UIC:

  UIC      ui_about_dialog.h
uic: could not find a Qt installation of '5'

                UIC="$UIC -qt=qt$qt_version"

And also for MOC, RCC.

Maybe I should've changed qt_version, but anyways, I do not see a neat
way for that (e.g., cannot provide --with-qt=qt5 to configure).

Seems like I'm almost there, getting to closer to build an rpm:

Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.P9teqs
+ umask 022
+ cd /export/home/jonne/wireshark/wireshark/packaging/rpm/BUILD
+ cd /export/home/jonne/wireshark/wireshark/packaging/rpm/BUILD
+ rm -rf wireshark-2.3.0
+ /usr/bin/tar -xf -
+ /usr/bin/xz -dc
/export/home/jonne/wireshark/wireshark/packaging/rpm/SOURCES/wireshark-2.3.0.tar.xz
/usr/bin/tar: This does not look like a tar archive
/usr/bin/tar: Exiting with failure status due to previous errors
error: Bad exit status from /var/tmp/rpm-tmp.P9teqs (%prep)


RPM build errors:
    Bad exit status from /var/tmp/rpm-tmp.P9teqs (%prep)


Thanks for you help,
Jonne.



$ qtchooser -qt=5 -version
qtchooser: unknown option: -version
$ qtchooser -qt=5
Usage:
  qtchooser { -l | -list-versions | -print-env }
  qtchooser -run-tool=<tool name> [-qt=<Qt version>] [program arguments]
  <executable name> [-qt=<Qt version>] [program arguments]

Environment variables accepted:
 QTCHOOSER_RUNTOOL  name of the tool to be run (same as the -run-tool
argument)
 QT_SELECT          version of Qt to be run (same as the -qt argument)

$ qtchooser -qt=5 -l
default
qt4-64
qt4
qt5-64
qt5

On Tue, Aug 16, 2016 at 4:14 PM, João Valverde
<joao.valverde@tecnico.ulisboa.pt
<mailto:joao.valverde@tecnico.ulisboa.pt>> wrote:

    I wasn't aware of that shell script, it might need updating.

    This part of the Qt toolchain (qt-tools) is awkward, to be kind, and
    detection might not work always well.

    Feel free to ask for help here if you get stuck.

    You need lrelease to build the Qt GUI. Not sure what is going on
    with qtchooser.



    On 08/16/2016 02:41 PM, Jonne Zutt wrote:

        I see, thanks for that. I was already trying this path after
        reading the
        reply of Anders.

        I installed the rpms that were suggested
        by wireshark/tools/install_rpms_for_devel.sh

        I then also installed qtchooser-39-1.fc20.x86_64, but configure
        is still
        unable to find it somehow. I guess I need to help it a bit
        somehow, I'll
        keep trying!

        Thanks,
        Jonne.


        ....
        checking for GLIB... yes
        checking for Qt5Core - version >= 5.0.0... yes (version 5.3.2)
        checking for Qt5Gui - version >= 5.0.0... yes (version 5.3.2)
        checking for Qt5Widgets - version >= 5.0.0... yes (version 5.3.2)
        checking for Qt5PrintSupport - version >= 5.0.0... yes (version
        5.3.2)
        checking for Qt5Multimedia - version >= 5.0.0... yes (version 5.3.2)
        checking for Qt5MacExtras - version >= 5.0.0... no
        checking whether Qt works without -fPIC... no
        checking whether Qt works with -fPIC... yes
        checking for qtchooser... no
        checking for uic-qt5... /usr/bin/uic-qt5
        checking for qtchooser... no
        checking for moc-qt5... /usr/bin/moc-qt5
        checking for qtchooser... no
        checking for rcc-qt5... /usr/bin/rcc-qt5
        checking for qtchooser... no
        checking for lrelease-qt5... no
        checking for lrelease... no
        configure: error: I couldn't find lrelease-qt5 or lrelease; make
        sure
        it's installed and in your path
        make: *** No targets specified and no makefile found.  Stop.


        On Tue, Aug 16, 2016 at 1:57 PM, João Valverde
        <joao.valverde@tecnico.ulisboa.pt
        <mailto:joao.valverde@tecnico.ulisboa.pt>
        <mailto:joao.valverde@tecnico.ulisboa.pt

        <mailto:joao.valverde@tecnico.ulisboa.pt>>> wrote:



            On 08/16/2016 10:23 AM, Jonne Zutt wrote:

                Hi all,

                Could somebody tell me what I have to do to be able to
        build an
                RPM package?


            You have to use autotools. :-)

            CMake doesn't support building an rpm package yet (see
        README.cmake).

                I successfully build wireshark using cmake and make.
                I have a working wireshark-gtk executable in the build
        directory
                that I
                can run and works fine.

                Now, if I try to run "make rpm-package", it seems it doesn't
                know the
                target. I wonder what I have to do to get this?

                $ make rpm-package
                make: *** No rule to make target `rpm-package'.  Stop.

                Thanks,
                Jonne.




        ___________________________________________________________________________
                Sent via:    Wireshark-dev mailing list
                <wireshark-dev@xxxxxxxxxxxxx
        <mailto:wireshark-dev@wireshark.org>
        <mailto:wireshark-dev@wireshark.org
        <mailto:wireshark-dev@wireshark.org>>>
                Archives:
        https://www.wireshark.org/lists/wireshark-dev
        <https://www.wireshark.org/lists/wireshark-dev>
                <https://www.wireshark.org/lists/wireshark-dev
        <https://www.wireshark.org/lists/wireshark-dev>>
                Unsubscribe:
        https://wireshark.org/mailman/options/wireshark-dev
        <https://wireshark.org/mailman/options/wireshark-dev>
                <https://wireshark.org/mailman/options/wireshark-dev
        <https://wireshark.org/mailman/options/wireshark-dev>>
                             mailto:wireshark-dev-request@wireshark.org
        <mailto:wireshark-dev-request@wireshark.org>
                <mailto:wireshark-dev-request@wireshark.org
        <mailto:wireshark-dev-request@wireshark.org>>?subject=unsubscribe


        ___________________________________________________________________________
            Sent via:    Wireshark-dev mailing list
        <wireshark-dev@xxxxxxxxxxxxx <mailto:wireshark-dev@wireshark.org>
            <mailto:wireshark-dev@wireshark.org

        <mailto:wireshark-dev@wireshark.org>>>
            Archives:    https://www.wireshark.org/lists/wireshark-dev
        <https://www.wireshark.org/lists/wireshark-dev>
            <https://www.wireshark.org/lists/wireshark-dev
        <https://www.wireshark.org/lists/wireshark-dev>>
            Unsubscribe:
        https://wireshark.org/mailman/options/wireshark-dev
        <https://wireshark.org/mailman/options/wireshark-dev>
            <https://wireshark.org/mailman/options/wireshark-dev
        <https://wireshark.org/mailman/options/wireshark-dev>>
                        mailto:wireshark-dev-request@wireshark.org
        <mailto:wireshark-dev-request@wireshark.org>
            <mailto:wireshark-dev-request@wireshark.org
        <mailto:wireshark-dev-request@wireshark.org>>?subject=unsubscribe




        ___________________________________________________________________________
        Sent via:    Wireshark-dev mailing list
        <wireshark-dev@xxxxxxxxxxxxx <mailto:wireshark-dev@wireshark.org>>
        Archives:    https://www.wireshark.org/lists/wireshark-dev
        <https://www.wireshark.org/lists/wireshark-dev>
        Unsubscribe: https://wireshark.org/mailman/options/wireshark-dev
        <https://wireshark.org/mailman/options/wireshark-dev>
                     mailto:wireshark-dev-request@wireshark.org
        <mailto:wireshark-dev-request@wireshark.org>?subject=unsubscribe

    ___________________________________________________________________________
    Sent via:    Wireshark-dev mailing list <wireshark-dev@xxxxxxxxxxxxx
    <mailto:wireshark-dev@wireshark.org>>
    Archives:    https://www.wireshark.org/lists/wireshark-dev
    <https://www.wireshark.org/lists/wireshark-dev>
    Unsubscribe: https://wireshark.org/mailman/options/wireshark-dev
    <https://wireshark.org/mailman/options/wireshark-dev>
                mailto:wireshark-dev-request@wireshark.org
    <mailto:wireshark-dev-request@wireshark.org>?subject=unsubscribe




___________________________________________________________________________
Sent via:    Wireshark-dev mailing list <wireshark-dev@xxxxxxxxxxxxx>
Archives:    https://www.wireshark.org/lists/wireshark-dev
Unsubscribe: https://wireshark.org/mailman/options/wireshark-dev
             mailto:wireshark-dev-request@wireshark.org?subject=unsubscribe

___________________________________________________________________________
Sent via:    Wireshark-dev mailing list <wireshark-dev@xxxxxxxxxxxxx>
Archives:    https://www.wireshark.org/lists/wireshark-dev
Unsubscribe: https://wireshark.org/mailman/options/wireshark-dev
            mailto:wireshark-dev-request@wireshark.org?subject=unsubscribe