diff --git a/src/main/java/de/dentrassi/rpm/builder/RpmMojo.java b/src/main/java/de/dentrassi/rpm/builder/RpmMojo.java index 48df840..9e3cc79 100644 --- a/src/main/java/de/dentrassi/rpm/builder/RpmMojo.java +++ b/src/main/java/de/dentrassi/rpm/builder/RpmMojo.java @@ -208,6 +208,28 @@ public void setGenerateDefaultSourcePackage(final boolean generateDefaultSourceP this.generateDefaultSourcePackage = generateDefaultSourcePackage; } + /** + * Whether implicitly created intermediate directories should explicitly + * added to package. + *
+ * If enabled, all from entries implicitly created intermediate directories + * are added as explicit entries to package. Also the rules with file + * information are applied to these directories. + *
+ *+ * To exclude directories like {@code /usr} from being added, you have + * to add these as prefix property (see {@code prefixes}). Directories + * that match a whole prefix or a sub path of it, are not added. + *
+ */ + @Parameter(property = "rpm.generateIntermediateDirectories", defaultValue = "true") + boolean generateIntermediateDirectories = true; + + public void setGenerateIntermediateDirectories(final boolean generateIntermediateDirectories) { + this.generateIntermediateDirectories = generateIntermediateDirectories; + } + + /** * The prefix of the release if this is a snapshot build, will be suffixed * with the snapshot build id @@ -1096,7 +1118,9 @@ protected void fillPayload(final RpmBuilder builder) throws MojoFailureException } ctx.removeListener(missingDirectoryTracker); - missingDirectoryTracker.addMissingIntermediateDirectoriesToContext(ctx); + if (generateIntermediateDirectories) { + missingDirectoryTracker.addMissingIntermediateDirectoriesToContext(ctx); + } } private void customizeHeader(final RpmBuilder builder) {