0

build.xml

<?xml version="1.0"?>
<project default="main" basedir=".">
<echo message="pulling in property files" />
<property file="axis_bujava.properties" />

<echo message="calling the RPM Build Ant" />
<target name="main">
    <rpm specfile="example.spec" topdir="${basedir}" command="-bs" />
</target>
</project>

example.spec

Summary: xxx

Name: cdplayer

Version: 1.0

Release: 1

Copyright: xxx

Group: Applications/Sound

Source: xxx.tgz

URL: http://xxx.html

Distribution: xxxx

Vendor:xxx.

Packager: xxx

%description
xxxx
%build
make
%install
make install

output:

Buildfile: /home/user1/workspace/antdemo/build.xml
     [echo] pulling in property files

     [echo] calling the RPM Build Ant

main:

      [rpm] Building the RPM based on the example.spec file

      [rpm] -bs: unknown option

      [rpm] 'rpm' failed with exit code 1

BUILD SUCCESSFUL

Total time: 848 milliseconds
martin clayton
  • 76,436
  • 32
  • 213
  • 198
meet patel
  • 181
  • 1
  • 2
  • 17

2 Answers2

3

I had this issue too. In my case the OS did not have the 'rpmbuild' command installed, so the ant task was calling 'rpm' instead as Aaron suggested.

RJC
  • 375
  • 4
  • 11
0

While I'm not sure what "-bs" option is, you might try changing it to "-bb", which is the default. My own builds, plus a few I've seen, usually use -bb (http://richardfriedman.blogspot.com/2007/02/rpm-java-and-frustration.html)

Also see: http://ant.apache.org/manual/Tasks/rpm.html

ehfeng
  • 3,807
  • 4
  • 33
  • 42