Advertisement
Guest User

selinux-usr-policycoreutils PKGBUILD

a guest
Apr 15th, 2013
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 2.42 KB | None | 0 0
  1. # Maintainer: Nicky726 (Nicky726 <at> gmail <dot> com)
  2. # Contributor: Sergej Pupykin (pupykin <dot> s+arch <at> gmail <dot> com)
  3. # Contributor: angelux/xangelux (xangelux <at> gmail <dot> com)
  4.  
  5. pkgname=selinux-usr-policycoreutils
  6. _origname=policycoreutils
  7. _release=20120924
  8. pkgver=2.1.13
  9. pkgrel=2
  10. pkgdesc="SELinux userspace (policycoreutils)"
  11. arch=('i686' 'x86_64')
  12. url="http://userspace.selinuxproject.org"
  13. license=('GPL')
  14. groups=('selinux' 'selinux-userspace')
  15. depends=('selinux-usr-libsemanage>=2.1.0' 'selinux-usr-libselinux>=2.1.0' 'python2'
  16.          'libcap-ng' 'libcgroup' 'dbus-glib')
  17. options=(!emptydirs)
  18. source=(http://userspace.selinuxproject.org/releases/${_release}/${_origname}-${pkgver}.tar.gz
  19.         policycoreutils-seunshare.diff
  20.         restorecond.service)
  21. sha256sums=('34040f06f3111d9ee957576e4095841d35b9ca9141ee8d80aab036cbefb28584'
  22.             '10e1dfcd1db7fb1c2efa26151f37ede7d3da6cada393e186ffdeac234a8635fc'
  23.             '4d01581a32888699d31f4e12058998fc39e22b844965155a8cbe9161fde1900b')
  24.  
  25. build() {
  26.   cd "${srcdir}/${_origname}-${pkgver}"
  27.   sed -i -e "s/-Werror -Wall -W/-Werror -Wall -W -O2/" "setfiles/Makefile"
  28.   sed -i -e "s/-Werror -Wall -W/-Werror -Wall -W -O2/" "sestatus/Makefile"
  29.   sed -i -e "s/shell python -c/shell python2 -c/" "semanage/Makefile"
  30.   sed -i -e "s/shell python -c/shell python2 -c/" "sandbox/Makefile"
  31.  
  32.         patch -Np1 -i ../${_origname}-seunshare.diff
  33.   make
  34. }
  35.  
  36. package(){
  37.   cd "${srcdir}/${_origname}-${pkgver}"
  38.  
  39.   make DESTDIR="${pkgdir}" install
  40.  
  41.   # Move daemons to correct locations
  42.   mv "${pkgdir}/etc/rc.d/init.d/restorecond" \
  43.         "${pkgdir}/etc/rc.d/"
  44.   sed -i -e "s/init.d\/functions/functions.d/g" \
  45.         "${pkgdir}/etc/rc.d/restorecond"
  46.   rmdir "${pkgdir}/etc/rc.d/init.d/"
  47.   # Install unit file
  48.   install -Dm644 "${srcdir}/restorecond.service" \
  49.   "${pkgdir}/usr/lib/systemd/system/restorecond.service"
  50.  
  51.   # Following are python2 scripts
  52.   sed -i -e "s/python -E/python2 -E/" \
  53.         "${pkgdir}/usr/bin/audit2allow"
  54.   sed -i -e "s/python -E/python2 -E/" \
  55.         "${pkgdir}/usr/bin/audit2why"
  56.   sed -i -e "s/python -E/python2 -E/" \
  57.         "${pkgdir}/usr/bin/chcat"
  58.   sed -i -e "s/python -E/python2 -E/" \
  59.         "${pkgdir}/usr/bin/sepolgen-ifgen"
  60.   sed -i -e "s/python -E/python2 -E/" \
  61.         "${pkgdir}/usr/sbin/semanage"
  62.   sed -i -e "s/python -E/python2 -E/" \
  63.         "${pkgdir}/usr/lib/python2.7/site-packages/seobject.py"
  64. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement