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.

67 lines
2.0 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: cosmos-sdk
  7. Summary: cosmos-sdk is a Proof-of-Stake framework
  8. License: Apache 2.0
  9. URL: https://cosmos.network/
  10. Packager: Greg Szabo
  11. Requires: tendermint >= 0.10.0
  12. Provides: basecoin basecli
  13. #Requires(pre): useradd
  14. %description
  15. Cosmos-SDK is a general purpose framework for the Tendermint consensus engine to form a Proof-of-Stake cryptocurrency.
  16. %pre
  17. if ! %{__grep} -q '^%{name}:' /etc/passwd ; then
  18. useradd -k /dev/null -r -m -b %{_sysconfdir} %{name}
  19. chmod 755 %{_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} basecoin init --home %{_sysconfdir}/%{name} 2B24DEE2364762300168DF19B6C18BCE2D399EA2
  30. #The above command generates a genesis.json file that contains validators. This is wrong, the validator part should be empty. https://github.com/tendermint/basecoin/issues/124
  31. sudo -Hu %{name} tendermint init --home %{_sysconfdir}/%{name}/tendermint
  32. #The above command might need some kind of additional option in the future. https://github.com/tendermint/tendermint/issues/542
  33. chmod 755 %{_sysconfdir}/%{name}/tendermint
  34. #Temporary until https://github.com/tendermint/basecoin/issues/123
  35. rm -f %{_sysconfdir}/%{name}/key.json
  36. rm -f %{_sysconfdir}/%{name}/key2.json
  37. systemctl daemon-reload
  38. %preun
  39. systemctl stop %{name} 2> /dev/null || :
  40. systemctl stop %{name}-service 2> /dev/null || :
  41. %postun
  42. systemctl daemon-reload
  43. %files
  44. %ghost %attr(0755, %{name}, %{name}) %dir %{_sysconfdir}/%{name}
  45. %ghost %attr(0755, %{name}, %{name}) %dir %{_sysconfdir}/%{name}/tendermint
  46. %{_bindir}/*
  47. %{_sysconfdir}/systemd/system/*
  48. %{_sysconfdir}/systemd/system-preset/*
  49. %dir %{_datadir}/%{name}
  50. %{_datadir}/%{name}/*
  51. %dir %{_defaultlicensedir}/%{name}
  52. %doc %{_defaultlicensedir}/%{name}/LICENSE