Nebula RPM plugin: symlinks absolute path wrong


(Sverre Moe) #1

I am building two RPMs with the nebula RPM plugin:
The symlinks created by the second RPM task is at wrong location

This is my first RPM task. It creates an RPM that packages the OS JavaFX native installer.
It creates a symlink from the installer without the version.

into('/opt/company/installer') {
    from(buildDir.name + '/jfx/native') {
        include '*.' + installerExt
    }

    link(projectName + "." + installerExt, installerName + "." + installerExt)
}

djviking@machine~/workspace/application> rpm -qlp build/distributions/application- linux-installer-1.0.0-SNAPSHOT20180612144550.noarch.rpm 
/opt/company/installer/application-1.0.0-SNAPSHOT20180612144421.noarch.rpm
/opt/company/installer/application.rpm

This is my second RPM task, where the symlink is placed at wrong location. This creates an RPM package of the JavaFX native JNLP.

into('/opt/company/webstart') {
    from(buildDir.name + '/jfx/jnlp') {
        include '*.jar'
        include '*.jnlp'
    }

    into('lib') {
        from(buildDir.name + '/jfx/jnlp/lib') {
            include '*.jar'
        }
    }

    from(buildDir.name + '/resources/main/deploy/webstart') {
        include '*.png'
    }

    link(projectName + ".jnlp", installerName + ".jnlp")
}

into('/srv/www/perl-lib/KSPT') {
    from(buildDir.name + '/resources/main/deploy/webstart') {
        include 'ChangeJnlp.pm'
    }
}

into('/etc/apache2/conf.d') {
   from(buildDir.name + '/resources/main/deploy/webstart') {
       include '*.conf'
   }
}

The symlink is not created under /opt/company/webstart, but under /etc/apache2/conf.d

djviking@machine:~/workspace/application> rpm -qlp build/distributions/application-linux-installer-1.0.0-SNAPSHOT20180612144550.noarch.rpm
/opt/company/webstart/application-1.0.0.jar
/opt/company/webstart/application-1.0.0.jnlp
/etc/apache2/conf.d/application.jnlp

If I comment out the apache2, it still places the symlink at wrong, albeit a new different location under the subdir lib.

djviking@machine:~/workspace/application> rpm -qlp build/distributions/application-linux-installer-1.0.0-SNAPSHOT20180612144550.noarch.rpm
/opt/company/webstart/application-1.0.0.jar
/opt/company/webstart/application-1.0.0.jnlp
/opt/company/webstart/lib/application.jnlp

It works if I enter an absolute link from/to, but I have already defined the directory into so it seems highly redundant to have to again in the link. I could however create a variable that holds this prefix location.
link('/opt/company/webstart/'+projectName + ".jnlp", '/opt/company/webstart/'+installerName + ".jnlp")