debian/dirs support - Create empty directories

946 views
Skip to first unread message

Dominic Lüchinger

unread,
May 16, 2013, 5:52:09 AM5/16/13
to fpm-...@googlegroups.com
Dear Mailinglist

Sometimes it's useful to define empty directories, that are created during the package installation.
Debian supports this with a 'dirs' file under 'debian' folder.
The nginx package for example uses this. (Note: This is a per package definition of directories. 'debian/<packagename>-dirs')

Does someone know, that the fpm argument "--directories" (DIRECTORIES     Mark a directory as being owned by the package) is doing internally for the debian packages.
I thought it would include the specified directories in the 'debian/dirs' file. But it don't.

A possible workaround might be to create the directories via a post-install script or fix the source before packaging.

Does anyone know a way to write custom files in the 'debain/' folder? This way, I could overcome this issue by injecting the 'dirs' file via a fpm agrument (something like --deb-field, but for files).

BTW, fpm works like a charm.


Regards Dominic

Pranay Kanwar

unread,
Jul 30, 2013, 6:15:47 AM7/30/13
to fpm-...@googlegroups.com
The debian/dirs only makes sense while building from debian source package, in actual debian package
it has no significance (You can confirm it by looking inside control.tar.gz of nginx-common package).

You can include empty directories in a deb without any extra effort/flags

$  mkdir -p foo/{bar,zero}
Created deb package {:path=>"foo_1.0_amd64.deb"}
$ fpm -s dir -t deb -n foo -v 1.0 foo/
$ dpkg --contents foo_1.0_amd64.deb
drwx------ 0/0               0 2013-07-30 15:40 ./
drwxr-xr-x 0/0               0 2013-07-30 15:40 ./foo/
drwxr-xr-x 0/0               0 2013-07-30 15:34 ./foo/zero/
drwxr-xr-x 0/0               0 2013-07-30 15:34 ./foo/bar/

You can pass the --edit option to make any changes to whatever fpm generates.

-pk
Reply all
Reply to author
Forward
0 new messages