I am trying to build an RPM that targets RHEL4 and 5. Right now I call chcon
from %post
but multiple Google entries say "that's not how you are supposed to do it" with very limited help on the right way. I've also noticed that fixfiles -R mypackage check
says the files are wrong when they are right (as expected; the RPM DB doesn't realize what I want)..
I specifically say RHEL4 because it does not have
semanage
which seems to be one of the proper ways to do it. (Add a new policy and then runrestorecon
on your directories in%post
.)- I also don't need my own context, just
httpd_cache_t
on a non-standard directory.
- I also don't need my own context, just
I have also seen "let
cpio
take care of it" - but then I have a new problem that a non-root RPM building user cannot runchcon
on the build directories. I cheated and hadsudo
in the spec file but that didn't seem to matter anyway.