0

构建.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>

例子.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

输出:

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
4

2 回答 2

3

我也有这个问题。在我的情况下,操作系统没有安装“rpmbuild”命令,所以蚂蚁任务正在调用“rpm”,而不是像 Aaron 建议的那样。

于 2013-12-04T16:40:05.753 回答
0

虽然我不确定“-bs”选项是什么,但您可以尝试将其更改为“-bb”,这是默认选项。我自己的构建,加上我见过的一些,通常使用 -bb ( http://richardfriedman.blogspot.com/2007/02/rpm-java-and-frustration.html )

另见: http ://ant.apache.org/manual/Tasks/rpm.html

于 2013-01-29T16:40:44.077 回答