Skip to content

Commit

Permalink
Small tweaks to packaging
Browse files Browse the repository at this point in the history
  • Loading branch information
otoolep committed Oct 21, 2021
1 parent d185877 commit f90d977
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions package.sh
Expand Up @@ -10,6 +10,8 @@
#
# sudo apt-get -y install musl-dev musl-tools

REPO_URL="https://github.com/rqlite/rqlite"

# copy_binaries <dst_path> <src_dir>
copy_binaries () {
cp $2/rqlited $1
Expand All @@ -24,8 +26,6 @@ upload_asset () {
curl -v -H "Content-type: application/octet-stream" -H "Authorization: token $3" -XPOST $upload_url?name=$release_pkg_name --data-binary @$1
}

REPO_URL="https://github.com/rqlite/rqlite"

if [ $# -lt 1 ]; then
echo "$0 <version> [release_id api_token]"
exit 1
Expand Down Expand Up @@ -66,21 +66,21 @@ git clone $REPO_URL
cd rqlite
go get -d ./...

# Build vanilla release
# Build release for this machine
rm -f $GOPATH/bin/*
if [ "$kernel" = "Linux" ]; then
STATIC="-extldflags=-static"
fi
CGO_ENABLED=1 go install -a -tags osusergo,netgo,sqlite_omit_load_extension -ldflags="$STATIC $LDFLAGS" ./...
if [ "$kernel" = "Linux" ]; then
ldd $GOPATH/bin/rqlited 2>&1 >/dev/null
ldd $GOPATH/bin/rqlited >/dev/null 2>&1
if [ $? -ne 1 ]; then
echo "Failed to confirm fully static linking on Linux"
exit 1
fi
fi

# Package the vanilla release
# Package the release for this machine
release=`echo rqlite-$VERSION-$kernel-$machine | tr '[:upper:]' '[:lower:]'`
tarball=${release}.tar.gz
mkdir $tmp_pkg/$release
Expand All @@ -93,7 +93,7 @@ if [ -n "$API_TOKEN" ]; then
fi

if [ "$kernel" != "Linux" ]; then
# We're done
# Only build other versions when on Linux.
exit 0
fi

Expand Down

0 comments on commit f90d977

Please sign in to comment.