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.

70 lines
2.3 KiB

  1. %define __spec_install_post %{nil}
  2. %define debug_package %{nil}
  3. %define __os_install_post %{nil}
  4. Name: ethermint
  5. Summary: ethermint enables ethereum as an ABCI application on tendermint and the COSMOS hub
  6. License: Apache 2.0
  7. URL: https://tendermint.com/
  8. Packager: Greg Szabo
  9. Requires: tendermint >= 0.10.0
  10. Requires(pre): /sbin/useradd
  11. %description
  12. Ethermint enables ethereum to run as an ABCI application on tendermint and the COSMOS hub. This application allows you to get all the benefits of ethereum without having to run your own miners.
  13. %pre
  14. if ! %{__grep} -q '^%{name}:' /etc/passwd ; then
  15. useradd -k /dev/null -r -m -b %{_sysconfdir} %{name}
  16. fi
  17. %prep
  18. test -d "$GOPATH" || echo "GOPATH not set"
  19. test -d "$GOPATH"
  20. %{__mkdir_p} %{name}-%{version}
  21. cd %{name}-%{version}
  22. %{__mkdir_p} .%{_bindir} .%{_defaultlicensedir}/%{name} .%{_sysconfdir}/%{name}/tendermint .%{_sysconfdir}/systemd/system .%{_sysconfdir}/systemd/system-preset
  23. %{__cp} $GOPATH/bin/%{name} .%{_bindir}
  24. %{__cp} $GOPATH/src/github.com/tendermint/%{name}/LICENSE .%{_defaultlicensedir}/%{name}
  25. %{__cp} $GOPATH/src/github.com/tendermint/%{name}/setup/genesis.json .%{_sysconfdir}/%{name}/genesis.json
  26. %{__cp} -r $GOPATH/src/github.com/tendermint/%{name}/setup/keystore .%{_sysconfdir}/%{name}
  27. cp -r %{_topdir}/extrafiles/ethermint/* ./
  28. %{__chmod} -Rf a+rX,u+w,g-w,o-w .
  29. %build
  30. # Nothing to do here.
  31. %install
  32. cd %{name}-%{version}
  33. %{__cp} -a * %{buildroot}
  34. %post
  35. sudo -Hu %{name} %{_bindir}/%{name} --datadir %{_sysconfdir}/%{name} init %{_sysconfdir}/%{name}/genesis.json
  36. sudo -Hu %{name} tendermint init --home %{_sysconfdir}/%{name}/tendermint
  37. systemctl daemon-reload
  38. %preun
  39. systemctl stop %{name} 2> /dev/null || :
  40. systemctl stop %{name}-service 2> /dev/null || :
  41. %postun
  42. #userdel %{name}
  43. systemctl daemon-reload
  44. %files
  45. %attr(0755, %{name}, %{name}) %dir %{_sysconfdir}/%{name}
  46. %config(noreplace) %attr(0644, %{name}, %{name}) %{_sysconfdir}/%{name}/genesis.json
  47. %attr(0755, %{name}, %{name}) %dir %{_sysconfdir}/%{name}/keystore
  48. %attr(0644, %{name}, %{name}) %{_sysconfdir}/%{name}/keystore/*
  49. %attr(0755, %{name}, %{name}) %dir %{_sysconfdir}/%{name}/tendermint
  50. %{_bindir}/*
  51. %{_sysconfdir}/systemd/system/*
  52. %{_sysconfdir}/systemd/system-preset/*
  53. %dir %{_defaultlicensedir}/%{name}
  54. %doc %{_defaultlicensedir}/%{name}/LICENSE