You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

55 lines
1.2 KiB

  1. Version: @VERSION@
  2. Release: @BUILD_NUMBER@
  3. %define __spec_install_post %{nil}
  4. %define debug_package %{nil}
  5. %define __os_install_post %{nil}
  6. Name: @PACKAGE_NAME@
  7. Summary: @PACKAGE_SUMMARY@
  8. License: Apache 2.0
  9. URL: @PACKAGE_URL@
  10. Packager: Greg Szabo
  11. @PACKAGE_ADDITIONAL_HEADER@
  12. %description
  13. @PACKAGE_DESCRIPTION@
  14. %pre
  15. if ! %{__grep} -q '^%{name}:' /etc/passwd ; then
  16. useradd -r -b %{_sysconfdir} %{name}
  17. mkdir -p %{_sysconfdir}/%{name}
  18. chmod 755 %{_sysconfdir}/%{name}
  19. chown %{name}.%{name} %{_sysconfdir}/%{name}
  20. fi
  21. %prep
  22. # Nothing to do here. - It is done in the Makefile.
  23. %build
  24. # Nothing to do here.
  25. %install
  26. cd %{name}-%{version}-%{release}
  27. %{__cp} -a * %{buildroot}
  28. %post
  29. sudo -Hu %{name} %{name} node init --home %{_sysconfdir}/%{name} 2B24DEE2364762300168DF19B6C18BCE2D399EA2
  30. systemctl daemon-reload
  31. %preun
  32. systemctl stop %{name} 2> /dev/null || :
  33. %postun
  34. systemctl daemon-reload
  35. %files
  36. %ghost %attr(0755, %{name}, %{name}) %dir %{_sysconfdir}/%{name}
  37. %{_bindir}/*
  38. %{_sysconfdir}/systemd/system/*
  39. %{_sysconfdir}/systemd/system-preset/*
  40. %dir %{_datadir}/%{name}
  41. %{_datadir}/%{name}/*
  42. %dir %{_defaultlicensedir}/%{name}
  43. %doc %{_defaultlicensedir}/%{name}/LICENSE