gradle-ospackage-plugin
gradle-ospackage-plugin copied to clipboard
Exclude parent directory of base "into" statement from spec file
Hi,
I am creating my application rpm with this plugin version 2.2.3. Here is how I am applying this plugin:
`
version = version.substring(0, version.indexOf('-'))
preInstall = file('deploy/preInstall.sh')
postInstall = file('deploy/postInstall.sh')
preUninstall = file('deploy/preUninstall.sh')
postUninstall = file('deploy/postUninstall.sh')
requires('jdk', '1.8.0_25', GREATER | EQUAL)
into '/usr/local/share/myapp'
from(jar.outputs.files) {
into 'lib'
}
from(configurations.runtime) {
exclude '**/*.yml', '*.yml', '**/*.properties', '*.properties', '*.xml', '**/*.xml', 'jmxremote.*', '*.xsd', '**/*.xsd'
into 'lib'
}
from(configurations.runtime) {
include '**/*.yml', '*.yml', '**/*.properties', '*.properties', '*.xml', '**/*.xml', 'jmxremote.*', '*.xsd', '**/*.xsd'
into 'conf'
}
`
When I build RPM and extract it to see the files its modifying, it also lists "/usr/local/share". How can I exclude "/usr/local/share" from list of files in spec?
The reason I want to remove "/usr/local/share" from the list is because centos 7 is causing issues with it:
file /usr/local/share from install of myapp-0:2.3.0-20180726073010.09097b4.noarch conflicts with file from package filesystem-3.2-25.el7.x86_64
I essentially have the same question but for /home--how do I exclude buildRpm from trying to package /home?
I've got the same problem and it's quite a big issue for me. Is there any workaround?
I found a solution! With the following options, the parent directories are not created anymore and there won't be any conflicts anymore:
addParentDirs false
createDirectoryEntry false
Possibly related to #59
@awallat I was unable to get this to work for us. hoping you can shed some more light on your success.
what version of ospackage are you using?
were you using an ospackage
or buildrpm
block?
was the into
a top level item or was it inside a from
?
@bmagistro I used version 7.0.3 of "nebula.rpm" plugin. For me the most important option to set was "addParentDirs". I don't know if later versions of this plugin behave differently.
The task looks something likes this:
task buildRpm(type: Rpm) {
release '1'
arch 'noarch'
os LINUX
addParentDirs false
...
from('server/build') {
createDirectoryEntry true
into '/opt/someDirectory'
}
...
}
I didn't have success with this but did have some luck with https://github.com/nebula-plugins/gradle-ospackage-plugin/issues/59#issuecomment-59349084 but also found https://github.com/nebula-plugins/gradle-ospackage-plugin/issues/246#issuecomment-396619852 and settled on that approach.