Xvcl Manual; Xvcl Getting Started; [ Cjos Audience]
XVCL Manual: Writing with XVCL
Chapter 1: Getting Started
Section 1D - RPM Specification File
Summary
Generate a project.spec file with XVCL. In this section, we reconstruct a simple RPM x-framework from the CjOS Project.
CVS Module: eclipse/release-1.0-34
SPC Location: eclipse/release-1.0-34/module/source
Release-1.0-34 is an Eclipse 3.1 project. Its x-framework provides a way to generate
- project.spec file with project and subprojects,
- Java properties, and
- Apache Ant scripts (build.xml).
RPM specification file
The following RPM specification file is generated by rpm-projectspec, an x-frame.
----- project.spec -----
Summary: CjOS Demo
%description
Distribution of cjos-demo.jar.
x-frame: rpm-projectspec
The uniform resource location (URL) for rpm-projectspec is x-resource:/release-1.0-34/xvcl/rpm-projectspec.xvcl.
----- rpm-projectspec.xvcl -----
http://cjos.cvs.sourceforge.net/cjos/eclipse/release-1.0-34/xvcl/rpm-projectspec.xvcl?view=markup
Example: distribution.xml
The following XML document contains information about one or more products.
----- distribution.xml -----
<model>
<product
name="cjos-demo"
summary="CjOS Demo"
description="Distribution of cjos-demo.jar.">
<dir name="eclipse/demo-eclipse/src">
<include name="**"/>
</dir>
</project>
<model>
Target: xvcl
In an Apache Ant script, the following target invokes the XVCL Processor.
----- build.xml -----
<target name="xvcl" depends="taskdef">
<property name="xml" location="distribution.xml"/>
<xvcl spec="spc.xvcl" projectPath="." failonerror="true">
<set var="xml" value="${xml}"/>
</xvcl>
</target>
x-frame: spc.xvcl
----- spc.xvcl -----
<x-frame name="spc" outdir="build" outfile="spc.txt">
<adapt x-frame="x-resource:/release-1.0-34/spc"/>
</x-frame>
Project
The product-name property is the name of the source RPM.
<set var="product-name" value="cjos-demo"/>
<set var="product-summary" value="CjOS Demo"/>
<set var="product-description" value="Distribution of cjos-demo.jar."/>
Conclusion
For many projects, it is neither necessary nor advantageous to write an RPM specification file by hand. It is not necessary because Cjos Library Future is a free-license and open-source project. It is not advantageous because a Java programmer no longer needs RPM-specific skills to build an RPM.
|