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.

60 lines
1.5 KiB

7 years ago
  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. Requires: tendermint >= 0.11.0
  12. @PACKAGE_ADDITIONAL_HEADER@
  13. %description
  14. @PACKAGE_DESCRIPTION@
  15. %pre
  16. if ! %{__grep} -q '^%{name}:' /etc/passwd ; then
  17. useradd -r -b %{_sysconfdir} %{name}
  18. mkdir -p %{_sysconfdir}/%{name}
  19. chmod 755 %{_sysconfdir}/%{name}
  20. chown %{name}.%{name} %{_sysconfdir}/%{name}
  21. fi
  22. %prep
  23. # Nothing to do here. - It is done in the Makefile.
  24. %build
  25. # Nothing to do here.
  26. %install
  27. cd %{name}-%{version}-%{release}
  28. %{__cp} -a * %{buildroot}
  29. %post
  30. sudo -Hu %{name} tendermint init --home %{_sysconfdir}/%{name}
  31. sudo -Hu %{name} %{name} --datadir %{_sysconfdir}/%{name} init %{_sysconfdir}/%{name}/genesis.json
  32. systemctl daemon-reload
  33. %preun
  34. systemctl stop %{name} 2> /dev/null || :
  35. systemctl stop %{name}-service 2> /dev/null || :
  36. %postun
  37. systemctl daemon-reload
  38. %files
  39. %attr(0755, %{name}, %{name}) %dir %{_sysconfdir}/%{name}
  40. %config(noreplace) %attr(0644, %{name}, %{name}) %{_sysconfdir}/%{name}/genesis.json
  41. %attr(0755, %{name}, %{name}) %dir %{_sysconfdir}/%{name}/keystore
  42. %attr(0644, %{name}, %{name}) %{_sysconfdir}/%{name}/keystore/*
  43. %{_bindir}/*
  44. %{_sysconfdir}/systemd/system/*
  45. %{_sysconfdir}/systemd/system-preset/*
  46. %dir %{_defaultlicensedir}/%{name}
  47. %doc %{_defaultlicensedir}/%{name}/LICENSE