Re: error: Macro % has illegal name (%define) ?

Patrick <[email protected]>
Newsgroups gmane.linux.redhat.rpm.general
Message-ID <[email protected]>
Hi Marius,

On Thu, 2007-10-25 at 14:09 +0300, Marius Feraru wrote:
[snip]
> > error: Macro % has illegal name (%define)
> 
> Not really a RPM issue, but a bash one (and a quite reiterated one on bash
> "forums", I may say). Let's rewrite your script:

Thanks for the tip. Clearly I used the wrong search terms on Google.

> #!/bin/bash
> cd ~/redhat/SPECS
> 
> # avoid word splitting on "space"
> IFS=$'\n'

Found this one in my Bash book. Will read up on it.

> # skip quotes, as popt (obviously) won't "dequote" arguments

Found docs about popt. More reading to do.

> BUILDOPTS_libsupertone='--define _smp_mflags -j1'
> 
> rpmbuild -ba --target=i386 libsupertone.spec ${BUILDOPTS_libsupertone}
> 
> # EOF
> 
> In the future, when you have bash troubles, try the "easy" debug way:
> add "-x" to the shellbang (i.e.: #!/bin/bash -x). It usually helps :)
> Try it on your script, you'll see how bash expands your variables.

Excellent suggestion. All makes sense now and the snippet works.
Many thanks for your help!

Regards,
Patrick
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.