Skip to content
This repository has been archived by the owner on Oct 1, 2024. It is now read-only.

Commit

Permalink
Merge pull request #63 from resilientplc/buildrequires
Browse files Browse the repository at this point in the history
Add support for the spec BuildRequires list of dependencies
  • Loading branch information
dantran authored Mar 15, 2017
2 parents 2259839 + 4d1c374 commit 0ae25c4
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/main/java/org/codehaus/mojo/rpm/AbstractRPMMojo.java
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,13 @@ abstract class AbstractRPMMojo
@Parameter
private LinkedHashSet<String> requires;

/**
* The list of build requirements for this package.
* @since 2.1.6
*/
@Parameter
private LinkedHashSet<String> buildRequires;

/**
* The list of requirements for running the pre-installation scriptlet.
* @since 2.1.6
Expand Down Expand Up @@ -1311,6 +1318,14 @@ final LinkedHashSet<String> getRequires()
return this.requires;
}

/**
* @return Returns the {@link #buildRequires}.
*/
final LinkedHashSet<String> getBuildRequires()
{
return this.buildRequires;
}

/**
* @return Returns the {@link #requiresPre}.
*/
Expand Down
1 change: 1 addition & 0 deletions src/main/java/org/codehaus/mojo/rpm/SpecWriter.java
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ public void writeSpecFile()

writeList( mojo.getProvides(), "Provides: " );
writeList( mojo.getRequires(), "Requires: " );
writeList( mojo.getBuildRequires(), "BuildRequires: " );
writeList( mojo.getRequiresPre(), "Requires(pre): " );
writeList( mojo.getRequiresPost(), "Requires(post): " );
writeList( mojo.getRequiresPreun(), "Requires(preun): " );
Expand Down
24 changes: 24 additions & 0 deletions src/site/apt/adv-params.apt
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,30 @@ Advanced Parameters
</conflicts>
+-----+

* RPM Build Dependency Management

<<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:

* <<<buildRequires>>> identifies a package that is required to be installed for
the package being built to build correctly; i.e. it provides some tools needed
during the building of the package, or some RPM macros that must be present
when adding the scriptlets into the RPM package.

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 &gt; 1.8</buildRequire>
</buildRequires>
+-----+

* {Relocation}

If you specify the <<<prefix/prefixes>>> parameter to the RPM plugin, you can create
Expand Down

0 comments on commit 0ae25c4

Please sign in to comment.