I need to create an RPM package from an ANT script that runs on a Windows computer. This package must contain the result classes from the build plus some other, additional
I'm not aware of any packages to do this, but that could just be my ignorance speaking.
Two suggestions:
Set up a Linux machine (separate PC or virtual machine) and kit the rpm remotely via scripts (see ssh/scp/samba). This strikes me as a safe approach that avoids full build environment migration.
A more adventurous approach would be to write your own RPM files using Java. The RPM file format seems to be a header followed by one of a number of standard archive formats. Some analysis of the archive contents would be needed, so this approach might be quite time consuming in the short term (though it would probably result in faster builds).
Checking the Ant manual, I found the following optional task:
http://ant.apache.org/manual/Tasks/rpm.html
However, this only runs with linux computers
A possible solution is to use a pure java RPM Manipulation tool, such as the one described in:
http://jrpm.sourceforge.net/rpmspec/index.html
Also consider the redline-rpm java library & ant task. https://github.com/craigwblake/redline
Freaking Package Management can do this. You should be able to run it both with JRuby and on MRI Ruby.
fpm -s dir -t rpm mydir
-- or another incantation where you provide the rpm keywords. See fpm --help
.
I don't think it is possible, runtime packages built for linux won't work on windows (we don't expect dlls and exes on linux, do we!). Cygwin faces similar challenges and they clearly state that they do it by compiling source files for windows.