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.

63 lines
1.4 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} tracko init --home %{_sysconfdir}/%{name} 2B24DEE2364762300168DF19B6C18BCE2D399EA2
  32. #Temporary until https://github.com/tendermint/basecoin/issues/123
  33. rm -f %{_sysconfdir}/%{name}/key.json
  34. rm -f %{_sysconfdir}/%{name}/key2.json
  35. systemctl daemon-reload
  36. %preun
  37. systemctl stop %{name} 2> /dev/null || :
  38. systemctl stop %{name}-service 2> /dev/null || :
  39. %postun
  40. systemctl daemon-reload
  41. %files
  42. %ghost %attr(0755, %{name}, %{name}) %dir %{_sysconfdir}/%{name}
  43. %{_bindir}/*
  44. %{_sysconfdir}/systemd/system/*
  45. %{_sysconfdir}/systemd/system-preset/*
  46. %dir %{_datadir}/%{name}
  47. %{_datadir}/%{name}/*
  48. %dir %{_defaultlicensedir}/%{name}
  49. %doc %{_defaultlicensedir}/%{name}/LICENSE