summaryrefslogtreecommitdiff
path: root/nonsystemd/openrc-security/PKGBUILD
blob: 91c2abd4a4015a653563f21dde794c5d5a5ef4ea (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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
# Maintainer: David P. <megver83@parabola.nu>
# Maintainer: Omar Vega Ramos <ovruni@gnu.org.pe>
# Contributor: Luke Shumaker <lukeshu@parabola.nu>

pkgver=20200112
_commit=bfce6ac47f7b46a3d89a73b9a24c196713914d83
_url="https://raw.githubusercontent.com/gentoo/gentoo/${_commit}"

pkgbase=openrc-security
pkgname=('apparmor-openrc'
         'iptables-openrc'
         'shorewall-openrc'
         'shorewall6-openrc'
         'firewalld-openrc')
pkgrel=2
pkgdesc="OpenRC init scripts"
arch=('any')
url="https://github.com/gentoo/gentoo"
license=('GPL2')
groups=('openrc-security')
source=("iptables.confd::${_url}/net-firewall/iptables/files/iptables-1.4.13.confd"
        "ip6tables.confd::${_url}/net-firewall/iptables/files/ip6tables-1.4.13.confd"
        "iptables.initd::${_url}/net-firewall/iptables/files/iptables.init"
        "ebtables.confd::${_url}/net-firewall/ebtables/files/ebtables.confd-r1"
        "ebtables.initd::${_url}/net-firewall/ebtables/files/ebtables.initd-r1"
        "firewalld.initd::${_url}/net-firewall/firewalld/files/firewalld.init"
        "apparmor.initd::${_url}/sys-apps/apparmor/files/apparmor-init"
        "shorewall.initd::${_url}/net-firewall/shorewall/files/shorewall.initd-r3"
        "shorewall.confd::${_url}/net-firewall/shorewall/files/shorewall.confd-r1"
        "shorewall6.initd::${_url}/net-firewall/shorewall/files/shorewall.initd-r3"
        "shorewall6.confd::${_url}/net-firewall/shorewall/files/shorewall.confd-r1"
)
sha512sums=('bd67d53e997ea65755148ba071fe6e3856d6e604b9167c666900721bc3dc24f63d395bc33a1a34ae50f95e72760da630db1a8d35afc81ec5973e60ba5343dc70'
            '8de9a5de4061bef217fbc07577688a8110f1116af7f3b936dfd18100a6a7a47ec6e70c456b24cf3432fb4f2034b741a487fe6af8d9740f174d51c6eb16945c6e'
            '317c71bee98f5b1bbfd17ea961e5e268532c2320fc865b7876f7cc4e02a66b6a012fc336f8880045a83e101f161197c0a1d106220af6240407cebafbf38022db'
            '088308eba077fcec35299c8aaad0492024173504a361c2ba7e29dce106888a78c72818a791f3d3655aed3f6df26a3319c42e2b2c54760cdbad036d46b89b97f3'
            'ceceaf33d6f6bfa89a5d81932e3ec76a26d09d67150efd3de587520ea47984f618d4fc55e799c58a2e5e236caec5bd81e2fde31a7e5aa328e629cdabbd29339b'
            '457cda01449f38563e98e1db937fe1c50745eab91797f52687e3ab9f5d94dd42d129740ae6669e99666a3f096d631dd3a44e66010b638b31b9c6ba798362403e'
            '4ee4747ec98a0828beb690bf5e01bc112d958bff4c68d60fc0cbb9f0707bd8daecc011dba3916aa6e6368f460eedce7f2ce42aad9ccea49a5d898dcae3d01148'
            '5cb410e0fe0391fd467f212b3e1cf3ec4c7fa3289de2341edbf301ce9087e7cba05a36999a8203d7bce28ac35a429c10bc017a96b750aec1bf257987aec23245'
            '105393c3cbdd1820066e41ed941b6a79cafde3196eb723c06ca984fc663370d6902757467339b6b4ebfb8d00167b9f85311b6842dadc564029313eb36f1a389b'
            '4cf71fd8087fa6c81a2ef4845da108df08f03c63f5a1312e79ec7f32cdae0d14d4d21a2af2ab696cc9be3c6d9215f097461b46b398db2a18067987cac00e5771'
            'fee275ba8089b0abda5239edb06a3ab70c96acbbcd715c1a3aa5e92ba976294525c251b67b00d876e45f7c827767db45bd7623df42cc68c822234a7ea13d527b')

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

    local _sed_args=()
    sed -e 's|#!/sbin/openrc-run|#!/usr/bin/openrc-run|g' \
        -e 's|/var/run|/run|g' \
        -e 's|/sbin|/usr/bin|g' \
        -i ${pkgdir}/etc/init.d/$1
}

_inst_confd(){
    install -Dm755 ${srcdir}/$1.confd ${pkgdir}/etc/conf.d/$1
}

package_iptables-openrc() {
	pkgdesc="OpenRC iptables init script"
	depends=('openrc' 'iptables')
	backup=('etc/conf.d/iptables'
		'etc/conf.d/ip6tables'
		'etc/conf.d/ebtables')

	_inst_confd 'iptables'
    _inst_initd 'iptables'

    _inst_confd 'ebtables'
    _inst_initd 'ebtables'

    _inst_confd 'ip6tables'

    install -Dm755 "${srcdir}/iptables.initd" "${pkgdir}/etc/init.d/ip6tables"

    sed -e 's|#!/sbin/openrc-run|#!/usr/bin/openrc-run|g' \
        -e 's|/var/run|/run|g' \
        -e 's|/sbin|/usr/bin|g' \
        -i ${pkgdir}/etc/init.d/ip6tables
}

package_firewalld-openrc() {
	pkgdesc="OpenRC firewalld init script"
	depends=('firewalld' 'openrc')

	_inst_initd 'firewalld'
	sed -e 's|/usr/sbin|/usr/bin|g' -i ${pkgdir}/etc/init.d/firewalld
}

package_apparmor-openrc() {
    pkgdesc="OpenRC apparmor init script"
    depends=('apparmor' 'openrc')

   _inst_initd 'apparmor'
   sed 's|libexec|lib/apparmor|' -i ${pkgdir}/etc/init.d/apparmor
}

package_shorewall-openrc() {
    pkgdes="OpenRC shorewall init script"
    depends=('shorewall' 'openrc')
    backup=('etc/conf.d/shorewall')

    _inst_initd 'shorewall'
    _inst_confd 'shorewall'
}

package_shorewall6-openrc() {
    pkgdes="OpenRC shorewall6 init script"
    depends=('shorewall6' 'openrc')
    backup=('etc/conf.d/shorewall6')

    _inst_initd 'shorewall6'
    _inst_confd 'shorewall6'
    sed -e 's|/usr/sbin|/usr/bin|g' -i ${pkgdir}/etc/init.d/shorewall6
}