Browse Source

Added Debian/Ubuntu package build

pull/1943/head
Greg Szabo 8 years ago
parent
commit
e3d43c8d45
20 changed files with 181 additions and 123 deletions
  1. +0
    -4
      devops/debianbuild/Makefile
  2. +0
    -109
      devops/debianbuild/Makefiledeb
  3. BIN
      devops/debianbuild/tendermint_0.10.0-21_amd64.deb
  4. BIN
      devops/debianbuild/tendermint_0.8.0+git20170113.0.764091d-2+b1_amd64.deb
  5. BIN
      devops/debianbuild/x/control.tar.gz
  6. BIN
      devops/debianbuild/x/data.tar.xz
  7. +0
    -1
      devops/debianbuild/x/debian-binary
  8. +3
    -0
      devops/rpmbuild/.gitignore
  9. +87
    -9
      devops/rpmbuild/Makefile
  10. +6
    -0
      devops/rpmbuild/extrafiles/DEBIAN/changelog
  11. +1
    -0
      devops/rpmbuild/extrafiles/DEBIAN/compat
  12. +14
    -0
      devops/rpmbuild/extrafiles/DEBIAN/control
  13. +21
    -0
      devops/rpmbuild/extrafiles/DEBIAN/copyright
  14. +8
    -0
      devops/rpmbuild/extrafiles/_gpg
  15. +29
    -0
      devops/rpmbuild/extrafiles/binarydescription
  16. +0
    -0
      devops/rpmbuild/repofiles/RPM-GPG-KEY-Tendermint
  17. +7
    -0
      devops/rpmbuild/repofiles/Release
  18. +5
    -0
      devops/rpmbuild/repofiles/Release_amd64
  19. +0
    -0
      devops/rpmbuild/repofiles/tendermint-dev.repo
  20. +0
    -0
      devops/rpmbuild/repofiles/tendermint.repo

+ 0
- 4
devops/debianbuild/Makefile View File

@ -1,4 +0,0 @@
#!/usr/bin/make -f
%:
dh $@

+ 0
- 109
devops/debianbuild/Makefiledeb View File

@ -1,109 +0,0 @@
##
# Extra checks, because we do not use autoconf. Set extra_check to false if it is bothering you.
##
extra_check = true
go_min_version = 1.8.3
gpg_key = 2122CBE9
ifeq ($(extra_check),true)
ifndef GOPATH
$(error GOPATH not set)
else
go_version := $(shell go version | sed "s/^.* go\([0-9\.]*\) .*$$/\1/" )
$(info Found go version $(go_version))
go_version_check := $(shell echo -e "$(go_min_version)\n$(go_version)" | sort -V | head -1)
ifneq ($(go_min_version),$(go_version_check))
$(error go version go_min_version or above is required)
endif
endif
gpg_check := $(shell gpg -K | grep '/$(gpg_key) ' | sed 's,^.*/\($(gpg_key)\) .*$$,\1,')
ifneq ($(gpg_check),$(gpg_key))
$(error GPG key not found. Add key ID $(gpg_key) to gpg-agent)
else
$(info GPG key $(gpg_key) found)
endif
endif
###
# Here comes the real deal
###
binaries = tendermint basecoin ethermint
build-binaries = build-tendermint build-basecoin build-ethermint
package-binaries = package-tendermint package-basecoin package-ethermint
all: $(binaries)
build: $(build-binaries)
package: $(package-binaries)
$(binaries): %: build-% package-% ;
###
# 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)
go get -u github.com/tendermint/tendermint/cmd/tendermint
build-basecoin:
$(info Building basecoin)
go get -u github.com/tendermint/basecoin/cmd/basecoin
$(info Building basecli)
go get -u github.com/tendermint/basecoin/cmd/basecli
build-ethermint:
$(info 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
prepare-spec-%: $(GOPATH)/bin/%
$(info Preparing build for $*)
if [ -z "$(BUILD_NUMBER)" ]; then echo "BUILD_NUMBER not set" ; false ; fi
mkdir -p tmp
$(eval $*_version=$(shell $< version | cut -d- -f1 ))
echo "Version: $($*_version)" > SPECS/$*.spec
echo "Release: $(BUILD_NUMBER)" >> SPECS/$*.spec
package-tendermint: prepare-spec-tendermint
$(info Packaging tendermint version $(tendermint_version))
package-basecoin: prepare-spec-basecoin
$(info Packaging basecoin version $(basecoin_version))
package-ethermint: prepare-spec-ethermint ;
$(info Packaging ethermint version $(ethermint_version))
install-%:
#Make sure your host has the IAM role to read/write the S3 bucket OR that you set up ~/.boto
fail
aws s3 sync s3://tendermint-packages/debian/ tmp/s3/
mkdir -p tmp/s3/XXXXXX/7/cr/x86_64/Packages
cp -r RPMS/x86_64/$** tmp/s3/7/cr/x86_64/Packages
cp ./RPM-GPG-KEY-Tendermint tmp/s3/7/os/x86_64/
cp ./tendermint.repo tmp/s3/7/os/x86_64/
cp ./tendermint-dev.repo tmp/s3/7/cr/x86_64/
createrepo tmp/s3/7/cr/x86_64/Packages -u http://tendermint-packages.s3-website-us-west-1.amazonaws.com/centos/7/cr/x86_64/Packages -o tmp/s3/7/cr/x86_64 --update -S --repo Tendermint --content tendermint --content basecoin --content ethermint
#Asks about overwrite
gpg --clearsign tmp/s3/7/cr/x86_64/repodata/repomd.xml
aws s3 sync tmp/s3/ s3://tendermint-packages/centos/ --acl public-read
mostlyclean:
rm -rf {BUILDROOT,SOURCES,SPECS,SRPMS,tmp}
clean: mostlyclean
rm -rf {BUILD,RPMS}
distclean: clean
rm -rf $(GOPATH)/src/github.com/tendermint/tendermint
rm -rf $(GOPATH)/src/github.com/tendermint/basecoin
rm -rf $(GOPATH)/src/github.com/tendermint/ethermint
rm -rf $(GOPATH)/bin/tendermint
rm -rf $(GOPATH)/bin/basecoin
rm -rf $(GOPATH)/bin/basecli
rm -rf $(GOPATH)/bin/ethermint
.PHONY : clean

BIN
devops/debianbuild/tendermint_0.10.0-21_amd64.deb View File


BIN
devops/debianbuild/tendermint_0.8.0+git20170113.0.764091d-2+b1_amd64.deb View File


BIN
devops/debianbuild/x/control.tar.gz View File


BIN
devops/debianbuild/x/data.tar.xz View File


+ 0
- 1
devops/debianbuild/x/debian-binary View File

@ -1 +0,0 @@
2.0

+ 3
- 0
devops/rpmbuild/.gitignore View File

@ -0,0 +1,3 @@
BUILD
RPMS
SPECS

+ 87
- 9
devops/rpmbuild/Makefile View File

@ -91,20 +91,98 @@ package-ethermint: prepare-spec-ethermint ;
./sign RPMS/x86_64/ethermint-$(ethermint_version)-$$BUILD_NUMBER.x86_64.rpm ./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 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 *
echo "2.0" > tmp/debian-binary
cp extrafiles/_gpg tmp/
cd tmp && sed -i "s/@DATETIMESTAMP@/`date +%a\ %b\ %d\ %T\ %Y`/" _gpg
cd tmp && sed -i "s/@BINMD5@/`md5sum debian-binary | cut -d\ -f1`/" _gpg
cd tmp && sed -i "s/@BINSHA1@/`sha1sum debian-binary | cut -d\ -f1`/" _gpg
cd tmp && sed -i "s/@BINSIZE@/`stat -c %s debian-binary | cut -d\ -f1`/" _gpg
cd tmp && sed -i "s/@CONMD5@/`md5sum control.tar.gz | cut -d\ -f1`/" _gpg
cd tmp && sed -i "s/@CONSHA1@/`sha1sum control.tar.gz | cut -d\ -f1`/" _gpg
cd tmp && sed -i "s/@CONSIZE@/`stat -c %s control.tar.gz | cut -d\ -f1`/" _gpg
cd tmp && sed -i "s/@DATMD5@/`md5sum data.tar.xz | cut -d\ -f1`/" _gpg
cd tmp && sed -i "s/@DATSHA1@/`sha1sum data.tar.xz | cut -d\ -f1`/" _gpg
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/
rm tmp/debian-binary tmp/control.tar.gz tmp/data.tar.xz tmp/_gpgbuilder tmp/_gpg
install-%: install-%:
#Make sure your host has the IAM role to read/write the S3 bucket OR that you set up ~/.boto #Make sure your host has the IAM role to read/write the S3 bucket OR that you set up ~/.boto
aws s3 sync s3://tendermint-packages/centos/ tmp/s3/ aws s3 sync s3://tendermint-packages/centos/ tmp/s3/
mkdir -p tmp/s3/7/cr/x86_64/Packages
cp -r RPMS/x86_64/$** tmp/s3/7/cr/x86_64/Packages
cp ./RPM-GPG-KEY-Tendermint tmp/s3/7/os/x86_64/
cp ./tendermint.repo tmp/s3/7/os/x86_64/
cp ./tendermint-dev.repo tmp/s3/7/cr/x86_64/
createrepo tmp/s3/7/cr/x86_64/Packages -u http://tendermint-packages.s3-website-us-west-1.amazonaws.com/centos/7/cr/x86_64/Packages -o tmp/s3/7/cr/x86_64 --update -S --repo Tendermint --content tendermint --content basecoin --content ethermint
rm -f tmp/s3/7/cr/x86_64/repodata/repomd.xml.asc
#TODO: make this more secure
gpg --batch --passphrase "$(GPG_PASSPHRASE)" --clearsign tmp/s3/7/cr/x86_64/repodata/repomd.xml
mkdir -p tmp/s3/7/os/x86_64/Packages
cp -r RPMS/x86_64/$** 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 -f tmp/s3/7/os/x86_64/repodata/repomd.xml.asc
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 aws s3 sync tmp/s3/ s3://tendermint-packages/centos/ --acl public-read
install-debian-tendermint: prepare-spec-tendermint
#Prereq: package-debian-tendermint
aws s3 sync s3://tendermint-packages/debian/ tmp/debian-s3/
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 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
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
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/Package
#Release / InRelease / Release.gpg
cp repofiles/Release tmp/debian-s3/dists/stable
rm -f tmp/debian-s3/dists/stable/InRelease
rm -f tmp/debian-s3/dists/stable/Release.gpg
echo "MD5Sum:" >> tmp/debian-s3/dists/stable/Release
cd tmp/debian-s3/dists/stable && 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/Release
cd tmp/debian-s3/dists/stable && 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/Release
cd tmp/debian-s3/dists/stable && 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/Release
mv tmp/debian-s3/dists/stable/Release.asc tmp/debian-s3/dists/stable/Release.gpg
gpg --batch --passphrase "$(GPG_PASSPHRASE)" --digest-algo SHA512 --clearsign tmp/debian-s3/dists/stable/Release
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
mostlyclean: mostlyclean:
rm -rf {BUILDROOT,SOURCES,SPECS,SRPMS,tmp} rm -rf {BUILDROOT,SOURCES,SPECS,SRPMS,tmp}


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

@ -0,0 +1,6 @@
tendermint (@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/compat View File

@ -0,0 +1 @@
9

+ 14
- 0
devops/rpmbuild/extrafiles/DEBIAN/control View File

@ -0,0 +1,14 @@
Source: tendermint
Section: net
Priority: optional
Maintainer: Greg Szabo <greg@philosobear.com>
Build-Depends: debhelper (>=9)
Standards-Version: 3.9.6
Homepage: https://tendermint.com
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.

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

@ -0,0 +1,21 @@
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Upstream-Name: tendermint
Source: https://github.com/tendermint/tendermint
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'.

+ 8
- 0
devops/rpmbuild/extrafiles/_gpg View File

@ -0,0 +1,8 @@
Version: 4
Signer:
Date: @DATETIMESTAMP@
Role: builder
Files:
@BINMD5@ @BINSHA1@ @BINSIZE@ debian-binary
@CONMD5@ @CONSHA1@ @CONSIZE@ control.tar.gz
@DATMD5@ @DATSHA1@ @DATSIZE@ data.tar.xz

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

@ -0,0 +1,29 @@
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.
~
~
~
~

devops/rpmbuild/RPM-GPG-KEY-Tendermint → devops/rpmbuild/repofiles/RPM-GPG-KEY-Tendermint View File


+ 7
- 0
devops/rpmbuild/repofiles/Release View File

@ -0,0 +1,7 @@
Origin: Tendermint
Label: Tendermint
Suite: stable
Date: Fri, 16 Jun 2017 19:44:00 UTC
Architectures: amd64
Components: main
Description: Tendermint repository

+ 5
- 0
devops/rpmbuild/repofiles/Release_amd64 View File

@ -0,0 +1,5 @@
Archive: stable
Component: main
Origin: Tendermint
Label: Tendermint
Architecture: amd64

devops/rpmbuild/tendermint-dev.repo → devops/rpmbuild/repofiles/tendermint-dev.repo View File


devops/rpmbuild/tendermint.repo → devops/rpmbuild/repofiles/tendermint.repo View File


Loading…
Cancel
Save