jordansissel/fpm — pull request #719 by leslieianson (2014-06-16 17:03:22+00:00)
Title: naive implementation of rpm %attr directive

Please consider this pull request as a naive proof of concept for a new proposed command line argument `--rpm-attr`.

We really like fpm and are using it for building rpm packages but have hit a problem where we'd like to be able to specify file specific attributes on a per-file basis.

We note that the rpm `%defattr(, , , )` directive is managed in fpm via the `--rpm-user user`, `--rpm-group group`, `--rpm-defattrfile mode` and `--rpm-defattrdir mode` command line arguments.

So we'd like to also be able to specify the `%attr(, , ) file` directive overriding `%defattr` on a per-file basis but cannot find fpm command line arguments to handle this.

One use case for this is where the majority of files and directories within an rpm are owned by an application user but the init.d script in `/etc/rc.d/init.d/appname` should be owned by root and not by the application user.

We note that this could be done with the fpm command line argument `--rpm-use-file-permissions` but we are not keen on this approach as it would require our build system to run as root in order to call chown/chgrp before invoking fpm.

We are currently working around this by calling `chown` and `chmod` from the `--after-install` script but we consider this a hack given rpm should manage this itself.

## Proposed feature request

Add support for new command line argument which can be called multiple times, e.g.

`--rpm-attr '0755,root,root:/etc/rc.d/init.d/appname`