Skip to content

Commit

Permalink
build: allow building from source zip file.
Browse files Browse the repository at this point in the history
Changes both how we construct it and how we deal with not having git.

Signed-off-by: Rusty Russell <[email protected]>
  • Loading branch information
rustyrussell committed Jan 15, 2019
1 parent 75df22e commit 0d5f0d7
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
5 changes: 3 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#! /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),)
$(error "ERROR: git is required for generating version information")
Expand Down
8 changes: 7 additions & 1 deletion tools/build-release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
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
gpg -sb --armor -o release/SHA256SUMS.asc-"$(gpgconf --list-options gpg | awk -F: '$1 == "default-key" {print $10}' | tr -d '"')" release/SHA256SUMS
3 changes: 3 additions & 0 deletions tools/refresh-submodules.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ if [ $# = 0 ]; then
exit 1
fi

# If no git dir, forget it.
[ -d .git ] || exit 0

# git submodule can't run in parallel. Really.
if ! mkdir .refresh-submodules 2>/dev/null ; then
exit 0
Expand Down

0 comments on commit 0d5f0d7

Please sign in to comment.