Usage
There are several tools provided by the Redline package which are useful when working with RPM files. This includes a scanner for examining existing RPM files, a programmatic interface for generating RPM packages, and an Ant task that can be imported and invoked from build scripts in order to package deployment files.
Scanner
The scanner tool can be invoked from the command line using the main class org.freecompany.redline.Scanner . From the command line this class accepts as it's single argument a path to a valid RPM file. If the file specified by the providing path does not exist, or if the file in not a valid RPM archive an exception will be thrown. And example of invoking the scanner follows:
Builder
The builder is the main entry point for constructing RPM files programmatically. The tool is used by constructing an instance of the org.freecompany.redline.Builder class and adding files and headers to the archive. When the builder is configured a final call will generate the RPM file to a given java.nio.channels.FileChannel.
Ant
Redline can be used to package projects that use the Ant build system. Included in the source and binary distributions is an Ant task that can be used within an Ant build script to construct an RPM distributable. The task can be defined using the antlib namespace convention by binding the namespace antlib:org.freecompany.redline.ant and using the namespace prefix to reference the rpm task type. An example of using the build in Ant task follows:
<project name='test' default='rpm' xmlns:redline='antlib:org.freecompany.redline.ant'>
<target name='rpm'>
<mkdir dir='rpms'/>
<redline:rpm group='Java Development' name='test' version='1.2.3' destination='rpms'>
<zipfileset prefix='/usr/share/java' file='test-1.2.3.jar'/>
<link path='/usr/share/java/test.jar' target='/usr/share/java/test-1.2.3.jar'/>
<depends name='test-lib' version='1.2.3'/>
</redline:rpm>
</target>
</project>