How to use the directory construct in gradle-ospackage-plugin?

Hi all, I’m using the gradle-ospackage-plugin provided by Netflix (

I want my RPM to create a few empty directory when installed. In an oldfashioned rpm spec I would have done this:

%dir /var/opt/myapp/data

I tried using this:

ospackage {

packageName = ‘foo’


buildRpm {

directory(’/var/opt/myapp/data’, 640)


And “gradlew buildRpm” does its job fine. When calling 'rpm -q -filesbypkg -p ', I get this, seemingly correct, output:



But, when installing, it fails:

[vagrant@guest1 share]$ sudo rpm -i foo-0.0.1.noarch.rpm

error: unpacking of archive failed on file ./var/opt/myapp/data: cpio: Archive file not in header

I don’t see:

  1. Why it tries to install the directory in “.” rather than the root, and

  2. Why even that fails.

Any hints would be most welcome since the file is not very forthcoming on the issue of directories.

You’re better off asking the authors of Nebula pluigins - lists!forum/nebula-plugins as the place where questions can be posted.

Thanks! I already tried asking as an Issue on their github page, but got no answer. I was hoping someone else on here had tried that plugin. I will try the Google Group instead.