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.

66 lines
1.8 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: gaia
  7. Summary: gaia - Tendermint Cosmos delegation game chain
  8. License: Apache 2.0
  9. URL: https://cosmos.network/
  10. Packager: Greg Szabo
  11. Requires: tendermint >= 0.10.0
  12. #Requires(pre): useradd
  13. %description
  14. Gaia description comes later.
  15. %pre
  16. if ! %{__grep} -q '^%{name}:' /etc/passwd ; then
  17. useradd -k /dev/null -r -m -b %{_sysconfdir} %{name}
  18. chmod 755 %{_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} gaia 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. chmod 755 %{_sysconfdir}/%{name}/tendermint
  33. #Temporary until https://github.com/tendermint/basecoin/issues/123
  34. rm -f %{_sysconfdir}/%{name}/key.json
  35. rm -f %{_sysconfdir}/%{name}/key2.json
  36. systemctl daemon-reload
  37. %preun
  38. systemctl stop %{name} 2> /dev/null || :
  39. systemctl stop %{name}-service 2> /dev/null || :
  40. %postun
  41. systemctl daemon-reload
  42. %files
  43. %ghost %attr(0755, %{name}, %{name}) %dir %{_sysconfdir}/%{name}
  44. %ghost %attr(0755, %{name}, %{name}) %dir %{_sysconfdir}/%{name}/tendermint
  45. %{_bindir}/*
  46. %{_sysconfdir}/systemd/system/*
  47. %{_sysconfdir}/systemd/system-preset/*
  48. %dir %{_datadir}/%{name}
  49. %{_datadir}/%{name}/*
  50. %dir %{_defaultlicensedir}/%{name}
  51. %doc %{_defaultlicensedir}/%{name}/LICENSE