Aristedes Maniatis wrote:
>> The environment is OSX and rpm is built using the scripts and
>> patches found here:
>
> http://trac.macosforge.org/projects/macports/browser/trunk/dports/
> sysutils/rpm50
>
>
> rpmbuild is called from an ant script, but I've not come across port
> (1) before so I'm not sure what that is (and you'd imagine that
> Googling for 'port' doesn't help me :-)
>
> I'll reproduce the entire SPEC for you inline. It is pretty simple,
> although I'm not sure if we are doing the right thing. It is meant
> to be a binary only rpm since we the ant script has already built
> the appropriate jars. Really it is very simple: put startup script
> in the right place, put jar in the right place and create a couple
> of folders. rpm is overkill but I thought it might be a convenient
> packaging tool. It really is quite complicated to do simple things
> though (compared to what I know well which is the FreeBSD ports/
> packaging system). But that might be my inexperience with it and
> the lack of documentation about use cases which aren't ./configure
> && make style installs.
>
> The ant target used is fairly understandable even if you haven't
> used ant much:
>
> <rpm rpmBuildCommand="/opt/local/bin/rpmbuild"
> specFile="onCourseServer.spec" topDir="${distribution.dir}/rpm"
> failOnError="true" command="-bb"/>
The problem is with how the Ant Rpm task calls rpmbuild:
http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/
ant/taskdefs/optional/Rpm.java?revision=565095&view=markup
if (topDir != null) {
toExecute.createArgument().setValue("--define");
toExecute.createArgument().setValue("_topdir" + topDir);
}
There is a space (" ") missing between the name and the value,
which causes later versions of RPM to translate all '-' to '_'.
(it now converts all dashes in the macro _names_ to underscores,
but will leave values alone - as long as they are separated OK)
So changing "_topdir" to "_topdir " above, should fix it...
--anders
Received on Wed Mar 5 17:01:05 2008