Firefox 3.6 end of life and options for CentOS/YDL

General discussion Forum. All YDL related question which are not Install or Beginner questions.

Re: Firefox 3.6 end of life and options for CentOS/YDL

Postby billb » 26 Jul 2012, 02:51

The xulrunner rpm built OK but I had to modify the spec and force it to apply some patches.

Wherever this appears I get a syntax error:

Code: Select all
%if !(0%{?rhel} > 5)


If I remove the parenthesis, the syntax error goes away:

Code: Select all
%if ! 0%{?rhel} > 5


But the condition isn't met as I think it should be -- we've set rhel to = 5, and since I think the above statement says if rhel is NOT > 5, the following instructions should be applied. Err.. right? Having trouble finding documentation on the use of ! in control syntax for spec files.
PS3 60GB [CECHA01], FW 3.15, YDL 6.2, Samsung T260HD @ 1920x1200
Powermac G4 1.25 GHz x2, 2 GB RAM, YDL 6.2
User avatar
billb
Site Admin
Site Admin
 
Posts: 5522
Joined: 24 May 2007, 20:30
Location: Eastern NC, USA

Re: Firefox 3.6 end of life and options for CentOS/YDL

Postby ppietro » 26 Jul 2012, 18:57

billb wrote:The xulrunner rpm built OK but I had to modify the spec and force it to apply some patches.

Wherever this appears I get a syntax error:

Code: Select all
%if !(0%{?rhel} > 5)


If I remove the parenthesis, the syntax error goes away:

Code: Select all
%if ! 0%{?rhel} > 5


But the condition isn't met as I think it should be -- we've set rhel to = 5, and since I think the above statement says if rhel is NOT > 5, the following instructions should be applied. Err.. right? Having trouble finding documentation on the use of ! in control syntax for spec files.


Hi billb,

Thanks for looking at this. It seems like the PowerPC version of YDL sure doesn't like those parenthesis. :D I'll have to check the logic in YDL for CUDA.

Anyway - here's the logic as I understand it.

First - we define rhel as 5

Then, we execute this
Code: Select all
%if !(0%{?rhel} > 5)


(Logic reference here: http://fedoraproject.org/wiki/How_to_cr ... PM_package )

So - working from the inside, the 0%{?rhel} evaluates as 5.

Logic notes: The ? causes the macro to evaluate to blank if %rhel is undefined. [The 0% would then cause] the end result to be the 0 (which is a number and thus fine), while not interfering with the result if there is actually a value for %rhel.

So - for our case, this is still 5.

Next we look at the logic 5 > 5 inside the parenthesis. This isn't true, so this returns a false.

Next, we use the ! character - which means NOT. So not false evaluates to true.

So - overall - the if expression with rhel defined as 5 should execute. Which is a long way of saying "Yes" to your question above.

NOTE: what this statement really does is: if the build is not RHEL 6, execute the if expression. This is different than if the build is RHEL 5, execute the expression.

Seems convoluted, doesn't it?

Cheers,
Paul
User avatar
ppietro
Site Admin
Site Admin
 
Posts: 4965
Joined: 13 Sep 2007, 22:18

Re: Firefox 3.6 end of life and options for CentOS/YDL

Postby billb » 26 Jul 2012, 19:09

ppietro wrote:Seems convoluted, doesn't it?


Yes :wink:

I may just stick with modifying the spec to force the patches to be applied. Something in one of the python-related patches is what fixes the python dependency problem I mentioned earlier.
PS3 60GB [CECHA01], FW 3.15, YDL 6.2, Samsung T260HD @ 1920x1200
Powermac G4 1.25 GHz x2, 2 GB RAM, YDL 6.2
User avatar
billb
Site Admin
Site Admin
 
Posts: 5522
Joined: 24 May 2007, 20:30
Location: Eastern NC, USA

Re: Firefox 3.6 end of life and options for CentOS/YDL

Postby ppietro » 09 Aug 2012, 04:02

As a follow-up to this, on YDL for CUDA, I added the following debug code to xulrunner.spec in the python patch section:

Code: Select all
# RHEL5 patches
%if !(0%{?rhel} > 5)
%patch200 -p1 -b .python
%patch201 -p1 -b .729632

echo I got here!


Now - if the parenthesis causes an error, it should die. When do I an rpmbuild -ba xulrunner.spec I get this:

Code: Select all
+ echo 'Patch #200 (mozilla-python.patch):'
Patch #200 (mozilla-python.patch):
+ patch -p1 -b --suffix .python -s
+ echo 'Patch #201 (rhbz-729632.patch):'
Patch #201 (rhbz-729632.patch):
+ patch -p1 -b --suffix .729632 -s
+ echo I got 'here!'
I got here!


You can see that it executed the logic correctly and added the two patches. So - YDL for CUDA seems to understand it. That doesn't mean that YDL does - I'm off to fire up the PS3 and give it a try.

Cheers,
Paul
User avatar
ppietro
Site Admin
Site Admin
 
Posts: 4965
Joined: 13 Sep 2007, 22:18

Re: Firefox 3.6 end of life and options for CentOS/YDL

Postby ppietro » 09 Aug 2012, 05:17

Hi everyone,

Okay - adding the same debug info to the xulrunner.spec on my PS3:

Code: Select all
# RHEL5 patches
%if !(0%{?rhel} > 5)
%patch200 -p1 -b .python
%patch201 -p1 -b .729632

echo I got here!


I kicked off a build in YDL - and it failed immediately. Here's the section:

Code: Select all
[ppietro@localhost SPECS]$ setarch ppc rpmbuild -ba --ppc xulrunner.spec
Building target platforms: ppc
Building for target ppc
error: syntax error in expression
error: /home/ppietro/rpm/SPECS/xulrunner.spec:258: parseExpressionBoolean returns -1
Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.14152


Looking in xulrunner.spec, line 258 is: %if !(0%{?rhel} > 5)

Just as you said, billb - it failed. Also - it skipped right over the patches, which indicates it bypassed the logic due to the syntax error.

So - I think we have different RPM systems on YDL and YDL for CUDA. Just for grins, here's what's installed in YDL (NOTE: I'm still using YDL 6.1):

Code: Select all
[ppietro@localhost SPECS]$ rpm -qa|grep rpm
rpm-4.4.2-48.ydl6.1
rpm-python-4.4.2-48.ydl6.1
yellowdog-rpm-config-8.0.45-17.ydl.4
rpm-build-4.4.2-48.ydl6.1
rpm-libs-4.4.2-48.ydl6.1
rpm-devel-4.4.2-48.ydl6.1


and here's the YDL for CUDA versions:

Code: Select all
[paulp@localhost ~]$ rpm -qa|grep rpm
rpm-devel-4.4.2.3-20.el5_5.1
redhat-rpm-config-8.0.45-32.el5.centos
rpm-4.4.2.3-20.el5_5.1
rpm-build-4.4.2.3-20.el5_5.1
rpm-python-4.4.2.3-20.el5_5.1
rpm-libs-4.4.2.3-20.el5_5.1


So - yes - different build systems. It appears that my elegant solution for YDL for CUDA won't work on YDL. Next time, billb, I'll edit the spec files to manually perform the logic.

Cheers,
Paul
User avatar
ppietro
Site Admin
Site Admin
 
Posts: 4965
Joined: 13 Sep 2007, 22:18

Re: Firefox 3.6 end of life and options for CentOS/YDL

Postby ppietro » 09 Aug 2012, 06:39

Final notes: Okay - I looked for each of these in xulrunner.spec:

Code: Select all
%if !(0%{?rhel} > 5)


and changed them to this:

Code: Select all
%if 0%{?rhel} < 6


and - it worked as expected:

Code: Select all
+ echo 'Patch #200 (mozilla-python.patch):'
Patch #200 (mozilla-python.patch):
+ patch -p1 -b --suffix .python -s
+ echo 'Patch #201 (rhbz-729632.patch):'
Patch #201 (rhbz-729632.patch):
+ patch -p1 -b --suffix .729632 -s
+ echo I got 'here!'
I got here!


The good news is that this should work in YDL for CUDA too. So - next time, billb, when I build for YDL for CUDA, I will edit accordingly so that you won't have to do any editing of the spec file for PPC.

So - for those keeping score at home - we do three things to the spec files:

1. Define rhel = 5

Code: Select all
# To build on YDL
%define rhel              5


2. Set webm = 1

Code: Select all
# Enable webm
%define enable_webm       1


3. Lastly, change each instance of

Code: Select all
%if !(0%{?rhel} > 5)


to this:

Code: Select all
%if 0%{?rhel} < 6


Cheers,
Paul
User avatar
ppietro
Site Admin
Site Admin
 
Posts: 4965
Joined: 13 Sep 2007, 22:18

Previous

Return to General

Who is online

Users browsing this forum: No registered users and 3 guests