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.
These parameters relate to the dependencies between RPM packages, not to the dependencies required to build the RPM package contents.
There are six RPM spec file tags related to dependency management:
All 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 > 1.0</require> </requires> <requires> <require>road</require> </requires> <requiresPre> <require>excavator</require> </requiresPre> <requiresPost> <require>bulldozer</require> </requiresPost> <requiresPreun> <require>environment-util = 2.0</require> </requiresPreun> <conflicts> <conflict>incinerator</conflict> </conflicts>
These parameters relate to the dependencies required to build the RPM package contents.
There is one RPM spec file tag related to build dependency management:
This tag can appear multiple times in the spec file. To configure this tag 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:
<buildRequires> <buildRequire>ruby > 1.8</buildRequire> </buildRequires>
If you specify the prefix/prefixes 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.
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.
Script files can be filtered by setting <filter> to true while inline scripts can be filtered together with the pom.
Here are examples of passing the content of the script in the pom (using <script>) and in a file (using <scriptFile>) and enabling filtering for preinstall.sh script:
<prepareScriptlet> <script>echo "preparing ${project.name}"</script> </prepareScriptlet> <preinstallScriptlet> <scriptFile>/src/main/bin/preinstall.sh</scriptFile> <fileEncoding>utf-8</fileEncoding> <filter>true</filter> </preinstallScriptlet>
This script specifies commands to prepare the build. It corresponds to the %prep tag in the spec file.
This script is run before the package is installed. It corresponds to the %pre tag in the spec file.
This script is run as a part of installing the package. It corresponds to the %install tag in the spec file.
This script is run after the package is installed. It corresponds to the %post tag in the spec file.
This script is run before the package is removed. It corresponds to the %preun tag in the spec file.
This script is run after the package is removed. It corresponds to the %postun tag in the spec file.
This script is run when the package is being verified. It corresponds to the %verifyScript tag in the spec file.
This script is run after the package is installed to clean up installation files. It corresponds to the %clean tag in the spec file.
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.
RPM packages may be signed using GPG or PGP. Currently the plugin only supports generating GPG signatures.
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.
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.