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
semanagewhich seems to be one of the proper ways to do it. (Add a new policy and then runrestoreconon your directories in%post.)- I also don't need my own context, just
httpd_cache_ton a non-standard directory.
- I also don't need my own context, just
I have also seen "let
cpiotake care of it" - but then I have a new problem that a non-root RPM building user cannot runchconon the build directories. I cheated and hadsudoin the spec file but that didn't seem to matter anyway.