mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-19 15:14:23 +01:00
build: allow building from source zip file.
Changes both how we construct it and how we deal with not having git. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
5
Makefile
5
Makefile
@@ -1,6 +1,7 @@
|
|||||||
#! /usr/bin/make
|
#! /usr/bin/make
|
||||||
VERSION_NAME=Principled Opposition to SegWit
|
|
||||||
VERSION=$(shell git describe --always --dirty=-modded --abbrev=7)
|
# Extract version from git, or if we're from a zipfile, use dirname
|
||||||
|
VERSION=$(shell git describe --always --dirty=-modded --abbrev=7 2>/dev/null || pwd | sed -n 's,.*/clightning-\(v[0-9.rc]*\)$$,\1,p')
|
||||||
|
|
||||||
ifeq ($(VERSION),)
|
ifeq ($(VERSION),)
|
||||||
$(error "ERROR: git is required for generating version information")
|
$(error "ERROR: git is required for generating version information")
|
||||||
|
|||||||
@@ -49,7 +49,13 @@ for platform in Fedora-28-amd64 Ubuntu-16.04-amd64 Ubuntu-16.04-i386; do
|
|||||||
docker run --rm=true -w /build $TAG rm -rf /"$VERSION-$platform" /build
|
docker run --rm=true -w /build $TAG rm -rf /"$VERSION-$platform" /build
|
||||||
done
|
done
|
||||||
|
|
||||||
git archive --format=zip -o release/clightning-"$VERSION".zip --prefix=lightning-master/ master
|
# git archive won't go into submodules :(
|
||||||
|
ln -sf .. "release/clightning-$VERSION"
|
||||||
|
FILES=$(git ls-files --recurse-submodules | sed "s,^,clightning-$VERSION/,")
|
||||||
|
# shellcheck disable=SC2086
|
||||||
|
(cd release && zip "clightning-$VERSION.zip" $FILES)
|
||||||
|
rm "release/clightning-$VERSION"
|
||||||
|
exit 0
|
||||||
|
|
||||||
sha256sum release/clightning-"$VERSION"* > release/SHA256SUMS
|
sha256sum release/clightning-"$VERSION"* > release/SHA256SUMS
|
||||||
gpg -sb --armor -o release/SHA256SUMS.asc-"$(gpgconf --list-options gpg | awk -F: '$1 == "default-key" {print $10}' | tr -d '"')" release/SHA256SUMS
|
gpg -sb --armor -o release/SHA256SUMS.asc-"$(gpgconf --list-options gpg | awk -F: '$1 == "default-key" {print $10}' | tr -d '"')" release/SHA256SUMS
|
||||||
|
|||||||
@@ -5,6 +5,9 @@ if [ $# = 0 ]; then
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# If no git dir, forget it.
|
||||||
|
[ -d .git ] || exit 0
|
||||||
|
|
||||||
# git submodule can't run in parallel. Really.
|
# git submodule can't run in parallel. Really.
|
||||||
if ! mkdir .refresh-submodules 2>/dev/null ; then
|
if ! mkdir .refresh-submodules 2>/dev/null ; then
|
||||||
exit 0
|
exit 0
|
||||||
|
|||||||
Reference in New Issue
Block a user