Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Create RPM package from ANT script under Windows

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 resources.

I guess there should be some program somewhere that can be invoked from the command line to create this package.

The reason why I want to do this under windows is that we have a script that builds installers for several different platforms, and everything is already configured for windows so I want to avoid the pain of migrating everything to linux.

Do you know how could this be achieved?

EDIT: I've used a separate Linux machine to do this. I copy all files using the scp task, then execute the rpm command remotely using the ssh task. If this task returns a success code, I copy the resulting rpm back with scp.

like image 936
Mario Ortegón Avatar asked Jan 16 '09 10:01

Mario Ortegón


People also ask

How do you create a binary RPM from a source RPM?

Rebuild the SRPM in One Step The quickest way to rebuild the SRPM is to use the rpmbuild --rebuild ... command. This command will unpack the SRPM file into the specfile and the source files, and then it will build the RPM from the instructions on the specfile.

What is RPM script?

RPM spec files have several sections which allow packages to run code on installation and removal. These bits of code are called scriptlets and are mostly used to update the running system with information from the package.


2 Answers

Also consider the redline-rpm java library & ant task. https://github.com/craigwblake/redline

like image 195
adamlounds Avatar answered Sep 25 '22 11:09

adamlounds


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

like image 30
Mario Ortegón Avatar answered Sep 25 '22 11:09

Mario Ortegón