← Back to team overview

holland-discuss team mailing list archive

Re: Minor RPM spec issue on RHEL/CentOS 4

 


On Dec 14, 2010, at 2:55 AM, Andrew Garner wrote:

> This is for BJ mostly:
> 
> $ mock -r epel-4-x86_64 holland-1.0.5-1.fc14.src.rpm
> ...
> ERROR: Exception(holland-1.0.5-1.fc14.src.rpm) Config(epel-4-x86_64) 1
> minutes 50 seconds
> INFO: Results and/or logs in: /var/lib/mock/epel-4-x86_64/result
> 
> 
> /var/lib/mock/epel-4-x86_64/result/build.log:
> ...
> error: syntax error in expression
> error: /builddir/build/SPECS/holland.spec:1: parseExpressionBoolean returns -1
> 
> 
> This is, of course, due to the following conditional expression not
> working in older versions:
> 
> %if !(0%{?fedora} > 12 || 0%{?rhel} > 5)
> %{!?python_sitelib: %global python_sitelib %(%{__python} -c "from
> distutils.sysconfig import get_python_lib; print(get_python_lib())")}
> %{!?python_sitearch: %global python_sitearch %(%{__python} -c "from
> distutils.sysconfig import get_python_lib; print(get_python_lib(1))")}
> %endif
> 
> The conditional isn't strictly required for functionality, but I
> understand that it is standard practice.
> 
> We still support rhel4, so I'd like this to work from at least our
> build_rpms script.  What's the best way to work around this?
> 

Yeah, I saw this when packaging for Fedora/EPEL.  Just hadn't had a chance to decide how best to resolve it.  The reason the condition is there around "fedora < 12" and "rhel < 5" is because in newer versions those macros are already setup by default.  This was done per the FPG, however since we are also targeting EL4 from the same spec... I think it would be ok to simply remove the condition check... and simply set the macros regardless:

%{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")}
%{!?python_sitearch: %global python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))")}


I just did a test build on epel-4-x86_64 and fedora-14-x86_64 and all is good.  I'll update that in holland master.

Thanks Andy.

---
derks





References