Our project is build for different distributions.
Now Centos and Redhat should be added.
openSUSE/SLE/Mandriva/Debian/Ubuntu/Fedora are already building successfully.
Our project is based on Qt and uses qmake for generating the Makefiles.
It seems that our SPEC file must be adjusted.
I tried:
##################################
<snip>
%if 0%{?fedora_version}
For Fedora everything is ok.
But redhat fails.
Centos only builds for i586 architecture.
On the failing distributions qmake is not found.
Questions:
What are the right %if lines ? Are they called different ? I tried:
%if 0%{?redhat_version}
%if 0%{?centos_version}
What are the right package names on redhat and centos ?
Is this ok and sufficient ? Is qmake in an additional package ?
Requires: qt4
What is the correct path for qmake on redhat and centos.
Our project will find qmake if it is in one of the following directories.
#!/bin/bash
################################
stuff to call qmake on different distributions
################################
if -x /usr/bin/qmake-qt4 ]; then
/usr/bin/qmake-qt4 $1 $2 $3 $4 $5 $6 $7 $8
exit
fi
if -x /usr/lib/qt4/bin/qmake-qt4 ]; then
/usr/lib/qt4/bin/qmake-qt4 $1 $2 $3 $4 $5 $6 $7 $8
exit
fi
if -x /usr/lib/qt4/bin/qmake ]; then
/usr/lib/qt4/bin/qmake $1 $2 $3 $4 $5 $6 $7 $8
exit
fi
qmake $1 $2 $3 $4 $5 $6 $7 $8
If you are using that qmake installation path detection script you probably have the /usr/lib vs /usr/lib64 problem.
But again, I would be very surprised if qmake/qmake-qt4 isn’t available in /usr/bin (or some other path available in the $PATH). Perhaps it’s just a symlink to /usr/lib/qt4/bin/qmake-qt4, but it’s very hard for me to believe that it’s just available in a path not in $PATH.
I’m shure qmake is on different places on different distributinons and sometimes is not in $PATH.
This has been the reason for my “qmake detection script”.
I think a path to lib64 must be added because i586 on centos and redhat work and x86_64 fails.
Thus my final “qmake detection script” will look as follows
#!/bin/bash
################################
stuff to call qmake on different distributions
################################
if -x /usr/bin/qmake-qt4 ]; then
/usr/bin/qmake-qt4 $1 $2 $3 $4 $5 $6 $7 $8
exit
fi
if -x /usr/lib/qt4/bin/qmake-qt4 ]; then
/usr/lib/qt4/bin/qmake-qt4 $1 $2 $3 $4 $5 $6 $7 $8
exit
fi
if -x /usr/lib/qt4/bin/qmake ]; then
/usr/lib/qt4/bin/qmake $1 $2 $3 $4 $5 $6 $7 $8
exit
fi
added the following lines for rhel and centos x86_64
if -x /usr/lib64/qt4/bin/qmake-qt4 ]; then
/usr/lib64/qt4/bin/qmake-qt4 $1 $2 $3 $4 $5 $6 $7 $8
exit
fi
if -x /usr/lib64/qt4/bin/qmake ]; then
/usr/lib64/qt4/bin/qmake $1 $2 $3 $4 $5 $6 $7 $8
exit
fi
qmake $1 $2 $3 $4 $5 $6 $7 $8
As can be seen from the above script qmake will be found if it is in $PATH
But qmake will also be found if it is in the special path locations of some distributions.
At the moment i do not want to upload a new tarball (the detection script is in there) in order to fix the rhel/centos problem with x86_64.
This will be delayed up to our next release.
PS: Thanks for your advise.
rhel_version helped to solve half of my problems.
I hope the above extension to the “qmake detection script” will solve the remaining problem.