Browse Source

Added Debian packaging and package repository for basecoin and ethermint

pull/1943/head
Greg Szabo 8 years ago
parent
commit
c996b13dae
25 changed files with 569 additions and 101 deletions
  1. +95
    -69
      devops/rpmbuild/Makefile
  2. +6
    -0
      devops/rpmbuild/extrafiles/DEBIAN-basecoin/changelog
  3. +0
    -0
      devops/rpmbuild/extrafiles/DEBIAN-basecoin/compat
  4. +15
    -0
      devops/rpmbuild/extrafiles/DEBIAN-basecoin/control
  5. +21
    -0
      devops/rpmbuild/extrafiles/DEBIAN-basecoin/copyright
  6. +64
    -0
      devops/rpmbuild/extrafiles/DEBIAN-basecoin/postinst
  7. +45
    -0
      devops/rpmbuild/extrafiles/DEBIAN-basecoin/postrm
  8. +37
    -0
      devops/rpmbuild/extrafiles/DEBIAN-basecoin/preinst
  9. +39
    -0
      devops/rpmbuild/extrafiles/DEBIAN-basecoin/prerm
  10. +1
    -1
      devops/rpmbuild/extrafiles/DEBIAN-ethermint/changelog
  11. +1
    -0
      devops/rpmbuild/extrafiles/DEBIAN-ethermint/compat
  12. +15
    -0
      devops/rpmbuild/extrafiles/DEBIAN-ethermint/control
  13. +21
    -0
      devops/rpmbuild/extrafiles/DEBIAN-ethermint/copyright
  14. +71
    -0
      devops/rpmbuild/extrafiles/DEBIAN-ethermint/postinst
  15. +45
    -0
      devops/rpmbuild/extrafiles/DEBIAN-ethermint/postrm
  16. +37
    -0
      devops/rpmbuild/extrafiles/DEBIAN-ethermint/preinst
  17. +39
    -0
      devops/rpmbuild/extrafiles/DEBIAN-ethermint/prerm
  18. +6
    -0
      devops/rpmbuild/extrafiles/DEBIAN-tendermint/changelog
  19. +1
    -0
      devops/rpmbuild/extrafiles/DEBIAN-tendermint/compat
  20. +1
    -1
      devops/rpmbuild/extrafiles/DEBIAN-tendermint/control
  21. +0
    -0
      devops/rpmbuild/extrafiles/DEBIAN-tendermint/copyright
  22. +1
    -1
      devops/rpmbuild/extrafiles/basecoin/basecoin.service
  23. +0
    -29
      devops/rpmbuild/extrafiles/binarydescription
  24. +4
    -0
      devops/rpmbuild/spectemplates/basecoin.spec
  25. +4
    -0
      devops/rpmbuild/spectemplates/ethermint.spec

+ 95
- 69
devops/rpmbuild/Makefile View File

@ -34,83 +34,81 @@ endif
binaries = tendermint basecoin ethermint
build-binaries = build-tendermint build-basecoin build-ethermint
package-binaries = package-tendermint package-basecoin package-ethermint
install-binaries = install-tendermint install-basecoin install-ethermint
package-rpm = package-rpm-tendermint package-rpm-basecoin package-rpm-ethermint
install-rpm = install-rpm-tendermint install-rpm-basecoin install-rpm-ethermint
package-deb = package-deb-tendermint package-deb-basecoin package-deb-ethermint
install-deb = install-deb-tendermint install-deb-basecoin install-deb-ethermint
all: $(binaries)
build: $(build-binaries)
package: $(package-binaries)
install: $(install-binaries)
$(binaries): %: build-% package-% install-% ;
package: $(package-rpm) $(package-deb)
install: $(install-rpm) $(install-deb)
$(binaries): %: build-% package-rpm-% install-rpm-% package-deb-% install-deb-% ;
###
# Building the binaries is not in the spec file, because in the spec file you already need to know the version number
###
build-tendermint:
$(info Building tendermint)
@echo "*** Building tendermint"
go get -u github.com/tendermint/tendermint/cmd/tendermint
@echo "*** Built tendermint"
build-basecoin:
$(info Building basecoin)
@echo "*** Building basecoin"
go get -u github.com/tendermint/basecoin/cmd/basecoin
$(info Building basecli)
@echo "Building basecli"
$(MAKE) -C $(GOPATH)/src/github.com/tendermint/basecoin get_vendor_deps
go get -u github.com/tendermint/basecoin/cmd/basecli
@echo "*** Built basecoin"
build-ethermint:
$(info Building ethermint)
@echo "*** Building ethermint"
go get -d -u github.com/tendermint/ethermint/cmd/ethermint
$(MAKE) -C $(GOPATH)/src/github.com/tendermint/ethermint get_vendor_deps
$(MAKE) -C $(GOPATH)/src/github.com/tendermint/ethermint build
cp $(GOPATH)/src/github.com/tendermint/ethermint/build/ethermint $(GOPATH)/bin
@echo "*** Built ethermint"
prepare-spec-%: $(GOPATH)/bin/%
$(info Preparing build for $*)
version-%: $(GOPATH)/bin/%
if [ -z "$(BUILD_NUMBER)" ]; then echo "BUILD_NUMBER not set" ; false ; fi
mkdir -p {SPECS,tmp}
$(eval $*_version=$(shell $< version | cut -d- -f1 ))
prepare-spec-%: version-%
mkdir -p {SPECS,tmp}
echo "Version: $($*_version)" > SPECS/$*.spec
echo "Release: $(BUILD_NUMBER)" >> SPECS/$*.spec
cat spectemplates/$*.spec >> SPECS/$*.spec
package-tendermint: prepare-spec-tendermint
$(info Packaging tendermint version $(tendermint_version))
rpmbuild -bb SPECS/tendermint.spec
./sign RPMS/x86_64/tendermint-$(tendermint_version)-$$BUILD_NUMBER.x86_64.rpm
rpm -Kv RPMS/x86_64/tendermint-$(tendermint_version)-$$BUILD_NUMBER.x86_64.rpm
package-basecoin: prepare-spec-basecoin
$(info Packaging basecoin version $(basecoin_version))
rpmbuild -bb SPECS/basecoin.spec
./sign RPMS/x86_64/basecoin-$(basecoin_version)-$$BUILD_NUMBER.x86_64.rpm
rpm -Kv RPMS/x86_64/basecoin-$(basecoin_version)-$$BUILD_NUMBER.x86_64.rpm
package-ethermint: prepare-spec-ethermint ;
$(info Packaging ethermint version $(ethermint_version))
rpmbuild -bb SPECS/ethermint.spec
./sign RPMS/x86_64/ethermint-$(ethermint_version)-$$BUILD_NUMBER.x86_64.rpm
rpm -Kv RPMS/x86_64/ethermint-$(ethermint_version)-$$BUILD_NUMBER.x86_64.rpm
package-debian-tendermint: package-tendermint
$(info Packaging Debian tendermint version $(tendermint_version)-$(BUILD_NUMBER))
rm -rf BUILD/tendermint-$(tendermint_version)-$(BUILD_NUMBER) tmp/_gpg tmp/_gpgbuilder tmp/debian-binary tmp/control.tar.gz tmp/data.tar.xz
cp -r BUILD/tendermint-$(tendermint_version) BUILD/tendermint-$(tendermint_version)-$(BUILD_NUMBER)
cp -r extrafiles/DEBIAN BUILD/tendermint-$(tendermint_version)-$(BUILD_NUMBER)/
sed -i "s/@TENDERMINT_VERSION@/$(tendermint_version)-$(BUILD_NUMBER)/" BUILD/tendermint-$(tendermint_version)-$(BUILD_NUMBER)/DEBIAN/changelog
sed -i "s/@STABILITY@/stable/" BUILD/tendermint-$(tendermint_version)-$(BUILD_NUMBER)/DEBIAN/changelog
sed -i "s/@DATETIMESTAMP@/`date +%a,\ %d\ %b\ %Y\ %T\ %z`/" BUILD/tendermint-$(tendermint_version)-$(BUILD_NUMBER)/DEBIAN/changelog
sed -i "s/@TENDERMINT_VERSION@/$(tendermint_version)-$(BUILD_NUMBER)/" BUILD/tendermint-$(tendermint_version)-$(BUILD_NUMBER)/DEBIAN/control
rm -rf BUILD/tendermint-$(tendermint_version)-$(BUILD_NUMBER)/usr/share/licenses
mkdir -p BUILD/tendermint-$(tendermint_version)-$(BUILD_NUMBER)/usr/share/doc/tendermint
cp BUILD/tendermint-$(tendermint_version)-$(BUILD_NUMBER)/DEBIAN/copyright BUILD/tendermint-$(tendermint_version)-$(BUILD_NUMBER)/usr/share/doc/tendermint
gzip -c BUILD/tendermint-$(tendermint_version)-$(BUILD_NUMBER)/DEBIAN/changelog > BUILD/tendermint-$(tendermint_version)-$(BUILD_NUMBER)/usr/share/doc/tendermint/changelog.Debian.gz
gzip -c BUILD/tendermint-$(tendermint_version)-$(BUILD_NUMBER)/DEBIAN/changelog > BUILD/tendermint-$(tendermint_version)-$(BUILD_NUMBER)/usr/share/doc/tendermint/changelog.Debian.amd64.gz
sed -i "s/@INSTALLEDSIZE@/`du -ks BUILD/tendermint-$(tendermint_version)-$(BUILD_NUMBER) | cut -f 1`/" BUILD/tendermint-$(tendermint_version)-$(BUILD_NUMBER)/DEBIAN/control
cd BUILD/tendermint-$(tendermint_version)-$(BUILD_NUMBER) && tar --owner=root --group=root -cvJf ../../tmp/data.tar.xz --exclude DEBIAN *
cd BUILD/tendermint-$(tendermint_version)-$(BUILD_NUMBER)/DEBIAN && tar --owner=root --group=root -cvzf ../../../tmp/control.tar.gz *
package-rpm-%: prepare-spec-%
@echo "*** Packaging RPM $* version $($*_version)"
rpmbuild -bb SPECS/$*.spec
./sign RPMS/x86_64/$*-$($*_version)-$(BUILD_NUMBER).x86_64.rpm
rpm -Kv RPMS/x86_64/$*-$($*_version)-$(BUILD_NUMBER).x86_64.rpm
@echo "*** Packaged RPM $* version $($*_version)"
package-deb-%: version-%
@echo "*** Packaging DEB $* version $($*_version)-$(BUILD_NUMBER)"
echo "BUILD/$*-$($*_version) folder is generated by package-rpm-$*"
test -d BUILD/$*-$($*_version)
rm -rf BUILD/$*-$($*_version)-$(BUILD_NUMBER) tmp/_gpg tmp/_gpgbuilder tmp/debian-binary tmp/control.tar.gz tmp/data.tar.xz
cp -r BUILD/$*-$($*_version) BUILD/$*-$($*_version)-$(BUILD_NUMBER)
cp -r extrafiles/DEBIAN-$* BUILD/$*-$($*_version)-$(BUILD_NUMBER)/DEBIAN
sed -i "s/@VERSION@/$($*_version)-$(BUILD_NUMBER)/" BUILD/$*-$($*_version)-$(BUILD_NUMBER)/DEBIAN/changelog
sed -i "s/@STABILITY@/stable/" BUILD/$*-$($*_version)-$(BUILD_NUMBER)/DEBIAN/changelog
sed -i "s/@DATETIMESTAMP@/`date +%a,\ %d\ %b\ %Y\ %T\ %z`/" BUILD/$*-$($*_version)-$(BUILD_NUMBER)/DEBIAN/changelog
sed -i "s/@VERSION@/$($*_version)-$(BUILD_NUMBER)/" BUILD/$*-$($*_version)-$(BUILD_NUMBER)/DEBIAN/control
rm -rf BUILD/$*-$($*_version)-$(BUILD_NUMBER)/usr/share/licenses
mkdir -p BUILD/$*-$($*_version)-$(BUILD_NUMBER)/usr/share/doc/$*
cp BUILD/$*-$($*_version)-$(BUILD_NUMBER)/DEBIAN/copyright BUILD/$*-$($*_version)-$(BUILD_NUMBER)/usr/share/doc/$*
gzip -c BUILD/$*-$($*_version)-$(BUILD_NUMBER)/DEBIAN/changelog > BUILD/$*-$($*_version)-$(BUILD_NUMBER)/usr/share/doc/$*/changelog.Debian.gz
gzip -c BUILD/$*-$($*_version)-$(BUILD_NUMBER)/DEBIAN/changelog > BUILD/$*-$($*_version)-$(BUILD_NUMBER)/usr/share/doc/$*/changelog.Debian.amd64.gz
sed -i "s/@INSTALLEDSIZE@/`du -ks BUILD/$*-$($*_version)-$(BUILD_NUMBER) | cut -f 1`/" BUILD/$*-$($*_version)-$(BUILD_NUMBER)/DEBIAN/control
cd BUILD/$*-$($*_version)-$(BUILD_NUMBER) && tar --owner=root --group=root -cvJf ../../tmp/data.tar.xz --exclude DEBIAN *
cd BUILD/$*-$($*_version)-$(BUILD_NUMBER)/DEBIAN && tar --owner=root --group=root -cvzf ../../../tmp/control.tar.gz *
echo "2.0" > tmp/debian-binary
cp extrafiles/_gpg tmp/
@ -126,46 +124,73 @@ package-debian-tendermint: package-tendermint
cd tmp && sed -i "s/@DATSIZE@/`stat -c %s data.tar.xz | cut -d\ -f1`/" _gpg
gpg --batch --passphrase "$(GPG_PASSPHRASE)" --clearsign tmp/_gpg
mv tmp/_gpg.asc tmp/_gpgbuilder
ar r tmp/tendermint-$(tendermint_version)-$(BUILD_NUMBER)_amd64.deb tmp/debian-binary tmp/control.tar.gz tmp/data.tar.xz tmp/_gpgbuilder
mv tmp/tendermint-$(tendermint_version)-$(BUILD_NUMBER)_amd64.deb RPMS/
ar r tmp/$*-$($*_version)-$(BUILD_NUMBER)_amd64.deb tmp/debian-binary tmp/control.tar.gz tmp/data.tar.xz tmp/_gpgbuilder
mv tmp/$*-$($*_version)-$(BUILD_NUMBER)_amd64.deb RPMS/
rm tmp/debian-binary tmp/control.tar.gz tmp/data.tar.xz tmp/_gpgbuilder tmp/_gpg
@echo "*** Packaged DEB $* version $($*_version)-$(BUILD_NUMBER)"
install-%:
install-rpm-%: version-%
#Make sure your host has the IAM role to read/write the S3 bucket OR that you set up ~/.boto
@echo "*** Uploading $*-$($*_version)-$(BUILD_NUMBER).x86_64.rpm to AWS CentOS repository"
aws s3 sync s3://tendermint-packages/centos/ tmp/s3/
mkdir -p tmp/s3/7/os/x86_64/Packages
cp -r RPMS/x86_64/$** tmp/s3/7/os/x86_64/Packages
cp RPMS/x86_64/$*-$($*_version)-$(BUILD_NUMBER).x86_64.rpm tmp/s3/7/os/x86_64/Packages
cp repofiles/RPM-GPG-KEY-Tendermint tmp/s3/7/os/x86_64/
cp repofiles/tendermint.repo tmp/s3/7/os/x86_64/
createrepo tmp/s3/7/os/x86_64/Packages -u http://tendermint-packages.s3-website-us-west-1.amazonaws.com/centos/7/os/x86_64/Packages -o tmp/s3/7/os/x86_64 --update -S --repo Tendermint --content tendermint --content basecoin --content ethermint
rm -rf tmp/s3/7/os/x86_64/repodata
rm -f tmp/s3/7/os/x86_64/repodata/repomd.xml.asc
createrepo tmp/s3/7/os/x86_64/Packages -u http://tendermint-packages.s3-website-us-west-1.amazonaws.com/centos/7/os/x86_64/Packages -o tmp/s3/7/os/x86_64 --update -S --repo Tendermint --content tendermint --content basecoin --content ethermint
gpg --batch --passphrase "$(GPG_PASSPHRASE)" --sign -a tmp/s3/7/os/x86_64/repodata/repomd.xml
aws s3 sync tmp/s3/ s3://tendermint-packages/centos/ --acl public-read
@echo "*** Uploaded $* to AWS CentOS repository"
install-debian-tendermint: prepare-spec-tendermint
#Prereq: package-debian-tendermint
install-deb-%: version-%
@echo "*** Uploading $*-$($*_version)-$(BUILD_NUMBER)_amd64.deb to AWS Debian repository"
@echo "Testing if $*-$($*_version)-$(BUILD_NUMBER)_amd64.deb is already uploaded"
test ! -f tmp/debian-s3/pool/$*-$($*_version)-$(BUILD_NUMBER)_amd64.deb
aws s3 sync s3://tendermint-packages/debian/ tmp/debian-s3/
@echo "Testing if $*-$($*_version)-$(BUILD_NUMBER)_amd64.deb is already uploaded"
test ! -f tmp/debian-s3/pool/$*-$($*_version)-$(BUILD_NUMBER)_amd64.deb
mkdir -p tmp/debian-s3/pool tmp/debian-s3/dists/stable/main/binary-amd64
cp RPMS/tendermint-$(tendermint_version)-$(BUILD_NUMBER)_amd64.deb tmp/debian-s3/pool
cp RPMS/$*-$($*_version)-$(BUILD_NUMBER)_amd64.deb tmp/debian-s3/pool
cp repofiles/Release_amd64 tmp/debian-s3/dists/stable/main/binary-amd64/Release
#Package.gz
test -f tmp/debian-s3/dists/stable/main/binary-amd64/Packages.gz && gunzip tmp/debian-s3/dists/stable/main/binary-amd64/Packages.gz || rm -f tmp/debian-s3/dists/stable/main/binary-amd64/Package
#Packages / Packages.gz
echo > tmp/Package
echo "Filename: pool/tendermint-$(tendermint_version)-$(BUILD_NUMBER)_amd64.deb" >> tmp/Package
echo "MD5sum: `md5sum RPMS/tendermint-$(tendermint_version)-$(BUILD_NUMBER)_amd64.deb | cut -d\ -f 1`" >> tmp/Package
echo "SHA1: `sha1sum RPMS/tendermint-$(tendermint_version)-$(BUILD_NUMBER)_amd64.deb | cut -d\ -f 1`" >> tmp/Package
echo "SHA256: `sha256sum RPMS/tendermint-$(tendermint_version)-$(BUILD_NUMBER)_amd64.deb | cut -d\ -f 1`" >> tmp/Package
echo "Size: `stat -c %s RPMS/tendermint-$(tendermint_version)-$(BUILD_NUMBER)_amd64.deb | cut -d\ -f 1`" >> tmp/Package
cat BUILD/tendermint-$(tendermint_version)-$(BUILD_NUMBER)/DEBIAN/control >> tmp/Package
echo "Filename: pool/$*-$($*_version)-$(BUILD_NUMBER)_amd64.deb" >> tmp/Package
echo "MD5sum: `md5sum RPMS/$*-$($*_version)-$(BUILD_NUMBER)_amd64.deb | cut -d\ -f 1`" >> tmp/Package
echo "SHA1: `sha1sum RPMS/$*-$($*_version)-$(BUILD_NUMBER)_amd64.deb | cut -d\ -f 1`" >> tmp/Package
echo "SHA256: `sha256sum RPMS/$*-$($*_version)-$(BUILD_NUMBER)_amd64.deb | cut -d\ -f 1`" >> tmp/Package
echo "Size: `stat -c %s RPMS/$*-$($*_version)-$(BUILD_NUMBER)_amd64.deb | cut -d\ -f 1`" >> tmp/Package
cat BUILD/$*-$($*_version)-$(BUILD_NUMBER)/DEBIAN/control >> tmp/Package
cat tmp/Package >> tmp/debian-s3/dists/stable/main/binary-amd64/Packages
gzip tmp/debian-s3/dists/stable/main/binary-amd64/Packages
rm -f tmp/debian-s3/dists/stable/main/binary-amd64/Packages.gz
gzip -c tmp/debian-s3/dists/stable/main/binary-amd64/Packages > tmp/debian-s3/dists/stable/main/binary-amd64/Packages.gz
rm -f tmp/Package
#Release / InRelease / Release.gpg
cp repofiles/Release tmp/debian-s3/dists/stable
#main / Release / InRelease / Release.gpg
cp repofiles/Release tmp/debian-s3/dists/stable/main/Release
rm -f tmp/debian-s3/dists/stable/main/InRelease
rm -f tmp/debian-s3/dists/stable/main/Release.gpg
echo "MD5Sum:" >> tmp/debian-s3/dists/stable/main/Release
cd tmp/debian-s3/dists/stable/main && for f in `find . -type f | sed 's/^.\///'` ; do test "$$f" == "Release" && continue ; echo -n " " ; md5sum $$f | sed "s/ / `stat -c %s $$f` /" ; done >> Release
echo "SHA1:" >> tmp/debian-s3/dists/stable/main/Release
cd tmp/debian-s3/dists/stable/main && for f in `find . -type f | sed 's/^.\///'` ; do test "$$f" == "Release" && continue ; echo -n " " ; sha1sum $$f | sed "s/ / `stat -c %s $$f` /" ; done >> Release
echo "SHA256:" >> tmp/debian-s3/dists/stable/main/Release
cd tmp/debian-s3/dists/stable/main && for f in `find . -type f | sed 's/^.\///'` ; do test "$$f" == "Release" && continue ; echo -n " " ; sha256sum $$f | sed "s/ / `stat -c %s $$f` /" ; done >> Release
gpg --batch --passphrase "$(GPG_PASSPHRASE)" --digest-algo SHA256 -b -a tmp/debian-s3/dists/stable/main/Release
mv tmp/debian-s3/dists/stable/main/Release.asc tmp/debian-s3/dists/stable/main/Release.gpg
gpg --batch --passphrase "$(GPG_PASSPHRASE)" --digest-algo SHA512 --clearsign tmp/debian-s3/dists/stable/main/Release
mv tmp/debian-s3/dists/stable/main/Release.asc tmp/debian-s3/dists/stable/main/InRelease
#stable / Release / InRelease / Release.gpg
cp repofiles/Release tmp/debian-s3/dists/stable/Release
rm -f tmp/debian-s3/dists/stable/InRelease
rm -f tmp/debian-s3/dists/stable/Release.gpg
@ -182,6 +207,7 @@ install-debian-tendermint: prepare-spec-tendermint
mv tmp/debian-s3/dists/stable/Release.asc tmp/debian-s3/dists/stable/InRelease
aws s3 sync tmp/debian-s3/ s3://tendermint-packages/debian/ --acl public-read
@echo "*** Uploaded $*-$($*_version)-$(BUILD_NUMBER)_amd64.deb to AWS Debian repository"
mostlyclean:
rm -rf {BUILDROOT,SOURCES,SPECS,SRPMS,tmp}


+ 6
- 0
devops/rpmbuild/extrafiles/DEBIAN-basecoin/changelog View File

@ -0,0 +1,6 @@
basecoin (@VERSION@) @STABILITY@; urgency=medium
* Automatic build. See https://github.com/tendermint/basecoin for more information.
-- Greg Szabo <greg@philosobear.com> @DATETIMESTAMP@

devops/rpmbuild/extrafiles/DEBIAN/compat → devops/rpmbuild/extrafiles/DEBIAN-basecoin/compat View File


+ 15
- 0
devops/rpmbuild/extrafiles/DEBIAN-basecoin/control View File

@ -0,0 +1,15 @@
Source: basecoin
Section: net
Priority: optional
Maintainer: Greg Szabo <greg@philosobear.com>
Build-Depends: debhelper (>=9)
Depends: tendermint (>=0.10.0)
Standards-Version: 3.9.6
Homepage: https://tendermint.com
Package: basecoin
Architecture: amd64
Version: @VERSION@
Installed-Size: @INSTALLEDSIZE@
Description: basecoin is a Proof-of-Stake cryptocurrency and framework
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.

+ 21
- 0
devops/rpmbuild/extrafiles/DEBIAN-basecoin/copyright View File

@ -0,0 +1,21 @@
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Upstream-Name: basecoin
Source: https://github.com/tendermint/basecoin
Files: *
Copyright: 2017 All In Bits, Inc.
License: Apache-2.0
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
.
http://www.apache.org/licenses/LICENSE-2.0
.
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
.
On Debian systems, the full text of the Apache License 2.0 can be found
in the file `/usr/share/common-licenses/Apache-2.0'.

+ 64
- 0
devops/rpmbuild/extrafiles/DEBIAN-basecoin/postinst View File

@ -0,0 +1,64 @@
#!/bin/sh
# postinst script for basecoin
#
set -e
# summary of how this script can be called:
# * <postinst> `configure' <most-recently-configured-version>
# * <old-postinst> `abort-upgrade' <new version>
# * <conflictor's-postinst> `abort-remove' `in-favour' <package>
# <new-version>
# * <postinst> `abort-remove'
# * <deconfigured's-postinst> `abort-deconfigure' `in-favour'
# <failed-install-package> <version> `removing'
# <conflicting-package> <version>
# for details, see https://www.debian.org/doc/debian-policy/ or
# the debian-policy package
case "$1" in
configure)
chown basecoin.basecoin /etc/basecoin
chown basecoin.basecoin /etc/basecoin/genesis.json
chown basecoin.basecoin /etc/basecoin/tendermint
chown basecoin.basecoin /etc/basecoin/tendermint/config.toml
test ! -f /etc/basecoin/priv_validator.json && tendermint gen_validator > /etc/basecoin/priv_validator.json && chmod 0400 /etc/basecoin/priv_validator.json && chown basecoin.basecoin /etc/basecoin/priv_validator.json
test ! -f /etc/basecoin/tendermint/priv_validator.json && tendermint gen_validator > /etc/basecoin/tendermint/priv_validator.json && chmod 0400 /etc/basecoin/tendermint/priv_validator.json && chown basecoin.basecoin /etc/basecoin/tendermint/priv_validator.json
tendermint_pubkey=`python -uc "import json ; print json.loads(open('/etc/basecoin/tendermint/priv_validator.json').read())['pub_key']['data']"`
test ! -f /etc/basecoin/tendermint/genesis.json && cat << EOF > /etc/basecoin/tendermint/genesis.json
{
"genesis_time": "2017-06-10T03:37:03Z",
"chain_id": "my_chain_id",
"validators":
[
{
"pub_key":{"type":"ed25519","data":"$tendermint_pubkey"},
"amount":10,
"name":"my_testchain_node"
}
],
"app_hash": "",
"app_options": {}
}
EOF
chown basecoin.basecoin /etc/basecoin/tendermint/genesis.json
systemctl daemon-reload
systemctl enable basecoin
;;
abort-upgrade|abort-remove|abort-deconfigure)
;;
*)
echo "postinst called with unknown argument \`$1'" >&2
exit 1
;;
esac
# dh_installdeb will replace this with shell code automatically
# generated by other debhelper scripts.
#DEBHELPER#
exit 0

+ 45
- 0
devops/rpmbuild/extrafiles/DEBIAN-basecoin/postrm View File

@ -0,0 +1,45 @@
#!/bin/sh
# postrm script for basecoin
#
set -e
# summary of how this script can be called:
# * <postrm> `remove'
# * <postrm> `purge'
# * <old-postrm> `upgrade' <new-version>
# * <new-postrm> `failed-upgrade' <old-version>
# * <new-postrm> `abort-install'
# * <new-postrm> `abort-install' <old-version>
# * <new-postrm> `abort-upgrade' <old-version>
# * <disappearer's-postrm> `disappear' <overwriter>
# <overwriter-version>
# for details, see https://www.debian.org/doc/debian-policy/ or
# the debian-policy package
case "$1" in
upgrade|failed-upgrade|abort-upgrade)
systemctl daemon-reload
if [ -d /etc/basecoin/tendermint/data ]; then
service basecoin start
fi
;;
purge|remove|abort-install|disappear)
systemctl daemon-reload
# userdel basecoin
;;
*)
echo "postrm called with unknown argument \`$1'" >&2
exit 1
;;
esac
# dh_installdeb will replace this with shell code automatically
# generated by other debhelper scripts.
#DEBHELPER#
exit 0

+ 37
- 0
devops/rpmbuild/extrafiles/DEBIAN-basecoin/preinst View File

@ -0,0 +1,37 @@
#!/bin/sh
# preinst script for basecoin
#
set -e
# summary of how this script can be called:
# * <new-preinst> `install'
# * <new-preinst> `install' <old-version>
# * <new-preinst> `upgrade' <old-version>
# * <old-preinst> `abort-upgrade' <new-version>
# for details, see https://www.debian.org/doc/debian-policy/ or
# the debian-policy package
case "$1" in
install|upgrade)
if ! grep -q '^basecoin:' /etc/passwd ; then
useradd -k /dev/null -r -m -b /etc basecoin
fi
;;
abort-upgrade)
;;
*)
echo "preinst called with unknown argument \`$1'" >&2
exit 1
;;
esac
# dh_installdeb will replace this with shell code automatically
# generated by other debhelper scripts.
#DEBHELPER#
exit 0

+ 39
- 0
devops/rpmbuild/extrafiles/DEBIAN-basecoin/prerm View File

@ -0,0 +1,39 @@
#!/bin/sh
# prerm script for basecoin
#
set -e
# summary of how this script can be called:
# * <prerm> `remove'
# * <old-prerm> `upgrade' <new-version>
# * <new-prerm> `failed-upgrade' <old-version>
# * <conflictor's-prerm> `remove' `in-favour' <package> <new-version>
# * <deconfigured's-prerm> `deconfigure' `in-favour'
# <package-being-installed> <version> `removing'
# <conflicting-package> <version>
# for details, see https://www.debian.org/doc/debian-policy/ or
# the debian-policy package
case "$1" in
remove|upgrade|deconfigure)
systemctl stop basecoin 2> /dev/null || :
systemctl stop basecoin-service 2> /dev/null || :
;;
failed-upgrade)
;;
*)
echo "prerm called with unknown argument \`$1'" >&2
exit 1
;;
esac
# dh_installdeb will replace this with shell code automatically
# generated by other debhelper scripts.
#DEBHELPER#
exit 0

devops/rpmbuild/extrafiles/DEBIAN/changelog → devops/rpmbuild/extrafiles/DEBIAN-ethermint/changelog View File


+ 1
- 0
devops/rpmbuild/extrafiles/DEBIAN-ethermint/compat View File

@ -0,0 +1 @@
9

+ 15
- 0
devops/rpmbuild/extrafiles/DEBIAN-ethermint/control View File

@ -0,0 +1,15 @@
Source: ethermint
Section: net
Priority: optional
Maintainer: Greg Szabo <greg@philosobear.com>
Build-Depends: debhelper (>=9)
Depends: tendermint (>=0.10.0)
Standards-Version: 3.9.6
Homepage: https://tendermint.com
Package: ethermint
Architecture: amd64
Version: @VERSION@
Installed-Size: @INSTALLEDSIZE@
Description: ethermint enables ethereum as an ABCI application on tendermint and the COSMOS hub
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.

+ 21
- 0
devops/rpmbuild/extrafiles/DEBIAN-ethermint/copyright View File

@ -0,0 +1,21 @@
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Upstream-Name: ethermint
Source: https://github.com/tendermint/ethermint
Files: *
Copyright: 2017 All In Bits, Inc.
License: Apache-2.0
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
.
http://www.apache.org/licenses/LICENSE-2.0
.
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
.
On Debian systems, the full text of the Apache License 2.0 can be found
in the file `/usr/share/common-licenses/Apache-2.0'.

+ 71
- 0
devops/rpmbuild/extrafiles/DEBIAN-ethermint/postinst View File

@ -0,0 +1,71 @@
#!/bin/sh
# postinst script for basecoin
#
set -e
# summary of how this script can be called:
# * <postinst> `configure' <most-recently-configured-version>
# * <old-postinst> `abort-upgrade' <new version>
# * <conflictor's-postinst> `abort-remove' `in-favour' <package>
# <new-version>
# * <postinst> `abort-remove'
# * <deconfigured's-postinst> `abort-deconfigure' `in-favour'
# <failed-install-package> <version> `removing'
# <conflicting-package> <version>
# for details, see https://www.debian.org/doc/debian-policy/ or
# the debian-policy package
case "$1" in
configure)
chown ethermint.ethermint /etc/ethermint
chown ethermint.ethermint /etc/ethermint/genesis.json
chown ethermint.ethermint /etc/ethermint/tendermint
chown ethermint.ethermint /etc/ethermint/tendermint/config.toml
chown ethermint.ethermint /etc/ethermint/keystore
chown ethermint.ethermint /etc/ethermint/keystore/UTC--2016-10-21T22-30-03.071787745Z--7eff122b94897ea5b0e2a9abf47b86337fafebdc
/usr/bin/ethermint --datadir /etc/ethermint init /etc/ethermint/genesis.json
chown -R ethermint.ethermint /etc/ethermint/ethermint
test ! -f /etc/ethermint/tendermint/priv_validator.json && tendermint gen_validator > /etc/ethermint/tendermint/priv_validator.json && chmod 0400 /etc/ethermint/tendermint/priv_validator.json && chown ethermint.ethermint /etc/ethermint/tendermint/priv_validator.json
tendermint_pubkey=`python -uc "import json ; print json.loads(open('/etc/ethermint/tendermint/priv_validator.json').read())['pub_key']['data']"`
test ! -f /etc/ethermint/tendermint/genesis.json && cat << EOF > /etc/ethermint/tendermint/genesis.json
{
"genesis_time": "2017-06-10T03:37:03Z",
"chain_id": "my_chain_id",
"validators":
[
{
"pub_key":{"type":"ed25519","data":"$tendermint_pubkey"},
"amount":10,
"name":"my_testchain_node"
}
],
"app_hash": "",
"app_options": {}
}
EOF
chown ethermint.ethermint /etc/ethermint/tendermint/genesis.json
systemctl daemon-reload
systemctl enable ethermint
if [ -d /etc/ethermint/tendermint/data ]; then
service ethermint start
fi
;;
abort-upgrade|abort-remove|abort-deconfigure)
;;
*)
echo "postinst called with unknown argument \`$1'" >&2
exit 1
;;
esac
# dh_installdeb will replace this with shell code automatically
# generated by other debhelper scripts.
#DEBHELPER#
exit 0

+ 45
- 0
devops/rpmbuild/extrafiles/DEBIAN-ethermint/postrm View File

@ -0,0 +1,45 @@
#!/bin/sh
# postrm script for ethermint
#
set -e
# summary of how this script can be called:
# * <postrm> `remove'
# * <postrm> `purge'
# * <old-postrm> `upgrade' <new-version>
# * <new-postrm> `failed-upgrade' <old-version>
# * <new-postrm> `abort-install'
# * <new-postrm> `abort-install' <old-version>
# * <new-postrm> `abort-upgrade' <old-version>
# * <disappearer's-postrm> `disappear' <overwriter>
# <overwriter-version>
# for details, see https://www.debian.org/doc/debian-policy/ or
# the debian-policy package
case "$1" in
upgrade|failed-upgrade|abort-upgrade)
systemctl daemon-reload
if [ -d /etc/ethermint/tendermint/data ]; then
service ethermint start
fi
;;
purge|remove|abort-install|disappear)
systemctl daemon-reload
# userdel ethermint
;;
*)
echo "postrm called with unknown argument \`$1'" >&2
exit 1
;;
esac
# dh_installdeb will replace this with shell code automatically
# generated by other debhelper scripts.
#DEBHELPER#
exit 0

+ 37
- 0
devops/rpmbuild/extrafiles/DEBIAN-ethermint/preinst View File

@ -0,0 +1,37 @@
#!/bin/sh
# preinst script for ethermint
#
set -e
# summary of how this script can be called:
# * <new-preinst> `install'
# * <new-preinst> `install' <old-version>
# * <new-preinst> `upgrade' <old-version>
# * <old-preinst> `abort-upgrade' <new-version>
# for details, see https://www.debian.org/doc/debian-policy/ or
# the debian-policy package
case "$1" in
install|upgrade)
if ! grep -q '^ethermint:' /etc/passwd ; then
useradd -k /dev/null -r -m -b /etc ethermint
fi
;;
abort-upgrade)
;;
*)
echo "preinst called with unknown argument \`$1'" >&2
exit 1
;;
esac
# dh_installdeb will replace this with shell code automatically
# generated by other debhelper scripts.
#DEBHELPER#
exit 0

+ 39
- 0
devops/rpmbuild/extrafiles/DEBIAN-ethermint/prerm View File

@ -0,0 +1,39 @@
#!/bin/sh
# prerm script for ethermint
#
set -e
# summary of how this script can be called:
# * <prerm> `remove'
# * <old-prerm> `upgrade' <new-version>
# * <new-prerm> `failed-upgrade' <old-version>
# * <conflictor's-prerm> `remove' `in-favour' <package> <new-version>
# * <deconfigured's-prerm> `deconfigure' `in-favour'
# <package-being-installed> <version> `removing'
# <conflicting-package> <version>
# for details, see https://www.debian.org/doc/debian-policy/ or
# the debian-policy package
case "$1" in
remove|upgrade|deconfigure)
systemctl stop ethermint 2> /dev/null || :
systemctl stop ethermint-service 2> /dev/null || :
;;
failed-upgrade)
;;
*)
echo "prerm called with unknown argument \`$1'" >&2
exit 1
;;
esac
# dh_installdeb will replace this with shell code automatically
# generated by other debhelper scripts.
#DEBHELPER#
exit 0

+ 6
- 0
devops/rpmbuild/extrafiles/DEBIAN-tendermint/changelog View File

@ -0,0 +1,6 @@
tendermint (@VERSION@) @STABILITY@; urgency=medium
* Automatic build. See https://github.com/tendermint/tendermint for more information.
-- Greg Szabo <greg@philosobear.com> @DATETIMESTAMP@

+ 1
- 0
devops/rpmbuild/extrafiles/DEBIAN-tendermint/compat View File

@ -0,0 +1 @@
9

devops/rpmbuild/extrafiles/DEBIAN/control → devops/rpmbuild/extrafiles/DEBIAN-tendermint/control View File


devops/rpmbuild/extrafiles/DEBIAN/copyright → devops/rpmbuild/extrafiles/DEBIAN-tendermint/copyright View File


+ 1
- 1
devops/rpmbuild/extrafiles/basecoin/basecoin.service View File

@ -19,7 +19,7 @@ Restart=on-failure
User=basecoin
Group=basecoin
PermissionsStartOnly=true
ExecStart=/usr/bin/basecoin start --without-tendermint
ExecStart=/usr/bin/basecoin start --without-tendermint --address "tcp://0.0.0.0:36658"
ExecReload=/bin/kill -HUP $MAINPID
KillSignal=SIGTERM


+ 0
- 29
devops/rpmbuild/extrafiles/binarydescription View File

@ -1,29 +0,0 @@
Format: 3.0 (native)
Source: tendermint
Binary: tendermint
Architecture: amd64
Version: @TENDERMINTVERSION@
Maintainer: Greg Szabo <greg@philosobear.com>
Standards-Version: 3.9.6
Vcs-Browser: http://svn.debian.org/wsvn/pkg-apache/trunk/ssl-cert
Vcs-Svn: svn://svn.debian.org/pkg-apache/trunk/ssl-cert
Build-Depends: debhelper (>=9)
Checksums-Sha1:
a108d8df792554ed7be41a9aaa317bada441f216 22697 ssl-cert_1.0.28.tar.gz
Checksums-Sha256:
464dabcf44d72d7e1ecdf1ffa8d0641694e6375704097d5e8ba04f3242e83d5e 22697 ssl-cert_1.0.28.tar.gz
Files:
4377beded7717321f9f75cfd12057dac 22697 ssl-cert_1.0.28.tar.gz
Package: tendermint
Architecture: amd64
Version: @TENDERMINT_VERSION@
Installed-Size: @INSTALLEDSIZE@
Description: securely and consistently replicate an application on many machines
Tendermint is software for securely and consistently replicating an application on many machines. By securely, we mean that Tendermint works even if up to 1/3 of machines fail in arbitrary ways. By consistently, we mean that every non-faulty machine sees the same transaction log and computes the same state.
~
~
~
~

+ 4
- 0
devops/rpmbuild/spectemplates/basecoin.spec View File

@ -72,12 +72,16 @@ EOF
%{__chown} %{name}.%{name} %{_sysconfdir}/%{name}/tendermint/genesis.json
systemctl daemon-reload
systemctl enable %{name}
if [ -d /etc/%{name}/tendermint/data ]; then
service %{name} start
fi
%preun
systemctl stop %{name} 2> /dev/null || :
systemctl stop %{name}-service 2> /dev/null || :
%postun
#userdel %{name}
systemctl daemon-reload
%files


+ 4
- 0
devops/rpmbuild/spectemplates/ethermint.spec View File

@ -69,12 +69,16 @@ EOF
%{__chown} %{name}.%{name} %{_sysconfdir}/%{name}/tendermint/genesis.json
systemctl daemon-reload
systemctl enable %{name}
if [ -d /etc/%{name}/tendermint/data ]; then
service %{name} start
fi
%preun
systemctl stop %{name} 2> /dev/null || :
systemctl stop %{name}-service 2> /dev/null || :
%postun
#userdel %{name}
systemctl daemon-reload
%files


Loading…
Cancel
Save