From Unreliable Cockroach, 2 Weeks ago, written in Plain Text.
This paste will go to its last resting place in 1 Week.
Embed
  1. # Contributor: artoo <[email protected]>
  2. # Contributor: Oscar Campos <[email protected]>
  3.  
  4. pkgbase=trojan
  5. pkgname=trojan-openrc
  6. pkgver=20200513
  7. pkgrel=1
  8. pkgdesc="OpenRC trojan init script"
  9. arch=('any')
  10. url="https://github.com/artix-linux/packages-galaxy"
  11. license=('GPL2')
  12. groups=('openrc-galaxy')
  13. depends=('openrc' 'trojan')
  14. conflicts=('systemd-sysvcompat')
  15. source=("$pkgbase.initd::https://gitweb.gentoo.org/repo/gentoo.git/plain/net-proxy/trojan/files/trojan.initd")
  16. sha256sums=('a6f057ff6305c51e2d0fb9893ad17dddd7902e6f15397ba2dbc03c5b0170a2ae')
  17.  
  18.  pkgver() {
  19.         date +%Y%m%d
  20.  }
  21.  
  22. _inst_initd(){
  23.     install -Dm755 ${srcdir}/$1.initd ${pkgdir}/etc/init.d/$1
  24.  
  25.     sed -e 's|#!/sbin/openrc-run|#!/usr/bin/openrc-run|g' \
  26.         -re 's_( |\t)/var/run_\1/run_g' \
  27.         -re 's_( |\t)/usr/sbin_\1/usr/bin_g' \
  28.         -re 's_( |\t)/sbin_\1/usr/bin_g' \
  29.         -re 's_( |\t)/bin_\1/usr/bin_g' \
  30.         -i ${pkgdir}/etc/init.d/$1
  31. }
  32.  
  33.  
  34. package() {
  35.     _inst_initd 'trojan'
  36. }