Index: AbstractRPMMojo.java =================================================================== --- AbstractRPMMojo.java (revision 10450) +++ AbstractRPMMojo.java (working copy) @@ -429,6 +429,38 @@ private File cleanScript; /** + * The pretrans script. + * + * @parameter + */ + private String pretrans; + + /** + * The location of the pretrans script. + *
+ * Beginning with release 2.0-beta-3, a File which does not exist is ignored. + *
+ * @parameter + */ + private File pretransScript; + + /** + * The posttrans script. + * + * @parameter + */ + private String posttrans; + + /** + * The location of the posttrans script. + *+ * Beginning with release 2.0-beta-3, a File which does not exist is ignored. + *
+ * @parameter + */ + private File posttransScript; + + /** * A Plexus component to copy files and directories. * * @component role="org.codehaus.plexus.archiver.Archiver" roleHint="dir" @@ -923,6 +955,14 @@ { clean = readFile( cleanScript ); } + if ( ( pretrans == null ) && ( pretransScript != null ) ) + { + pretrans = readFile( pretransScript ); + } + if ( ( posttrans == null ) && ( posttransScript != null ) ) + { + posttrans = readFile( posttransScript ); + } if ( ( changelog == null ) && ( changelogFile != null ) ) { changelog = readFile( changelogFile ); @@ -1766,6 +1806,18 @@ writer.println( "%clean" ); writer.println( clean ); } + if ( pretrans != null ) + { + writer.println(); + writer.println( "%pretrans" ); + writer.println( pretrans ); + } + if ( posttrans != null ) + { + writer.println(); + writer.println( "%posttrans" ); + writer.println( posttrans ); + } } /**