Browse Source

build shell improvements

jahway
jahway603 3 years ago
parent
commit
ca22c1c2a4
  1. 15
      util/build-debian-package.sh
  2. 12
      util/build.sh

15
util/build-debian-package.sh

@ -16,11 +16,11 @@ if ! [ -x "$(command -v ./lightwalletd)" ]; then
fi fi
# Check if lintian is installed and exit if it is not # Check if lintian is installed and exit if it is not
#if ! [ -x "$(command -v lintian)" ]; then if ! [ -x "$(command -v lintian)" ]; then
# echo 'Error: lintian is not installed yet. Consult your Linux version package manager...' >&2 echo 'Error: lintian is not installed yet. Consult your Linux version package manager...' >&2
# echo "" echo ""
# exit 1 exit 1
#fi fi
echo "Let There Be Hush Lightwalletd Debian Packages!" echo "Let There Be Hush Lightwalletd Debian Packages!"
echo "" echo ""
@ -92,7 +92,6 @@ fakeroot dpkg-deb --build $BUILD_DIR
cp $BUILD_PATH/$PACKAGE_NAME-$PACKAGE_VERSION-$ARCH.deb $SRC_PATH cp $BUILD_PATH/$PACKAGE_NAME-$PACKAGE_VERSION-$ARCH.deb $SRC_PATH
shasum -a 256 $SRC_PATH/$PACKAGE_NAME-$PACKAGE_VERSION-$ARCH.deb shasum -a 256 $SRC_PATH/$PACKAGE_NAME-$PACKAGE_VERSION-$ARCH.deb
# Analyze with Lintian, reporting bugs and policy violations # Analyze with Lintian, reporting bugs and policy violations
# Arch does not have lintian, as it's a Debian package, so commenting this out # Arch does not have lintian, as it's a Debian package, so run this on Debian stuff
# To-DO - test on Debian/Ubuntu, create AUR lintian package lintian -i $SRC_PATH/$PACKAGE_NAME-$PACKAGE_VERSION-$ARCH.deb
#lintian -i $SRC_PATH/$PACKAGE_NAME-$PACKAGE_VERSION-$ARCH.deb
exit 0 exit 0

12
util/build.sh

@ -4,11 +4,21 @@
# file LICENSE or https://www.gnu.org/licenses/gpl-3.0.en.html # file LICENSE or https://www.gnu.org/licenses/gpl-3.0.en.html
# Purpose: Script to build Hush lightwalletd on x86 64-bit arch # Purpose: Script to build Hush lightwalletd on x86 64-bit arch
## Usage: ./util/build.sh
# Check if go is installed on system...
v=`go version | { read _ _ v _; echo ${v#go}; }`
function version { echo "$@" | awk -F. '{ printf("%d%03d%03d%03d\n", $1,$2,$3,$4); }'; }
# Check if go is installed on system and exits if it is not # Check if go is installed on system and exits if it is not
if ! [ -x "$(command -v go)" ]; then if ! [ -x "$(command -v go)" ]; then
echo 'Error: go is not installed. Install go and try again.' >&2 echo 'Error: go is not installed. Install go and try again.' >&2
exit 1 exit 1
# If go is installed, then check system for at least version 1.13.0
elif [ $(version $v) -lt $(version "1.13.0") ]; then
echo 'Error: the go version you have installed requires at least version 1.13, which your system does not have installed. Install a newer version of go and try again.' >&2
echo ''
echo "Try out gobrew to install a newer version than what your OS package manager supplies."
exit 1
fi fi
echo "" echo ""
@ -23,7 +33,7 @@ echo "+------'+------'+------'+------'+------'+------'+------'+------'+------'+-
# now to compiling... # now to compiling...
echo "" echo ""
echo "You have go installed, so starting to compile Hush lightwalletd for you..." echo "You have at least go 1.13.0 installed, so starting to compile Hush lightwalletd for you..."
cd `pwd`/cmd/server cd `pwd`/cmd/server
go build -o lightwalletd main.go go build -o lightwalletd main.go
mv lightwalletd `pwd`/../../lightwalletd mv lightwalletd `pwd`/../../lightwalletd

Loading…
Cancel
Save