summarylogtreecommitdiffstats
path: root/selinux-refpolicy-git.install
blob: df982b098a60ef7c7b39a0e2aca51cf86982cc45 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
post_install() {
  # Configure /etc/selinux/config
  if [ -e /etc/selinux/config ]
  then
    echo ">>> In order to use this policy, set SELINUXTYPE=refpolicy-git in /etc/selinux/config."
  else
    /usr/bin/ln -v -s config.refpolicy-git /etc/selinux/config
  fi

  echo ">>> Building refpolicy-git policy store. Please wait..."
  /usr/bin/semodule -s refpolicy-git -i /usr/share/selinux/refpolicy-git/*.pp
  echo ">>> Relabeling the filesystem may be needed."
  echo ">>> This can be done with: /usr/bin/restorecon -rF /"
}

post_upgrade() {
  post_install
}

post_remove() {
  echo ">>> Removing refpolicy-git left-over files in /var/lib/selinux"
  /usr/bin/rm -rf /var/lib/selinux/refpolicy-git

  if [ -L /etc/selinux/config ] && ! [ -e /etc/selinux/config ]
  then
    echo ">>> Removing now-broken symbolic link /etc/selinux/config"
    /usr/bin/rm /etc/selinux/config
  fi
}