[CentOS] building RPMs with SELinux

Mon Jan 26 23:49:27 UTC 2015
Daniel J Walsh <dwalsh at redhat.com>

On 01/22/2015 05:40 AM, Andrew Holway wrote:
> Hello,
> Im trying to find some good info on building RPMs that set the correct
> SELinux contexts for the installed packages.
> Any ideas?
> Thanks,
> Andrew
> _______________________________________________
> CentOS mailing list
> CentOS at centos.org
> http://lists.centos.org/mailman/listinfo/centos
rpm should do this by itself.

If the policy file is installed before the rpm is layed down.

You could consider two package

foobar.rpm then make foobar rely on foobar-policy.rpm

But we usually install rpm in post install of the package and then run
restorecon on the content.

This presentation has some rpm examples.