summaryrefslogtreecommitdiff
path: root/pcr/apparmor-openrc/PKGBUILD
blob: ccf78fa012a0103f0fa0d74c273aa742d891b2ca (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
30
31
32
# Maintainer: David P. <megver83@openmailbox.org>

pkgname=apparmor-openrc
pkgver=20160816
pkgrel=1
pkgdesc="OpenRC apparmor init script"
arch=('any')
url="http://apparmor.net/"
license=('GPL2')
depends=('apparmor' 'openrc')
install='apparmor.install'
_filename='apparmor-init'
source=("https://gitweb.gentoo.org/repo/gentoo.git/plain/sys-apps/apparmor/files/$_filename")
sha256sums=('6357f9645587de19c46d824215ca4c3be99c488e8da9bd0e403b69e33ba8ed07')

pkgver() {
   date +%Y%m%d
}

_inst_initd(){
   install -Dm755 ${srcdir}/$1.initd ${pkgdir}/etc/init.d/$1

   sed -e 's|#!/sbin/runscript|#!/usr/bin/openrc-run|' \
	 -e 's|/var/run|/run|g' \
	 -i "${pkgdir}/etc/init.d/$1"
   # ^^--- should work without this, but actually does not (at boot)
}

package() {
   mv "$_filename" -v apparmor.initd
   _inst_initd 'apparmor'
}