SCIENTIFIC-LINUX-DEVEL Archives

October 2012

SCIENTIFIC-LINUX-DEVEL@LISTSERV.FNAL.GOV

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Steven Haigh <[log in to unmask]>
Reply To:
Steven Haigh <[log in to unmask]>
Date:
Sat, 13 Oct 2012 23:52:09 +1100
Content-Type:
multipart/signed
Parts/Attachments:
text/plain (1246 bytes) , smime.p7s (4 kB)
Hi all,

I'm trying to make my kernel-xen package for EL6 also be buildable on 
EL5. One of the things that EL5 doesn't have is dracut - hence the 
--dracut option in new-kernel-pkg doesn't exist.

I figured I could do some basic logic here in the %post and check the 
rhel version and run the appropriate command. The code:

if [ -x /sbin/new-kernel-pkg ]
then
%if 0%{?rhel} == 5
         /sbin/new-kernel-pkg --package kernel --mkinitrd --depmod 
--install %{KRELEASE} || exit $?
%endif
%if 0%{?rhel} == 6
         /sbin/new-kernel-pkg --package kernel --mkinitrd --dracut 
--depmod --install %{KRELEASE} || exit $?
%endif
fi

When I install the package however, I get:
/var/tmp/rpm-tmp.89138: line 13: syntax error near unexpected token `fi'
/var/tmp/rpm-tmp.89138: line 13: `fi'
error: %post(kernel-xen-3.5.4-4.x86_64) scriptlet failed, exit status 2

It just so happens that line 13 of %post is: %if 0%{?rhel} == 5

Does anyone have any insight on this? My google-foo has been failing 
badly on this :(

While I apologise that this isn't specifically related to SL, it is 
about creation of packages for SL6 and (eventually) SL5.

-- 
Steven Haigh

Email: [log in to unmask]
Web: http://www.crc.id.au
Phone: (03) 9001 6090 - 0412 935 897
Fax: (03) 8338 0299



ATOM RSS1 RSS2