From b73fcb724e50cdc9c194c318893fce297c18f98b Mon Sep 17 00:00:00 2001 From: Petr Lautrbach Date: Mar 19 2019 10:04:43 +0000 Subject: Remove previous/ version of module directory When the policy is built with save-previous=true (see semanage.conf) the previous version of store is saved in /var/lib/selinux/TYPE/previous directory. This directory needs to be erased after build as it has no function for packages. Fixes: Checking for unpackaged file(s): /usr/lib/rpm/check-files /home/plautrba/rpmbuild/BUILDROOT/selinux-policy-3.14.4-4.fc31.x86_64 error: Installed (but unpackaged) file(s) found: /var/lib/selinux/targeted/previous/commit_num /var/lib/selinux/targeted/previous/file_contexts /var/lib/selinux/targeted/previous/file_contexts.homedirs ... --- diff --git a/selinux-policy.spec b/selinux-policy.spec index 4c94852..43aa752 100644 --- a/selinux-policy.spec +++ b/selinux-policy.spec @@ -415,6 +415,9 @@ rm -rf %{buildroot}%{_sharedstatedir}/selinux/minimum/active/modules/100/sandbox %installFactoryResetFiles mls %endif +# remove leftovers when save-previous=true (semanage.conf) is used +rm -rf %{buildroot}%{_sharedstatedir}/selinux/{minimum,targeted,mls}/previous + mkdir -p %{buildroot}%{_mandir} cp -R man/* %{buildroot}%{_mandir} make UNK_PERMS=allow NAME=targeted TYPE=mcs DISTRO=%{distro} UBAC=n DIRECT_INITRC=n MONOLITHIC=%{monolithic} DESTDIR=%{buildroot} PKGNAME=%{name} MLS_CATS=1024 MCS_CATS=1024 install-docs