PKGBUILD 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  1. # Maintainer: David P. <megver83@parabola.nu>
  2. # Maintainer: Omar Vega Ramos <ovruni@gnu.org.pe>
  3. # Contributor: Luke Shumaker <lukeshu@parabola.nu>
  4. pkgver=20201202
  5. _commit=bfce6ac47f7b46a3d89a73b9a24c196713914d83
  6. _url="https://raw.githubusercontent.com/gentoo/gentoo/${_commit}"
  7. pkgbase=openrc-security
  8. pkgname=('apparmor-openrc'
  9. 'iptables-openrc'
  10. 'shorewall-openrc'
  11. 'shorewall6-openrc'
  12. 'firewalld-openrc'
  13. 'nftables-openrc')
  14. pkgrel=2
  15. pkgdesc="OpenRC init scripts"
  16. arch=('any')
  17. url="https://github.com/gentoo/gentoo"
  18. license=('GPL2')
  19. groups=('openrc-security')
  20. source=("iptables.confd::${_url}/net-firewall/iptables/files/iptables-1.4.13.confd"
  21. "ip6tables.confd::${_url}/net-firewall/iptables/files/ip6tables-1.4.13.confd"
  22. "iptables.initd::${_url}/net-firewall/iptables/files/iptables.init"
  23. "ebtables.confd::${_url}/net-firewall/ebtables/files/ebtables.confd-r1"
  24. "ebtables.initd::${_url}/net-firewall/ebtables/files/ebtables.initd-r1"
  25. "firewalld.initd::${_url}/net-firewall/firewalld/files/firewalld.init"
  26. "apparmor.initd::${_url}/sys-apps/apparmor/files/apparmor-init"
  27. "shorewall.initd::${_url}/net-firewall/shorewall/files/shorewall.initd-r3"
  28. "shorewall.confd::${_url}/net-firewall/shorewall/files/shorewall.confd-r1"
  29. "shorewall6.initd::${_url}/net-firewall/shorewall/files/shorewall.initd-r3"
  30. "shorewall6.confd::${_url}/net-firewall/shorewall/files/shorewall.confd-r1"
  31. "nftables.shd::${_url}/net-firewall/nftables/files/libexec/nftables.sh"
  32. "nftables.confd::${_url}/net-firewall/nftables/files/nftables.confd"
  33. "nftables.initd::${_url}/net-firewall/nftables/files/nftables.init"
  34. )
  35. sha512sums=('bd67d53e997ea65755148ba071fe6e3856d6e604b9167c666900721bc3dc24f63d395bc33a1a34ae50f95e72760da630db1a8d35afc81ec5973e60ba5343dc70'
  36. '8de9a5de4061bef217fbc07577688a8110f1116af7f3b936dfd18100a6a7a47ec6e70c456b24cf3432fb4f2034b741a487fe6af8d9740f174d51c6eb16945c6e'
  37. '317c71bee98f5b1bbfd17ea961e5e268532c2320fc865b7876f7cc4e02a66b6a012fc336f8880045a83e101f161197c0a1d106220af6240407cebafbf38022db'
  38. '088308eba077fcec35299c8aaad0492024173504a361c2ba7e29dce106888a78c72818a791f3d3655aed3f6df26a3319c42e2b2c54760cdbad036d46b89b97f3'
  39. 'ceceaf33d6f6bfa89a5d81932e3ec76a26d09d67150efd3de587520ea47984f618d4fc55e799c58a2e5e236caec5bd81e2fde31a7e5aa328e629cdabbd29339b'
  40. '457cda01449f38563e98e1db937fe1c50745eab91797f52687e3ab9f5d94dd42d129740ae6669e99666a3f096d631dd3a44e66010b638b31b9c6ba798362403e'
  41. '4ee4747ec98a0828beb690bf5e01bc112d958bff4c68d60fc0cbb9f0707bd8daecc011dba3916aa6e6368f460eedce7f2ce42aad9ccea49a5d898dcae3d01148'
  42. '4cf71fd8087fa6c81a2ef4845da108df08f03c63f5a1312e79ec7f32cdae0d14d4d21a2af2ab696cc9be3c6d9215f097461b46b398db2a18067987cac00e5771'
  43. 'fee275ba8089b0abda5239edb06a3ab70c96acbbcd715c1a3aa5e92ba976294525c251b67b00d876e45f7c827767db45bd7623df42cc68c822234a7ea13d527b'
  44. '4cf71fd8087fa6c81a2ef4845da108df08f03c63f5a1312e79ec7f32cdae0d14d4d21a2af2ab696cc9be3c6d9215f097461b46b398db2a18067987cac00e5771'
  45. 'fee275ba8089b0abda5239edb06a3ab70c96acbbcd715c1a3aa5e92ba976294525c251b67b00d876e45f7c827767db45bd7623df42cc68c822234a7ea13d527b'
  46. '6cb1ac0928ae2da5c69764d45c52a661a6d72698bb9edd6a603580d2f9bd82b59f2a2661e7569ade3a3b729459d115004f251ad6a5eac8cdf1d38c65bfa9349e'
  47. '8370abcdc89fcd9da5dc7d1620be6afb4633b8bcd0a8a120b464cc1a7e1fab6f34956c293da3f6d3cbe1f7a2e03038fd0c94a614137ae5657d29ffdb5f3fa144'
  48. 'ca761be0440945b21d5b002468baffb3299d0a3ac244aa895734dfdfaf442e7a73b757bcda99d958582064411d1b80b2cbcb4eb532bb219b4df407c9ed892661')
  49. _inst_initd(){
  50. install -Dm755 ${srcdir}/$1.initd ${pkgdir}/etc/init.d/$1
  51. local _sed_args=()
  52. sed -e 's|#!/sbin/openrc-run|#!/usr/bin/openrc-run|g' \
  53. -e 's|/var/run|/run|g' \
  54. -e 's|/sbin|/usr/bin|g' \
  55. -i ${pkgdir}/etc/init.d/$1
  56. }
  57. _inst_confd(){
  58. install -Dm755 ${srcdir}/$1.confd ${pkgdir}/etc/conf.d/$1
  59. }
  60. package_iptables-openrc() {
  61. pkgdesc="OpenRC iptables init script"
  62. depends=('openrc' 'iptables')
  63. backup=('etc/conf.d/iptables'
  64. 'etc/conf.d/ip6tables'
  65. 'etc/conf.d/ebtables')
  66. _inst_confd 'iptables'
  67. _inst_initd 'iptables'
  68. _inst_confd 'ebtables'
  69. _inst_initd 'ebtables'
  70. _inst_confd 'ip6tables'
  71. install -Dm755 "${srcdir}/iptables.initd" "${pkgdir}/etc/init.d/ip6tables"
  72. sed -e 's|#!/sbin/openrc-run|#!/usr/bin/openrc-run|g' \
  73. -e 's|/var/run|/run|g' \
  74. -e 's|/sbin|/usr/bin|g' \
  75. -i ${pkgdir}/etc/init.d/ip6tables
  76. }
  77. package_firewalld-openrc() {
  78. pkgdesc="OpenRC firewalld init script"
  79. depends=('firewalld' 'openrc')
  80. _inst_initd 'firewalld'
  81. sed -e 's|/usr/sbin|/usr/bin|g' -i ${pkgdir}/etc/init.d/firewalld
  82. }
  83. package_apparmor-openrc() {
  84. pkgdesc="OpenRC apparmor init script"
  85. depends=('apparmor' 'openrc')
  86. _inst_initd 'apparmor'
  87. sed 's|libexec|lib/apparmor|' -i ${pkgdir}/etc/init.d/apparmor
  88. }
  89. package_shorewall-openrc() {
  90. pkgdes="OpenRC shorewall init script"
  91. depends=('shorewall' 'openrc')
  92. backup=('etc/conf.d/shorewall')
  93. _inst_initd 'shorewall'
  94. _inst_confd 'shorewall'
  95. }
  96. package_shorewall6-openrc() {
  97. pkgdes="OpenRC shorewall6 init script"
  98. depends=('shorewall6' 'openrc')
  99. backup=('etc/conf.d/shorewall6')
  100. _inst_initd 'shorewall6'
  101. _inst_confd 'shorewall6'
  102. sed -e 's|/usr/sbin|/usr/bin|g' -i ${pkgdir}/etc/init.d/shorewall6
  103. }
  104. package_nftables-openrc() {
  105. pkgdes="OpenRC nftables init script"
  106. depends=('nftables' 'openrc')
  107. backup=('etc/conf.d/nftables')
  108. _inst_confd 'nftables'
  109. install -Dm755 "${srcdir}/nftables.shd" "${pkgdir}/usr/lib/nftables/nftables.sh"
  110. _inst_initd 'nftables'
  111. sed -e 's|/sbin|/usr/bin|g' \
  112. -e 's|libexec|lib|g' \
  113. -i "${pkgdir}/etc/init.d/nftables"
  114. }