Open milgner opened 3 months ago
configurationFiles
was added as Debian specific extension, because has a separate conffiles
file and no concept of file directives, but for convenience fileType = CONFIG
works.
fileType
is all you should need, as covered by https://github.com/nebula-plugins/gradle-ospackage-plugin/wiki/RPM-Plugin#example. The directive is looked up on each copy spec:
The comment on https://github.com/nebula-plugins/gradle-ospackage-plugin/blob/main/src/main/groovy/com/netflix/gradle/plugins/packaging/CopySpecEnhancement.groovy#L16-L28 seems to indicate that either syntax should work fine.
That is very strange. I have tried a few more approaches, but the RPM file never lists the file(s) as config files. My latest approach is
from("src/main/resources") {
into("/etc/rebased/conf")
eachFile {
fileType = Directive(RPMFILE_CONFIG or RPMFILE_NOREPLACE)
}
}
I'm checking with rpm -q --configfiles my.rpm
and would expect the file to show up there, too.
At a glance, you'll want to drop the eachFile
there, fileType
is something we add on the FileCopySpec
and it applies to everything in the from
.
That was my very first approach. When that didn't work, I tried all kinds of variations, without success.
After reading #56 and #118, it seems like the issue was fixed for DEB packages but is still not working for RPMs.
After some experimentation, my Gradle build script now contains:
I have also tried just setting one
configurationFile
and leaving out theRPMFILE_NOREPLACE
flag or thefileType
altogether.But the resulting
.rpm
file doesn't have any information - about neither the config flag nor thenoreplace
. The file itself is included as expected, though.Furthermore, a code search on Github did not turn up any reference to the
configurationFiles
attribute as part of therpm
packaging plugin.