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.

74 lines
2.3 KiB

  1. %define __spec_install_post %{nil}
  2. %define debug_package %{nil}
  3. %define __os_install_post %{nil}
  4. Name: trackomatron
  5. Summary: Trackomatron - Track invoices on the blockchain
  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. This software is intended to create a space to easily send invoices between and within institutions. Firstly, the commands of trackmatron are separated into two broad categories: submitting information to the blockchain (transactions), and retrieving information from the blockchain (query).
  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
  23. %{__cp} $GOPATH/bin/tracko $GOPATH/bin/trackocli .%{_bindir}
  24. %{__cp} $GOPATH/src/github.com/tendermint/%{name}/LICENSE .%{_defaultlicensedir}/%{name}
  25. cp -r %{_topdir}/extrafiles/trackomatron/* ./
  26. %{__chmod} -Rf a+rX,u+w,g-w,o-w .
  27. %build
  28. # Nothing to do here.
  29. %install
  30. cd %{name}-%{version}
  31. %{__cp} -a * %{buildroot}
  32. %post
  33. sudo -Hu %{name} tracko init --home %{_sysconfdir}/%{name} 2B24DEE2364762300168DF19B6C18BCE2D399EA2
  34. #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
  35. sudo -Hu %{name} tendermint init --home %{_sysconfdir}/%{name}/tendermint
  36. #The above command might need some kind of additional option in the future. https://github.com/tendermint/tendermint/issues/542
  37. #Temporary until https://github.com/tendermint/basecoin/issues/123
  38. rm -f %{_sysconfdir}/%{name}/key.json
  39. rm -f %{_sysconfdir}/%{name}/key2.json
  40. systemctl daemon-reload
  41. %preun
  42. systemctl stop %{name} 2> /dev/null || :
  43. systemctl stop %{name}-service 2> /dev/null || :
  44. %postun
  45. systemctl daemon-reload
  46. %files
  47. %attr(0755, %{name}, %{name}) %dir %{_sysconfdir}/%{name}
  48. %attr(0755, %{name}, %{name}) %dir %{_sysconfdir}/%{name}/tendermint
  49. %{_bindir}/*
  50. %{_sysconfdir}/systemd/system/*
  51. %{_sysconfdir}/systemd/system-preset/*
  52. %dir %{_datadir}/%{name}
  53. %{_datadir}/%{name}/*
  54. %dir %{_defaultlicensedir}/%{name}
  55. %doc %{_defaultlicensedir}/%{name}/LICENSE