diff --git a/build/Makefile b/build/Makefile index 97887c7b9..ef5873681 100644 --- a/build/Makefile +++ b/build/Makefile @@ -32,12 +32,12 @@ endif # Here comes the real deal ### -binaries = tendermint basecoin ethermint trackomatron gaia cosmos-sdk -build-binaries = build-tendermint build-basecoin build-ethermint build-trackomatron build-gaia build-cosmos-sdk -package-rpm = package-rpm-tendermint package-rpm-basecoin package-rpm-ethermint package-rpm-trackomatron package-rpm-gaia package-rpm-cosmos-sdk -install-rpm = install-rpm-tendermint install-rpm-basecoin install-rpm-ethermint install-rpm-trackomatron install-rpm-gaia package-rpm-cosmos-sdk -package-deb = package-deb-tendermint package-deb-basecoin package-deb-ethermint package-deb-trackomatron package-deb-gaia package-deb-cosmos-sdk -install-deb = install-deb-tendermint install-deb-basecoin install-deb-ethermint install-deb-trackomatron install-deb-gaia install-deb-cosmos-sdk +binaries = tendermint basecoin ethermint trackomatron gaia basecoin-old +build-binaries = build-tendermint build-basecoin build-ethermint build-trackomatron build-gaia build-basecoin-old +package-rpm = package-rpm-tendermint package-rpm-basecoin package-rpm-ethermint package-rpm-trackomatron package-rpm-gaia package-rpm-basecoin-old +install-rpm = install-rpm-tendermint install-rpm-basecoin install-rpm-ethermint install-rpm-trackomatron install-rpm-gaia package-rpm-basecoin-old +package-deb = package-deb-tendermint package-deb-basecoin package-deb-ethermint package-deb-trackomatron package-deb-gaia package-deb-basecoin-old +install-deb = install-deb-tendermint install-deb-basecoin install-deb-ethermint install-deb-trackomatron install-deb-gaia install-deb-basecoin-old all: $(binaries) build: $(build-binaries) @@ -60,11 +60,12 @@ build-tendermint: git-branch cp $(GOPATH)/src/github.com/tendermint/tendermint/build/tendermint $(GOPATH)/bin @echo "*** Built tendermint" -build-basecoin: git-branch - @echo "*** Building basecoin" +build-basecoin-old: git-branch + @echo "*** Building basecoin-old" go get -d -u github.com/tendermint/basecoin/cmd/basecoin cd $(GOPATH)/src/github.com/tendermint/basecoin && git checkout "$(GIT_BRANCH)" && git pull $(MAKE) -C $(GOPATH)/src/github.com/tendermint/basecoin get_vendor_deps install + @echo "Workaround: basecoin-old does not have a binary that gives the basecoin-old version number." && rm -rf $(GOPATH)/bin/basecoin-old && ln -s $(GOPATH)/bin/basecoin $(GOPATH)/bin/basecoin-old @echo "*** Built basecoin" build-ethermint: git-branch @@ -90,13 +91,12 @@ build-gaia: git-branch $(MAKE) -C $(GOPATH)/src/github.com/cosmos/gaia get_vendor_deps install @echo "*** Built gaia" -build-cosmos-sdk: git-branch - @echo "*** Building cosmos-sdk" +build-basecoin: git-branch + @echo "*** Building basecoin from cosmos-sdk" go get -d -u go github.com/cosmos/cosmos-sdk || echo "Workaround for go downloads." cd $(GOPATH)/src/github.com/cosmos/cosmos-sdk && git checkout "$(GIT_BRANCH)" && git pull $(MAKE) -C $(GOPATH)/src/github.com/cosmos/cosmos-sdk get_vendor_deps install - @echo "Workaround: cosmos-sdk does not have a binary that gives the cosmos-sdk version number." && rm -rf $(GOPATH)/bin/cosmos-sdk && ln -s $(GOPATH)/bin/basecoin $(GOPATH)/bin/cosmos-sdk - @echo "*** Built cosmos-sdk" + @echo "*** Built basecoin from cosmos-sdk" ### # Prepare package files @@ -119,14 +119,13 @@ prepare-files = rm -rf $(build_folder) && mkdir -p $(build_folder) && cp -r ./$( ## prepare-tendermint = -prepare-basecoin = cp $(GOPATH)/bin/basecli $(build_folder)/usr/bin +prepare-basecoin-old = rm -f $(build_folder)/usr/bin/basecoin-old && cp $(GOPATH)/bin/basecli $(GOPATH)/bin/basecoin $(build_folder)/usr/bin prepare-ethermint = mkdir -p $(build_folder)/etc/ethermint && \ cp $(GOPATH)/src/github.com/tendermint/ethermint/setup/genesis.json $(build_folder)/etc/ethermint/genesis.json && \ cp -r $(GOPATH)/src/github.com/tendermint/ethermint/setup/keystore $(build_folder)/etc/ethermint prepare-trackomatron = rm -f $(build_folder)/usr/bin/trackomatron && cp $(GOPATH)/bin/tracko $(GOPATH)/bin/trackocli $(build_folder)/usr/bin prepare-gaia = -prepare-cosmos-sdk = rm -f $(build_folder)/usr/bin/cosmos-sdk && \ - cp $(GOPATH)/bin/basecli $(GOPATH)/bin/basecoin $(GOPATH)/bin/baseserver $(GOPATH)/bin/counter $(GOPATH)/bin/countercli $(GOPATH)/bin/eyes $(GOPATH)/bin/eyescli $(build_folder)/usr/bin +prepare-basecoin = rm -f $(build_folder)/usr/bin/basecoin-old && cp $(GOPATH)/bin/basecli $(GOPATH)/bin/basecoin $(GOPATH)/bin/baseserver $(GOPATH)/bin/counter $(GOPATH)/bin/countercli $(GOPATH)/bin/eyes $(GOPATH)/bin/eyescli $(build_folder)/usr/bin ### # Package the binary for CentOS/RedHat (RPM) and Debian/Ubuntu (DEB) @@ -146,9 +145,10 @@ package-rpm-%: folder-% mkdir -p {SPECS,tmp} - cp ./spectemplates/$*.spec SPECS + ./generate-spec $* spectemplates SPECS sed -i "s/@VERSION@/$($*_version)/" SPECS/$*.spec sed -i "s/@BUILD_NUMBER@/$(BUILD_NUMBER)/" SPECS/$*.spec + sed -i "s/@PACKAGE_NAME@/$*/" SPECS/$*.spec rpmbuild -bb SPECS/$*.spec --define "_topdir `pwd`" --define "_tmppath `pwd`/tmp" ./sign RPMS/x86_64/$*-$($*_version)-$(BUILD_NUMBER).x86_64.rpm "$(gpg_key)" "`which gpg`" diff --git a/build/basecoin/DEBIAN/control b/build/basecoin/DEBIAN/control index 7d86a71b5..c5857eb5d 100644 --- a/build/basecoin/DEBIAN/control +++ b/build/basecoin/DEBIAN/control @@ -3,7 +3,7 @@ Section: net Priority: optional Maintainer: Greg Szabo Build-Depends: debhelper (>=9) -Depends: tendermint (>=0.10.0) +Depends: tendermint (>=0.11.0) Standards-Version: 3.9.6 Homepage: https://tendermint.com Package: basecoin diff --git a/build/basecoin/etc/systemd/system/basecoin-server.service b/build/basecoin/etc/systemd/system/basecoin-server.service index 62392d52a..aa8a93056 100644 --- a/build/basecoin/etc/systemd/system/basecoin-server.service +++ b/build/basecoin/etc/systemd/system/basecoin-server.service @@ -3,7 +3,8 @@ Description=Basecoin server Requires=network-online.target BindTo=basecoin.service PartOf=basecoin.service -After=network-online.target basecoin.service +Before=basecoin.service +After=network-online.target PropagatesReloadTo=basecoin.service ReloadPropagatedFrom=basecoin.service @@ -18,6 +19,6 @@ ExecReload=/bin/kill -HUP $MAINPID KillSignal=SIGTERM [Install] -WantedBy=multi-user.target basecoin.service +WantedBy=multi-user.target Also=basecoin.service diff --git a/build/basecoin/etc/systemd/system/basecoin.service b/build/basecoin/etc/systemd/system/basecoin.service index f806ef481..3b62e75bd 100644 --- a/build/basecoin/etc/systemd/system/basecoin.service +++ b/build/basecoin/etc/systemd/system/basecoin.service @@ -7,8 +7,7 @@ BindTo=basecoin-server.service #propagates stop and restart (one-way) PartOf=basecoin-server.service #order -Before=basecoin-server.service -After=network-online.target +After=network-online.target basecoin-server.service #propagates reload PropagatesReloadTo=basecoin-server.service ReloadPropagatedFrom=basecoin-server.service @@ -24,6 +23,6 @@ ExecReload=/bin/kill -HUP $MAINPID KillSignal=SIGTERM [Install] -WantedBy=multi-user.target +WantedBy=multi-user.target basecoin-server.service Also=basecoin-server.service diff --git a/build/generate-spec b/build/generate-spec new file mode 100755 index 000000000..4ca60a1d4 --- /dev/null +++ b/build/generate-spec @@ -0,0 +1,36 @@ +#!/bin/bash + +if [ $# -ne 3 ]; then + echo "Usage: $0 " + exit 1 +fi + +app=$1 +src=$2 +dst=$3 + +# Find spectemplate +if [ ! -f "$src/$app.spec" ]; then + if [ ! -f "$src/app-template.spec" ]; then + echo "Source template not found." + exit 1 + else + srcfile="$src/app-template.spec" + fi +else + srcfile="$src/$app.spec" +fi + +# Copy spectemplate to SPECS +cp "$srcfile" "$dst/$app.spec" + +# Apply any variables defined in .data +if [ -f "$src/$app.data" ]; then + srcdata="$src/$app.data" + source "$srcdata" + for var in `grep -v -e ^# -e ^\s*$ "$srcdata" | grep = | sed 's/\s*=.*$//'` + do + sed -i "s\\@${var}@\\${!var}\\g" "$dst/$app.spec" + done +fi + diff --git a/build/spectemplates/gaia.spec b/build/spectemplates/app-template.spec similarity index 65% rename from build/spectemplates/gaia.spec rename to build/spectemplates/app-template.spec index a09e05cb7..8096deaa2 100644 --- a/build/spectemplates/gaia.spec +++ b/build/spectemplates/app-template.spec @@ -5,21 +5,23 @@ Release: @BUILD_NUMBER@ %define debug_package %{nil} %define __os_install_post %{nil} -Name: gaia -Summary: gaia - Tendermint Cosmos delegation game chain +Name: @PACKAGE_NAME@ +Summary: @PACKAGE_SUMMARY@ License: Apache 2.0 -URL: https://cosmos.network/ +URL: @PACKAGE_URL@ Packager: Greg Szabo -Requires: tendermint >= 0.10.0 -#Requires(pre): useradd +Requires: tendermint >= 0.11.0 +@PACKAGE_ADDITIONAL_HEADER@ %description -Gaia description comes later. +@PACKAGE_DESCRIPTION@ %pre if ! %{__grep} -q '^%{name}:' /etc/passwd ; then - useradd -k /dev/null -r -m -b %{_sysconfdir} %{name} + useradd -r -b %{_sysconfdir} %{name} + mkdir -p %{_sysconfdir}/%{name} chmod 755 %{_sysconfdir}/%{name} + chown %{name}.%{name} %{_sysconfdir}/%{name} fi %prep @@ -33,12 +35,9 @@ cd %{name}-%{version}-%{release} %{__cp} -a * %{buildroot} %post -sudo -Hu %{name} gaia init --home %{_sysconfdir}/%{name} 2B24DEE2364762300168DF19B6C18BCE2D399EA2 +sudo -Hu %{name} %{name} init --home %{_sysconfdir}/%{name} 2B24DEE2364762300168DF19B6C18BCE2D399EA2 #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 -sudo -Hu %{name} tendermint init --home %{_sysconfdir}/%{name}/tendermint -#The above command might need some kind of additional option in the future. https://github.com/tendermint/tendermint/issues/542 - -chmod 755 %{_sysconfdir}/%{name}/tendermint +sudo -Hu %{name} tendermint init --home %{_sysconfdir}/%{name} #Temporary until https://github.com/tendermint/basecoin/issues/123 rm -f %{_sysconfdir}/%{name}/key.json @@ -55,7 +54,6 @@ systemctl daemon-reload %files %ghost %attr(0755, %{name}, %{name}) %dir %{_sysconfdir}/%{name} -%ghost %attr(0755, %{name}, %{name}) %dir %{_sysconfdir}/%{name}/tendermint %{_bindir}/* %{_sysconfdir}/systemd/system/* %{_sysconfdir}/systemd/system-preset/* diff --git a/build/spectemplates/basecoin.data b/build/spectemplates/basecoin.data new file mode 100644 index 000000000..b74d64309 --- /dev/null +++ b/build/spectemplates/basecoin.data @@ -0,0 +1,5 @@ +PACKAGE_SUMMARY="basecoin is a Proof-of-Stake cryptocurrency and framework" +PACKAGE_URL="https://cosmos.network/" +PACKAGE_ADDITIONAL_HEADER="Provides: basecli" +PACKAGE_DESCRIPTION="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." + diff --git a/build/spectemplates/basecoin.spec b/build/spectemplates/basecoin.spec deleted file mode 100644 index 01321b767..000000000 --- a/build/spectemplates/basecoin.spec +++ /dev/null @@ -1,69 +0,0 @@ -Version: @VERSION@ -Release: @BUILD_NUMBER@ - -%define __spec_install_post %{nil} -%define debug_package %{nil} -%define __os_install_post %{nil} - -Name: basecoin -Summary: basecoin is a Proof-of-Stake cryptocurrency and framework -License: Apache 2.0 -URL: https://tendermint.com/ -Packager: Greg Szabo -Requires: tendermint >= 0.11.0 -Provides: basecli - -%description -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. - -%pre -if ! %{__grep} -q '^%{name}:' /etc/passwd ; then - echo "`date`: useradd -k /dev/null -r -m -b %{_sysconfdir} %{name}" >> /tmp/rpmdebug - set >> /tmp/rpmdebug - echo "---" >> /tmp/rpmdebug - useradd -k /dev/null -r -m -b %{_sysconfdir} %{name} - chmod 755 %{_sysconfdir}/%{name} -fi - -%prep -# Nothing to do here. - It is done in the Makefile. - -%build -# Nothing to do here. - -%install -cd %{name}-%{version}-%{release} -%{__cp} -a * %{buildroot} - -%post -sudo -Hu %{name} basecoin init --home %{_sysconfdir}/%{name} 2B24DEE2364762300168DF19B6C18BCE2D399EA2 -#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 -sudo -Hu %{name} tendermint init --home %{_sysconfdir}/%{name}/tendermint -#The above command might need some kind of additional option in the future. https://github.com/tendermint/tendermint/issues/542 - -chmod 755 %{_sysconfdir}/%{name}/tendermint - -#Temporary until https://github.com/tendermint/basecoin/issues/123 -rm -f %{_sysconfdir}/%{name}/key.json -rm -f %{_sysconfdir}/%{name}/key2.json - -systemctl daemon-reload - -%preun -systemctl stop %{name} 2> /dev/null || : -systemctl stop %{name}-service 2> /dev/null || : - -%postun -systemctl daemon-reload - -%files -%ghost %attr(0755, %{name}, %{name}) %dir %{_sysconfdir}/%{name} -%ghost %attr(0755, %{name}, %{name}) %dir %{_sysconfdir}/%{name}/tendermint -%{_bindir}/* -%{_sysconfdir}/systemd/system/* -%{_sysconfdir}/systemd/system-preset/* -%dir %{_datadir}/%{name} -%{_datadir}/%{name}/* -%dir %{_defaultlicensedir}/%{name} -%doc %{_defaultlicensedir}/%{name}/LICENSE - diff --git a/build/spectemplates/cosmos-sdk.data b/build/spectemplates/cosmos-sdk.data new file mode 100644 index 000000000..5b00998a0 --- /dev/null +++ b/build/spectemplates/cosmos-sdk.data @@ -0,0 +1,5 @@ +PACKAGE_SUMMARY="cosmos-sdk is a Proof-of-Stake framework" +PACKAGE_URL="https://cosmos.network/" +PACKAGE_ADDITIONAL_HEADER="Provides: basecoin basecli" +PACKAGE_DESCRIPTION="Cosmos-SDK is a general purpose framework for the Tendermint consensus engine to form a Proof-of-Stake cryptocurrency." + diff --git a/build/spectemplates/cosmos-sdk.spec b/build/spectemplates/cosmos-sdk.spec deleted file mode 100644 index 56697c6f5..000000000 --- a/build/spectemplates/cosmos-sdk.spec +++ /dev/null @@ -1,67 +0,0 @@ -Version: @VERSION@ -Release: @BUILD_NUMBER@ - -%define __spec_install_post %{nil} -%define debug_package %{nil} -%define __os_install_post %{nil} - -Name: cosmos-sdk -Summary: cosmos-sdk is a Proof-of-Stake framework -License: Apache 2.0 -URL: https://cosmos.network/ -Packager: Greg Szabo -Requires: tendermint >= 0.10.0 -Provides: basecoin basecli -#Requires(pre): useradd - -%description -Cosmos-SDK is a general purpose framework for the Tendermint consensus engine to form a Proof-of-Stake cryptocurrency. - -%pre -if ! %{__grep} -q '^%{name}:' /etc/passwd ; then - useradd -k /dev/null -r -m -b %{_sysconfdir} %{name} - chmod 755 %{_sysconfdir}/%{name} -fi - -%prep -# Nothing to do here. - It is done in the Makefile. - -%build -# Nothing to do here. - -%install -cd %{name}-%{version}-%{release} -%{__cp} -a * %{buildroot} - -%post -sudo -Hu %{name} basecoin init --home %{_sysconfdir}/%{name} 2B24DEE2364762300168DF19B6C18BCE2D399EA2 -#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 -sudo -Hu %{name} tendermint init --home %{_sysconfdir}/%{name}/tendermint -#The above command might need some kind of additional option in the future. https://github.com/tendermint/tendermint/issues/542 - -chmod 755 %{_sysconfdir}/%{name}/tendermint - -#Temporary until https://github.com/tendermint/basecoin/issues/123 -rm -f %{_sysconfdir}/%{name}/key.json -rm -f %{_sysconfdir}/%{name}/key2.json - -systemctl daemon-reload - -%preun -systemctl stop %{name} 2> /dev/null || : -systemctl stop %{name}-service 2> /dev/null || : - -%postun -systemctl daemon-reload - -%files -%ghost %attr(0755, %{name}, %{name}) %dir %{_sysconfdir}/%{name} -%ghost %attr(0755, %{name}, %{name}) %dir %{_sysconfdir}/%{name}/tendermint -%{_bindir}/* -%{_sysconfdir}/systemd/system/* -%{_sysconfdir}/systemd/system-preset/* -%dir %{_datadir}/%{name} -%{_datadir}/%{name}/* -%dir %{_defaultlicensedir}/%{name} -%doc %{_defaultlicensedir}/%{name}/LICENSE - diff --git a/build/spectemplates/ethermint.data b/build/spectemplates/ethermint.data new file mode 100644 index 000000000..b736c0bb8 --- /dev/null +++ b/build/spectemplates/ethermint.data @@ -0,0 +1,5 @@ +PACKAGE_SUMMARY="ethermint enables ethereum as an ABCI application on tendermint and the COSMOS hub" +PACKAGE_URL="https://tendermint.com/" +PACKAGE_ADDITIONAL_HEADER="Provides: basecli" +PACKAGE_DESCRIPTION="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." + diff --git a/build/spectemplates/ethermint.spec b/build/spectemplates/ethermint.spec index 72fbe2b4b..96da8cf6a 100644 --- a/build/spectemplates/ethermint.spec +++ b/build/spectemplates/ethermint.spec @@ -5,21 +5,23 @@ Release: @BUILD_NUMBER@ %define debug_package %{nil} %define __os_install_post %{nil} -Name: ethermint -Summary: ethermint enables ethereum as an ABCI application on tendermint and the COSMOS hub +Name: @PACKAGE_NAME@ +Summary: @PACKAGE_SUMMARY@ License: Apache 2.0 -URL: https://tendermint.com/ +URL: @PACKAGE_URL@ Packager: Greg Szabo -Requires: tendermint >= 0.10.0 -#Requires(pre): useradd +Requires: tendermint >= 0.11.0 +@PACKAGE_ADDITIONAL_HEADER@ %description -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. +@PACKAGE_DESCRIPTION@ %pre if ! %{__grep} -q '^%{name}:' /etc/passwd ; then - useradd -k /dev/null -r -m -b %{_sysconfdir} %{name} + useradd -r -b %{_sysconfdir} %{name} + mkdir -p %{_sysconfdir}/%{name} chmod 755 %{_sysconfdir}/%{name} + chown %{name}.%{name} %{_sysconfdir}/%{name} fi %prep @@ -33,10 +35,9 @@ cd %{name}-%{version}-%{release} %{__cp} -a * %{buildroot} %post -sudo -Hu %{name} %{_bindir}/%{name} --datadir %{_sysconfdir}/%{name} init %{_sysconfdir}/%{name}/genesis.json -sudo -Hu %{name} tendermint init --home %{_sysconfdir}/%{name}/tendermint - -chmod 755 %{_sysconfdir}/%{name}/tendermint +sudo -Hu %{name} %{name} --datadir %{_sysconfdir}/%{name} init %{_sysconfdir}/%{name}/genesis.json +#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 +sudo -Hu %{name} tendermint init --home %{_sysconfdir}/%{name} systemctl daemon-reload @@ -52,7 +53,6 @@ systemctl daemon-reload %config(noreplace) %attr(0644, %{name}, %{name}) %{_sysconfdir}/%{name}/genesis.json %attr(0755, %{name}, %{name}) %dir %{_sysconfdir}/%{name}/keystore %attr(0644, %{name}, %{name}) %{_sysconfdir}/%{name}/keystore/* -%ghost %attr(0755, %{name}, %{name}) %dir %{_sysconfdir}/%{name}/tendermint %{_bindir}/* %{_sysconfdir}/systemd/system/* %{_sysconfdir}/systemd/system-preset/* diff --git a/build/spectemplates/gaia.data b/build/spectemplates/gaia.data new file mode 100644 index 000000000..7152b1b51 --- /dev/null +++ b/build/spectemplates/gaia.data @@ -0,0 +1,5 @@ +PACKAGE_SUMMARY="gaia - Tendermint Cosmos delegation game chain" +PACKAGE_URL="https://cosmos.network/" +PACKAGE_ADDITIONAL_HEADER="" +PACKAGE_DESCRIPTION="Gaia description comes later." + diff --git a/build/spectemplates/trackomatron.data b/build/spectemplates/trackomatron.data new file mode 100644 index 000000000..daaad64b3 --- /dev/null +++ b/build/spectemplates/trackomatron.data @@ -0,0 +1,5 @@ +PACKAGE_SUMMARY="Trackomatron - Track invoices on the blockchain" +PACKAGE_URL="https://tendermint.com/" +PACKAGE_ADDITIONAL_HEADER="" +PACKAGE_DESCRIPTION="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)." + diff --git a/build/spectemplates/trackomatron.spec b/build/spectemplates/trackomatron.spec index 5034658ea..4d924805c 100644 --- a/build/spectemplates/trackomatron.spec +++ b/build/spectemplates/trackomatron.spec @@ -5,21 +5,23 @@ Release: @BUILD_NUMBER@ %define debug_package %{nil} %define __os_install_post %{nil} -Name: trackomatron -Summary: Trackomatron - Track invoices on the blockchain +Name: @PACKAGE_NAME@ +Summary: @PACKAGE_SUMMARY@ License: Apache 2.0 -URL: https://tendermint.com/ +URL: @PACKAGE_URL@ Packager: Greg Szabo -Requires: tendermint >= 0.10.0 -#Requires(pre): useradd +Requires: tendermint >= 0.11.0 +@PACKAGE_ADDITIONAL_HEADER@ %description -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). +@PACKAGE_DESCRIPTION@ %pre if ! %{__grep} -q '^%{name}:' /etc/passwd ; then - useradd -k /dev/null -r -m -b %{_sysconfdir} %{name} + useradd -r -b %{_sysconfdir} %{name} + mkdir -p %{_sysconfdir}/%{name} chmod 755 %{_sysconfdir}/%{name} + chown %{name}.%{name} %{_sysconfdir}/%{name} fi %prep @@ -35,10 +37,7 @@ cd %{name}-%{version}-%{release} %post sudo -Hu %{name} tracko init --home %{_sysconfdir}/%{name} 2B24DEE2364762300168DF19B6C18BCE2D399EA2 #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 -sudo -Hu %{name} tendermint init --home %{_sysconfdir}/%{name}/tendermint -#The above command might need some kind of additional option in the future. https://github.com/tendermint/tendermint/issues/542 - -chmod 755 %{_sysconfdir}/%{name}/tendermint +sudo -Hu %{name} tendermint init --home %{_sysconfdir}/%{name} #Temporary until https://github.com/tendermint/basecoin/issues/123 rm -f %{_sysconfdir}/%{name}/key.json @@ -55,7 +54,6 @@ systemctl daemon-reload %files %ghost %attr(0755, %{name}, %{name}) %dir %{_sysconfdir}/%{name} -%ghost %attr(0755, %{name}, %{name}) %dir %{_sysconfdir}/%{name}/tendermint %{_bindir}/* %{_sysconfdir}/systemd/system/* %{_sysconfdir}/systemd/system-preset/*