Advanced Parameters

The parameters described in this page are parameters which enable advanced RPM features. Before using these parameters, it is highly recommended that you read Maximum RPM to gain an understanding of what these parameters do.

RPM Package Dependency Management

These parameters relate to the dependencies between RPM packages, not to the dependencies required to build the RPM package contents.

There are three RPM spec file tags related to dependency management:

  • provides defines a virtual package which is provided by the package being built
  • requires identifies a package that is required to be installed for the package being built to operate correctly
  • conflicts identifies a package which must not be installed if the package being built is installed

All three of these tags can appear multiple times in the spec file. To configure these tags in the plugin configuration, specify an element for each instance of the tag in the spec file; the content of the element is the exact text to be placed in the spec file. Please be careful to ensure that version comparison specifications such as < and > are properly specified in the XML file. Here is an example:

<provides>
    <provide>dump</provide>
</provides>
<requires>
    <require>trash-truck &gt; 1.0</require>
</requires>
<conflicts>
    <conflict>incinerator</conflict>
</conflicts>

Relocation

If you specify the prefix parameter to the RPM plugin, you can create a package that can be installed in a user-specified location. Before doing this, read and understand Maximum RPM Chapter 15 since there are a number of kinks and quirks that must be addressed.

Scripts

There are a number of scripts that can be included in the RPM package which are executed as part of the installation, removal, or verification of the package.

Each of the scripts can be configured as a Scriptlet, which allows the content of the script to be provided either as a String or File. If both parameters are specified for a script, the external file will be ignored. Before writing scripts for RPM packages, understand the script docs in Maximum RPM since the operation of the scripts must be done correctly or major problems can occur while installing or removing the package.

Here are examples of passing the content of the script in the pom (using <script>) and in a file (using <scriptFile>):

<prepareScriptlet>
    <script>echo "prepare"</script>
</prepareScriptlet>
<preinstallScriptlet>
    <scriptFile>/src/main/bin/preinstall.sh</scriptFile>
    <fileEncoding>utf-8</fileEncoding>
</preinstallScriptlet>

prepareScriptlet

This script specifies commands to prepare the build. It corresponds to the %prep tag in the spec file.

preinstallScriptlet

This script is run before the package is installed. It corresponds to the %pre tag in the spec file.

installScriptlet

This script is run as a part of installing the package. It corresponds to the %install tag in the spec file.

postinstallScriptlet

This script is run after the package is installed. It corresponds to the %post tag in the spec file.

preremoveScriptlet

This script is run before the package is removed. It corresponds to the %preun tag in the spec file.

postremoveScriptlet

This script is run after the package is removed. It corresponds to the %postun tag in the spec file.

verifyScriptlet

This script is run when the package is being verified. It corresponds to the %verifyScript tag in the spec file.

cleanScriptlet

This script is run after the package is installed to clean up installation files. It corresponds to the %clean tag in the spec file.

pretransScriptlet

This script is run at the beginning of the transaction. It corresponds to the %pretrans tag in the spec file.

posttransScriptlet

This script is run at the end of the transaction. It corresponds to the %posttrans tag in the spec file.

Triggers

Triggers are scripts which can be included in an RPM package to execute based on the action of other packages in a system. Before writing triggers for RPM packages, understand the triggers in the RPM documentation since the operation of the scripts must be done correctly or major problems can occur while installing or removing other packages.

Signatures

RPM packages may be signed using GPG or PGP. Currently the plugin only supports generating GPG signatures.

keyname

This parameter sets the name of the GPG key used to sign the package, and also turns on the signature. Setting this parameter is equivalent to defining the %_gpg_name macro and adding the --sign option to rpmbuild.

keyPassphrase

This parameter sets the passphrase for the key to sign the rpm. The use of this attribute requires expect to be available on the PATH.