tags:

views:

45

answers:

2

Is there an implementation of the rpmbuild that is written in Java?

Alas, the build server is running on Windows and yet the build process for a particular Java-based application needs to generate an rpm via which to be able to install it on RedHat Linux servers.

The build server (Hudson) needs to stay on Windows OS as it also runs msbuild to build various C# .NET solution projects.

+2  A: 

Have a look at redline-rpm, a pure Java RPM Library that provides an Ant task:

Redline is a pure Java library for manipulating RPM Package Manager packages. Currently the project supports reading and creating packages and has an included Ant task useful for integration with build systems.

Pascal Thivent
We've used this before - it works, minimal amount of code required to replace rpm commands. You may also consider just using maven with the assembly plugin, depends what you're using rpm for.
Jon Freedman
Unfortunately the redline-rpm tool is not plug compatible with the rpmbuild tool in that it will not accept a rpmbuild spec file. The info supplied in a spec file needs to be set as attributes on the redline-rpm ant task and any script file actions need to be broken up into discreet script files.
RogerV
A: 

How about if you make a Hudson node on linux? The Windows Hudson server will cheerfully farm out the RPM build to the Linux node (if you tag the build properly or bind it to the agent).

Or, you could do the opposite and run a Linux Hudson server and then a Windows node. One day we'll work out how to roll out Windows nodes over EC2 and then we'll be able to fire up a Windows node for the duration of the build.

Julian Simpson