1 # Maintainer: Nicky726 (Nicky726 <at> gmail <dot> com)
2 # Contributor: Simon Peter Nicholls (simon <at> mintsource <dot> org)
4 pkgname=selinux-refpolicy-arch
6 _policyname=refpolicy-arch
9 pkgver=${_origver}.${_patchver}
11 pkgdesc="Modular SELinux reference policy including headers and docs with Arch Linux patch"
13 url="http://oss.tresys.com/projects/refpolicy"
15 groups=('selinux' 'selinux-policies')
16 depends=('linux-selinux')
17 makedepends=('selinux-usr-checkpolicy>=2.0.16' 'selinux-usr-policycoreutils>=2.0.0'
18 'selinux-usr-libsepol>=2.0.29' 'selinux-usr-libsemanage>=2.0.29'
20 conflicts=('selinux-refpolicy')
21 backup=(etc/selinux/config)
23 install=${pkgname}.install
24 source=(http://oss.tresys.com/files/${_origname}/${_origname}-2.${_origver}.tar.bz2
27 sha256sums=('8159b7535aa0f805510e4e3504b1317d7083b227f0ef3df51c6f002ed70ecedb'
28 '4803739c58a47b0226899e41239df714ee72e86267c9929d4776b819de370cb4'
29 'b03d8afcc71f0d67ba3c8688003f353c27d00bf8a87ef925e23c54fafe2d4880')
32 cd "${srcdir}/${_origname}"
33 # Add Arch Linux patch
34 patch -Np1 -i "${srcdir}/${pkgname}.patch"
35 # Policy build settings
36 sed -i -e "s/MONOLITHIC = y/MONOLITHIC = n/" build.conf
37 sed -i -e "s/#UNK_PERMS = deny/UNK_PERMS = allow/" build.conf
38 sed -i -e "s/DIRECT_INITRC = n/DIRECT_INITRC = y/" build.conf
39 sed -i -e "s/UBAC = y/UBAC = n/" build.conf
40 sed -i -e "s/NAME = refpolicy/NAME = refpolicy-arch/" build.conf
41 sed -i -e "s/#DISTRO = redhat/DISTRO = arch/" build.conf
43 sed -i -e "s/python/python2/" Makefile
50 cd "${srcdir}/${_origname}"
51 make DESTDIR="${pkgdir}" install
52 make DESTDIR="${pkgdir}" install-headers
53 make DESTDIR="${pkgdir}" install-docs
55 # Create some files and directories necesary for loading policy,
56 # which is done via install script.
57 install -d -m0755 "${pkgdir}/etc/selinux/${_policyname}/modules"
58 install -d -m0700 "${pkgdir}/etc/selinux/${_policyname}/modules/active"
59 install -d -m0700 "${pkgdir}/etc/selinux/${_policyname}/modules/active/modules"
60 install -d -m0755 "${pkgdir}/etc/selinux/${_policyname}/policy"
61 touch "${pkgdir}/etc/selinux/${_policyname}/modules/"{semanage.read.LOCK,semanage.trans.LOCK}
62 touch "${pkgdir}/etc/selinux/${_policyname}/policy/policy.26"
63 # Link the policy file for selinux-sysvinit to find it
65 ln -s "selinux/${_policyname}/policy/policy.26" "policy.bin"
67 # Install main SELinux config file defaulting to refpolicy
68 install -m644 -D "${srcdir}/config" "${pkgdir}/etc/selinux/config"
70 # Some changes due to python2
71 sed -i -e "s/python/python2/" \
72 "${pkgdir}/usr/share/selinux/${_policyname}/include/support/segenxml.py"
73 sed -i -e "s/python/python2/" \
74 "${pkgdir}/usr/share/selinux/${_policyname}/include/Makefile"