Advertisement
yurystanev

runner.spec - 30.07.2019

Jul 30th, 2019
2,806
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. %define name menlolab-runner
  2. %define version 0.1.4
  3. %define release 1
  4. %define buildroot %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
  5.  
  6. Name: %{name}
  7. Version: %{version}
  8. Release: %{release}
  9. Summary: menlolab-runner
  10.  
  11. Group: Installation Script
  12. License: MIT
  13. Source: %{name}.tar.gz
  14. BuildRoot: %{buildroot}
  15. Requires: nodejs
  16. BuildRequires: nodejs
  17. AutoReqProv: no
  18.  
  19. %description
  20. The agent deployed on private and public infrastructure to manage tasks.
  21.  
  22. %prep
  23. %setup -q -c -n %{name}
  24.  
  25. %build
  26. npm prune --production
  27. npm rebuild
  28.  
  29. %pre
  30. getent group menlolab-runner >/dev/null || groupadd -r menlolab-runner
  31. getent passwd menlolab-runner >/dev/null || useradd -r -g menlolab-runner -G menlolab-runner -d / -s /sbin/nologin -c "menlolab-runner" menlolab-runner
  32.  
  33. %install
  34. mkdir -p %{buildroot}/usr/lib/menlolab-runner
  35. cp -r ./ %{buildroot}/usr/lib/menlolab-runner
  36. mkdir -p %{buildroot}/var/log/menlolab-runner
  37.  
  38. %post
  39. systemctl enable /usr/lib/menlolab-runner/menlolab-runner.service
  40. ln -s /usr/lib/menlolab-runner/runner.js menlolab-runner
  41. chmod ugo+x /usr/lib/menlolab-runner/runner.js
  42.  
  43. %clean
  44. rm -rf %{buildroot}
  45.  
  46. %files
  47. %defattr(644, menlolab-runner, menlolab-runner, 755)
  48. /usr/lib/menlolab-runner
  49. /var/log/menlolab-runner
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement