Added blockbook-tools package
This commit is contained in:
parent
038065429f
commit
b523c70355
7
Makefile
7
Makefile
@ -21,6 +21,11 @@ test-all: .bin-image
|
||||
deb: .deb-image
|
||||
docker run -t --rm -e PACKAGER=$(PACKAGER) -e UPDATE_VENDOR=$(UPDATE_VENDOR) -v $(CURDIR):/src -v $(CURDIR)/build:/out $(DEB_IMAGE)
|
||||
|
||||
tools:
|
||||
docker run -t --rm -e PACKAGER=$(PACKAGER) -e UPDATE_VENDOR=$(UPDATE_VENDOR) -v $(CURDIR):/src -v $(CURDIR)/build:/out $(BIN_IMAGE) make tools
|
||||
|
||||
all: build-images deb
|
||||
|
||||
build-images:
|
||||
rm -f .bin-image .deb-image
|
||||
$(MAKE) .bin-image .deb-image
|
||||
@ -38,7 +43,7 @@ clean: clean-bin clean-deb
|
||||
clean-all: clean clean-images
|
||||
|
||||
clean-bin:
|
||||
rm -f build/blockbook
|
||||
find build -maxdepth 1 -type f -executable -delete
|
||||
|
||||
clean-deb:
|
||||
rm -f build/*.deb
|
||||
|
||||
@ -14,6 +14,8 @@ ENV PATH=$PATH:$GOPATH/bin
|
||||
ENV CGO_CFLAGS="-I/opt/rocksdb/include"
|
||||
ENV CGO_LDFLAGS="-L/opt/rocksdb -lrocksdb -lstdc++ -lm -lz -lbz2 -lsnappy -llz4"
|
||||
|
||||
RUN mkdir /build
|
||||
|
||||
# install and configure go
|
||||
RUN cd /opt && wget https://storage.googleapis.com/golang/$GOLANG_VERSION.tar.gz && \
|
||||
tar xf $GOLANG_VERSION.tar.gz
|
||||
@ -24,7 +26,9 @@ RUN echo -n "GOPATH: " && echo $GOPATH
|
||||
|
||||
# install rocksdb
|
||||
RUN cd /opt && git clone https://github.com/facebook/rocksdb.git
|
||||
RUN cd /opt/rocksdb && CFLAGS=-fPIC CXXFLAGS=-fPIC make -j 4 static_lib
|
||||
RUN cd /opt/rocksdb && CFLAGS=-fPIC CXXFLAGS=-fPIC make -j 4 release
|
||||
RUN strip /opt/rocksdb/ldb /opt/rocksdb/sst_dump && \
|
||||
cp /opt/rocksdb/ldb /opt/rocksdb/sst_dump /build
|
||||
|
||||
RUN go get github.com/golang/dep/cmd/dep
|
||||
|
||||
|
||||
@ -1,9 +1,12 @@
|
||||
SHELL = /bin/bash
|
||||
UPDATE_VENDOR ?= 1
|
||||
VERSION ?= devel
|
||||
GITCOMMIT = $(shell cd /src && git describe --tags --always --dirty)
|
||||
BUILDTIME = $(shell date --iso-8601=seconds)
|
||||
LDFLAGS := -X blockbook/common.version=$(VERSION) -X blockbook/common.gitcommit=$(GITCOMMIT) -X blockbook/common.buildtime=$(BUILDTIME)
|
||||
|
||||
all: build tools
|
||||
|
||||
build: prepare-sources
|
||||
cd $(GOPATH)/src/blockbook && go build -o $(CURDIR)/blockbook -ldflags="-s -w $(LDFLAGS)"
|
||||
cp $(CURDIR)/blockbook /out/blockbook
|
||||
@ -14,6 +17,10 @@ build-debug: prepare-sources
|
||||
cp $(CURDIR)/blockbook /out/blockbook
|
||||
chown $(PACKAGER) /out/blockbook
|
||||
|
||||
tools:
|
||||
cp $(CURDIR)/{ldb,sst_dump} /out
|
||||
chown $(PACKAGER) /out/{ldb,sst_dump}
|
||||
|
||||
test: prepare-sources
|
||||
cd $(GOPATH)/src/blockbook && go test -short ./...
|
||||
|
||||
|
||||
2
build/deb/debian/blockbook-tools.install
Normal file
2
build/deb/debian/blockbook-tools.install
Normal file
@ -0,0 +1,2 @@
|
||||
ldb /opt/coins/blockbook/tools
|
||||
sst_dump /opt/coins/blockbook/tools
|
||||
2
build/deb/debian/blockbook-tools.links
Normal file
2
build/deb/debian/blockbook-tools.links
Normal file
@ -0,0 +1,2 @@
|
||||
/opt/coins/blockbook/tools/ldb /usr/bin/ldb
|
||||
/opt/coins/blockbook/tools/sst_dump /usr/bin/sst_dump
|
||||
@ -5,6 +5,11 @@ Maintainer: jakub.matys@satoshilabs.com
|
||||
Build-Depends: debhelper, dh-systemd, dh-exec
|
||||
Standards-Version: 3.9.5
|
||||
|
||||
Package: blockbook-tools
|
||||
Architecture: amd64
|
||||
Depends: ${shlibs:Depends}, ${misc:Depends}
|
||||
Description: Satoshilabs blockbook server (tools)
|
||||
|
||||
Package: blockbook-btc
|
||||
Architecture: amd64
|
||||
Depends: ${shlibs:Depends}, ${misc:Depends}, coreutils, passwd, findutils, psmisc, bitcoin-btc
|
||||
|
||||
Loading…
Reference in New Issue
Block a user