I an on my first attempt at building a binary rpm and I have a couple of questions.
1) The spec's %files section has something similar to this:
%files
%attr(X,Y,Z) /app/foo
%atrr(A,B,C) /app/foo/bar
foo is a directory, and bar is a file within this directory. I need to (at least I think I need to) list both of them in the %files section because both get created during the install and have different permissions (and in some cases ownership). When I build the rpm I get this warning:
warning: File listed twice: /app/foo/bar
I am not overly worried about the warnings (the built rpm installs/erases just fine), but was just wondering whether I can doctor this somehow. Or maybe I have a bigger problem that I cannot spot.
2) Within the %install section I am changing the ownership of some of the directories/files (I have "chown X:Y <name>" lines there), just to make sure that they are correct - the file/dir attributes are specified correctly in the %files section but I am just guarding against the case where the file/dir existed before the "rpm -i"; actually in some cases the file/dir is not listed in the %files section and is not created by the "rpm -i" and I still need to change the ownership. In any case, rpmbuild does not like chown-s in the %{post,}install section unless it is run as root, even though the build root (including the directories on the path and the actual file) is somewhere the user that starts the rpmbuild has write permissions to. Any reason why this is required, or again I am doing something stupid?
Thanks,
Nik