Unify debian package scripts and add dragonx scripts

This commit is contained in:
Duke
2023-02-14 08:46:32 -08:00
parent 5184b4483f
commit f44e44e7df
2 changed files with 29 additions and 120 deletions

View File

@@ -2,10 +2,28 @@
# Copyright (c) 2016-2023 The Hush developers
# Distributed under the GPLv3 software license, see the accompanying
# file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html
## Usage: ./util/build-debian-package.sh
## Usages:
## ./util/build-debian-package.sh # build amd64 package
## ARCH=aarch64 ./util/build-debian-package.sh # build package for specific archiecture
ARCH=${1:-amd64}
echo "Let There Be Hush Debian Packages"
# Check if lintian is installed and give details about installing
# It is an optional dependency
if ! [ -x "$(command -v lintian)" ]; then
echo 'Warning: lintian is not installed yet. Consult your Linux version package manager...' >&2
echo 'On Debian/Ubuntu, try "sudo apt install lintian"'
fi
# Check if fakeroot is installed and exit if it is not
if ! [ -x "$(command -v fakeroot)" ]; then
echo 'Error: fakeroot is not installed yet. Consult your Linux version package manager...' >&2
echo 'On Debian/Ubuntu, try "sudo apt install fakeroot"'
echo ""
exit 1
fi
set -e
set -x
@@ -21,10 +39,11 @@ if [ ! -d $BUILD_PATH ]; then
mkdir $BUILD_PATH
fi
# If hushd is not currently running, package version can be hardcoded
#PACKAGE_VERSION=3.6.0
PACKAGE_VERSION=$($SRC_PATH/src/hushd --version|grep version|cut -d' ' -f4|cut -d- -f1|sed 's/v//g')
DEBVERSION=$(echo $PACKAGE_VERSION | sed 's/-beta/~beta/' | sed 's/-rc/~rc/' | sed 's/-/+/')
BUILD_DIR="$BUILD_PATH/$PACKAGE_NAME-$PACKAGE_VERSION-amd64"
BUILD_DIR="$BUILD_PATH/$PACKAGE_NAME-$PACKAGE_VERSION-$ARCH"
if [ -d $BUILD_DIR ]; then
rm -R $BUILD_DIR
@@ -53,6 +72,11 @@ cp $SRC_PATH/src/hush-cli $DEB_BIN
strip $DEB_BIN/hush-cli
cp $SRC_PATH/src/hush-tx $DEB_BIN
strip $DEB_BIN/hush-tx
# these are scripts and don't require a strip
cp $SRC_PATH/src/dragonx-cli $DEB_BIN
cp $SRC_PATH/src/dragonxd $DEB_BIN
cp $SRC_PATH/src/hush-smart-chain $DEB_BIN
#cp $SRC_DEB/changelog $DEB_DOC/changelog.Debian
cp $SRC_DEB/copyright $DEB_DOC
@@ -82,8 +106,8 @@ dpkg-gencontrol -P$BUILD_DIR -v$DEBVERSION
# Create the Debian package
fakeroot dpkg-deb --build $BUILD_DIR
cp $BUILD_PATH/$PACKAGE_NAME-$PACKAGE_VERSION-amd64.deb $SRC_PATH
shasum -a 256 $SRC_PATH/$PACKAGE_NAME-$PACKAGE_VERSION-amd64.deb
cp $BUILD_PATH/$PACKAGE_NAME-$PACKAGE_VERSION-$ARCH.deb $SRC_PATH
shasum -a 256 $SRC_PATH/$PACKAGE_NAME-$PACKAGE_VERSION-$ARCH.deb
# Analyze with Lintian, reporting bugs and policy violations
lintian -i $SRC_PATH/$PACKAGE_NAME-$PACKAGE_VERSION-amd64.deb
lintian -i $SRC_PATH/$PACKAGE_NAME-$PACKAGE_VERSION-$ARCH.deb
exit 0