PKGBUILD 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  1. # Maintainer: David P. <megver83@parabola.nu>
  2. # Maintainer (Artix): artoo <artoo@artixlinux.org>
  3. # Maintainer (Artix): Chris Cromer <cromer@artixlinux.org>
  4. # Contributor (Artix): williamh <williamh@gentoo.org>
  5. _url=https://gitea.artixlinux.org/artix
  6. _extras=1.2 # git rev-parse ${_extras} #79d369b5089c1af77289ebe1e2cf711f6f7a5e28
  7. _alpm=1.4 # git rev-parse ${_alpm} #83961019292a041e1d2c07389d639065632e3f1f
  8. pkgname=openrc
  9. pkgver=0.49
  10. pkgrel=1
  11. pkgdesc="Gentoo's universal init system"
  12. arch=('x86_64')
  13. arch+=('i686' 'armv7h')
  14. url="https://github.com/OpenRC/openrc"
  15. license=('BSD2')
  16. makedepends=('git' 'meson')
  17. depends=('bash' 'glibc' 'inetutils' 'libcap' 'libcap.so'
  18. 'ncurses' 'libncursesw.so' 'netifrc' 'pam' 'libpam.so' 'psmisc' 'perl')
  19. optdepends=('networkmanager-openrc: networkmanager init script'
  20. 'elogind-openrc: elogind init script')
  21. provides=('init-rc' 'svc-manager' 'librc.so' 'libeinfo.so')
  22. conflicts=('init-rc' 'svc-manager')
  23. replaces=(openrc-{deptree2dot,{bash,zsh}-completions})
  24. # remove on next update
  25. conflicts+=(openrc-pid1 udev-init-scripts)
  26. replaces+=(openrc-pid1 udev-init-scripts)
  27. backup=('etc/rc.conf'
  28. 'etc/conf.d/consolefont'
  29. 'etc/conf.d/keymaps'
  30. 'etc/conf.d/hostname'
  31. 'etc/conf.d/modules'
  32. 'etc/conf.d/hwclock'
  33. 'etc/conf.d/etmpfiles-dev'
  34. 'etc/conf.d/etmpfiles-setup'
  35. 'etc/conf.d/udev'
  36. 'etc/conf.d/udev-trigger'
  37. 'etc/conf.d/udev-settle'
  38. 'etc/conf.d/agetty.tty'{1,2,3,4,5,6})
  39. source=("${pkgname}-${pkgver}.tar.gz::${url}/archive/refs/tags/${pkgver}.tar.gz"
  40. 'openrc.logrotate'
  41. 'sysctl.conf'
  42. "artix-rc-conf.patch::${_url}/openrc/commit/e2acda84ddd772594fb968f03eacbc129cc7d65e.patch"
  43. "artix-meson.patch::${_url}/openrc/commit/05b1fd974c71041265a862ca3a2ba4fc79e797cc.patch"
  44. "git+${_url}/openrc-extra.git#tag=${_extras}"
  45. "git+${_url}/alpm-hooks.git#tag=${_alpm}")
  46. sha256sums=('3782a59a9cfccd4dcf19beab9593abd2eb5a3eefe3b35dbbd26d3931d8dc365b'
  47. '0b44210db9770588bd491cd6c0ac9412d99124c6be4c9d3f7d31ec8746072f5c'
  48. '874e50bd217fef3a2e3d0a18eb316b9b3ddb109b93f3cbf45407170c5bec1d6d'
  49. '9420304937ca075714fa3d5deefda5b2bd51ee7398f90ba8ca49594f07baef7a'
  50. '3924bfe28ef14f2d20c03675f246ffb4fdc83f6a5b80f4b3bda0d5e7a14303ef'
  51. 'SKIP'
  52. 'SKIP')
  53. prepare() {
  54. cd "${pkgname}-${pkgver}"
  55. # apply patch from the source array (should be a pacman feature)
  56. local src
  57. for src in "${source[@]}"; do
  58. src="${src%%::*}"
  59. src="${src##*/}"
  60. [[ $src = *.patch ]] || continue
  61. echo "Applying patch $src..."
  62. patch -Np1 < "../$src"
  63. done
  64. }
  65. check(){
  66. meson test -C build --print-errorlogs
  67. }
  68. build(){
  69. local meson_options=(
  70. -Dbranding="\"Parabola GNU/Linux-libre\""
  71. -Dos=Linux
  72. -Drootprefix=/usr
  73. -Dshell=/bin/bash
  74. -Dpam=true
  75. -Dsysvinit=true
  76. -Dpkgconfig=true
  77. -Dtermcap=ncurses
  78. -Dbash-completions=true
  79. -Dzsh-completions=true
  80. -Dsplit-usr=true
  81. -Dnewnet=false
  82. -Daudit=disabled
  83. -Dselinux=disabled
  84. -Dlibrcdir=openrc
  85. )
  86. arch-meson "${pkgname}-${pkgver}" build "${meson_options[@]}"
  87. meson compile -C build
  88. }
  89. package() {
  90. meson install -C build --destdir "${pkgdir}"
  91. install -Dm644 "${srcdir}/${pkgname}".logrotate "${pkgdir}"/etc/logrotate.d/"${pkgname}"
  92. install -d "${pkgdir}"/usr/lib/{openrc/cache,binfmt.d,sysctl.d}
  93. # sysctl defaults
  94. install -m755 "${srcdir}"/sysctl.conf "${pkgdir}"/usr/lib/sysctl.d/50-default.conf
  95. # license
  96. install -Dm644 "${pkgname}-${pkgver}"/LICENSE "${pkgdir}"/usr/share/licenses/"${pkgname}"/LICENSE
  97. # openrc extra; agetty,kmod,udev,tmpfiles,sysusers
  98. make -C "${pkgname}"-extra DESTDIR="${pkgdir}" install
  99. # pacman hooks
  100. make -C alpm-hooks DESTDIR="${pkgdir}" install_openrc
  101. # remove suport dir
  102. rm -r "${pkgdir}"/usr/share/openrc
  103. # remove init symlink
  104. rm -v "${pkgdir}"/usr/bin/init
  105. install -m755 "${pkgname}-${pkgver}"/support/deptree2dot/deptree2dot "${pkgdir}"/usr/bin/deptree2dot
  106. }