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.

64 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: basecoin
  7. Summary: basecoin is a Proof-of-Stake cryptocurrency and framework
  8. License: Apache 2.0
  9. URL: https://tendermint.com/
  10. Packager: Greg Szabo
  11. Requires: tendermint >= 0.10.0
  12. Provides: basecli
  13. Requires(pre): /sbin/useradd
  14. %description
  15. Basecoin is an ABCI application designed to be used with the Tendermint consensus engine to form a Proof-of-Stake cryptocurrency. It also provides a general purpose framework for extending the feature-set of the cryptocurrency by implementing plugins.
  16. %pre
  17. if ! %{__grep} -q '^%{name}:' /etc/passwd ; then
  18. useradd -k /dev/null -r -m -b %{_sysconfdir} %{name}
  19. fi
  20. %prep
  21. # Nothing to do here. - It is done in the Makefile.
  22. %build
  23. # Nothing to do here.
  24. %install
  25. cd %{name}-%{version}-%{release}
  26. %{__cp} -a * %{buildroot}
  27. %post
  28. sudo -Hu %{name} basecoin init --home %{_sysconfdir}/%{name} 2B24DEE2364762300168DF19B6C18BCE2D399EA2
  29. #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
  30. sudo -Hu %{name} tendermint init --home %{_sysconfdir}/%{name}/tendermint
  31. #The above command might need some kind of additional option in the future. https://github.com/tendermint/tendermint/issues/542
  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. %ghost %attr(0755, %{name}, %{name}) %dir %{_sysconfdir}/%{name}/tendermint
  44. %{_bindir}/*
  45. %{_sysconfdir}/systemd/system/*
  46. %{_sysconfdir}/systemd/system-preset/*
  47. %dir %{_datadir}/%{name}
  48. %{_datadir}/%{name}/*
  49. %dir %{_defaultlicensedir}/%{name}
  50. %doc %{_defaultlicensedir}/%{name}/LICENSE