Advertisement
Guest User

PKGBUILD and services.install for remotepc-bin

a guest
Aug 7th, 2021
200
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.68 KB | None | 0 0
  1. # THESE ARE TWO SEPARATE FILES
  2.  
  3. # 1) PKGBUILD
  4.  
  5. # 2) services.install
  6.  
  7. # THEY MUST BE IN THE SAME DIRECTORY WHEN INVOKING makepkg
  8.  
  9.  
  10.  
  11.  
  12.  
  13.  
  14.  
  15.  
  16. ########## PKGBUILD STARTS HERE ##########
  17.  
  18. pkgname=remotepc-bin
  19. altpkgname=remotepc
  20. pkgver=4.4.0
  21. pkgrel=1
  22. provides=('remotepc')
  23. pkgdesc="Access your remote computer from any Windows, Mac, or Linux computer, iOS or Android device, or via the web"
  24. arch=('x86_64')
  25. url="https://www.remotepc.com"
  26. dlurl="https://static.remotepc.com/downloads"
  27. shortname="rpc"
  28. internalnum="310320"
  29. license=('custom')
  30. install="services.install"
  31. source=(${altpkgname}.deb::${dlurl}/${shortname}/${internalnum}/${altpkgname}.deb)
  32. sha1sums=('4abfeec607edf810aed58fec2bbb2507da2ba1ea')
  33.  
  34. package() {
  35. cd ${srcdir}
  36.  
  37. # Extract files from the .deb archive
  38. ar xvf ${altpkgname}.deb
  39. tar xvf data.tar.xz
  40. tar xvf control.tar.gz
  41.  
  42. # Copy directories exactly as found in the .deb archive instructions
  43. cp -rv "${srcdir}/opt" "${pkgdir}"
  44. cp -rv "${srcdir}/usr" "${pkgdir}"
  45.  
  46. # Prepare files and directories based on .deb archive instructions
  47. touch "${pkgdir}/opt/remotepc/chrome-sandbox"
  48. chmod 4755 "${pkgdir}/opt/remotepc/chrome-sandbox"
  49. touch "${pkgdir}/opt/remotepc/resources/isTnCAccepted"
  50. chmod ugo+rwx "${pkgdir}/opt/remotepc/resources/isTnCAccepted"
  51.  
  52. # Prepare services directories and copy systemd units from /opt/ directory in .deb archive
  53. mkdir -p "${pkgdir}/etc/systemd/system"
  54. mkdir -p "${pkgdir}/etc/systemd/user"
  55. mkdir -p "${pkgdir}/usr/bin"
  56.  
  57. cp -f "${pkgdir}/opt/remotepc/remotepc.service" "${pkgdir}/etc/systemd/system/"
  58. cp -f "${pkgdir}/opt/remotepc/remotepc_installer.service" "${pkgdir}/etc/systemd/system/"
  59. cp -f "${pkgdir}/opt/remotepc/remotepc-desktop.service" "${pkgdir}/etc/systemd/user/"
  60.  
  61. # Make symlink to binary executable
  62. ln -sf "${pkgdir}/opt/remotepc/remotepc" "${pkgdir}/usr/bin/remotepc"
  63.  
  64. # Prepare exclusive log directory
  65. mkdir -p "${pkgdir}/var/log/remotepc"
  66. chmod 777 "${pkgdir}/var/log/remotepc"
  67. }
  68.  
  69. ########## PKGBUILD ENDS HERE ##########
  70.  
  71.  
  72.  
  73.  
  74.  
  75.  
  76.  
  77.  
  78.  
  79.  
  80.  
  81.  
  82.  
  83. ########## services.install STARTS HERE ##########
  84.  
  85. post_install() {
  86.  
  87. # Enable and start remotepc systemd service
  88. systemctl daemon-reload
  89. systemctl enable remotepc.service
  90. systemctl restart remotepc.service
  91.  
  92. }
  93.  
  94.  
  95.  
  96. pre_remove() {
  97. # Stop and distable remotepc systemd service
  98. systemctl stop remotepc.service
  99. systemctl disable remotepc.service
  100.  
  101.  
  102. }
  103.  
  104.  
  105.  
  106. post_remove() {
  107.  
  108. # Some newly created (residual) ROOT "config" files leftover?
  109. # Yet, USER config files remain under $HOME/.config/remotepc/
  110. # /opt/remotepc is no longer needed
  111. rm -rf /opt/remotepc
  112.  
  113. }
  114.  
  115. ########## services.install ENDS HERE ##########
  116.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement