I accidentally sent this to Kern only, resending to list.

On Wed, Nov 17, 2010 at 8:07 AM, Kern Sibbald <k...@sibbald.com> wrote:
> On Wednesday 17 November 2010 05:23:33 Mikael Fridh wrote:
>> I had to make the following (pseudo-patch) to get a working mock build
>> on Centos 5:
>>
>> +%if %{fedora}
>> +# Mikael Fridh: Fixes for missing BuildRequires
>> +BuildRequires: libX11-devel, libtermcap-devel, libXext-devel
>> +%endif
>
> This is very strange, because you have added a patch that only applies to
> Fedora and not to RedHat.

I did it that way because of how the spec file handles redhat,
actually aliasing it to fedora:
%if %{_vendor} == redhat
       %define fedora 1
       %define _dist %(cat /etc/redhat-release)
%endif

> Though libtermcap-devel is needed, I doubt very much that libX11-devel or
> libXext-devel are required unless you have added some new build option.

Command line:
mock -r epel-5-x86_64 --define "build_centos5 1" --define "build_mysql
1" SRPMS/bacula-bat-5.0.3-3.src.rpm

I rebuilt the original SRPM now and looked more closely at the build
log and it seems it's the Qt stuff that needs libX11-devel:

This is from a mock build:
...
In file included from ../../include/QtGui/private/qt_x11_p.h:1,
                from painting/qcolormap_x11.cpp:52:
../../include/QtGui/private/../../../src/gui/kernel/qt_x11_p.h:71:22:
error: X11/Xlib.h: No such file or directory
...

BuildRequires: qt4-devel seems to also do the trick, it pulls in some
X*-devel dependencies.

Here's what I did for now:
%if %{_vendor} == redhat
       %define fedora 1
       %define _dist %(cat /etc/redhat-release)
       %define _dist_name %(awk '{ print $1 }' /etc/redhat-release)
       %if %{_dist_name} == CentOS
               %define centos 1
       %endif
%endif

...

%if %{centos}
BuildRequires: libX11-devel, libtermcap-devel, libSM-devel
%if ! %{staticqt}
BuildRequires: qt4-devel >= 4.3, libtermcap-devel, libX11-devel, libSM-devel
%endif
%endif

Of course, I haven't tried the resulting package yet, but atleast it compiles.
Will get back to you with results once I tested it some.

--
Mikael Fridh

------------------------------------------------------------------------------
Beautiful is writing same markup. Internet Explorer 9 supports
standards for HTML5, CSS3, SVG 1.1,  ECMAScript5, and DOM L2 & L3.
Spend less time writing and  rewriting code and more time creating great
experiences on the web. Be a part of the beta today
http://p.sf.net/sfu/msIE9-sfdev2dev
_______________________________________________
Bacula-devel mailing list
Bacula-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-devel

Reply via email to