shellchecked
This commit is contained in:
parent
9fe3c03d28
commit
6f554d4036
1 changed files with 14 additions and 16 deletions
|
@ -3,13 +3,12 @@ set -x
|
||||||
|
|
||||||
CWD=$(pwd)
|
CWD=$(pwd)
|
||||||
|
|
||||||
PRGNAM=$(basename $CWD)
|
PRGNAM=$(basename "$CWD")
|
||||||
|
|
||||||
BUILD=1
|
BUILD=1
|
||||||
VERSION=${VERSION:-latest}
|
VERSION=${VERSION:-latest}
|
||||||
|
|
||||||
ARCH=$(uname -m)
|
ARCH=$(uname -m)
|
||||||
LIBSUFFIX=$(echo $ARCH | grep -o "\(64\)")
|
|
||||||
|
|
||||||
TAG=gwh
|
TAG=gwh
|
||||||
OUTPUT=/tmp
|
OUTPUT=/tmp
|
||||||
|
@ -23,21 +22,21 @@ PREFIX=/usr
|
||||||
mkdir -p $TMP
|
mkdir -p $TMP
|
||||||
|
|
||||||
# Cleaning
|
# Cleaning
|
||||||
rm -fr $TMP/$PRGNAM $PKG
|
rm -fr "${TMP:?}"/"$PRGNAM" "$PKG"
|
||||||
|
|
||||||
# Fetching sources
|
# Fetching sources
|
||||||
[ ! -e $REPOSITORY ] && git clone https://codeberg.org/gwh/hpemung.git $REPOSITORY
|
[ ! -e "$REPOSITORY" ] && git clone https://codeberg.org/gwh/hpemung.git "$REPOSITORY"
|
||||||
cd $REPOSITORY
|
cd "$REPOSITORY" || exit 1
|
||||||
git pull --all
|
git pull --all
|
||||||
|
|
||||||
cp -R $REPOSITORY $TMP/$PRGNAM
|
cp -R "$REPOSITORY" "$TMP"/"$PRGNAM"
|
||||||
|
|
||||||
# Preparation
|
# Preparation
|
||||||
cd $TMP/$PRGNAM
|
cd "$TMP"/"$PRGNAM" || exit 1
|
||||||
|
|
||||||
[ "x$VERSION" == "xlatest" ] && VERSION=$(git describe --tags --abbrev=0)
|
[ "$VERSION" == "latest" ] && VERSION=$(git describe --tags --abbrev=0)
|
||||||
[ "x$VERSION" == "x" ] && VERSION=trunk
|
[ "$VERSION" == "" ] && VERSION=trunk
|
||||||
[ "x$VERSION" == "xtrunk" ] && VERSION="git_r$(git rev-list --count HEAD)_$(git log -1 --format=%h)" || git checkout $VERSION
|
[ "$VERSION" == "trunk" ] && VERSION="git_r$(git rev-list --count HEAD)_$(git log -1 --format=%h)" || git checkout "$VERSION"
|
||||||
|
|
||||||
chown -R root:root .
|
chown -R root:root .
|
||||||
find . \
|
find . \
|
||||||
|
@ -50,16 +49,16 @@ find . \
|
||||||
make all PREFIX=/usr
|
make all PREFIX=/usr
|
||||||
|
|
||||||
# Installation
|
# Installation
|
||||||
make install DESTDIR=$PKG PREFIX=/usr
|
make install DESTDIR="$PKG" PREFIX=/usr
|
||||||
|
|
||||||
# # Cleaning
|
# # Cleaning
|
||||||
# cd $PKG
|
# cd $PKG
|
||||||
# find . | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null
|
# find . | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null
|
||||||
# find . | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null
|
# find . | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null
|
||||||
|
|
||||||
cd $PKG
|
cd "$PKG" || exit 1
|
||||||
|
|
||||||
[ -d $PKG$PREFIX/man ] && find $PKG$PREFIX/man -type f -name "*.?" -exec gzip -9 {} \;
|
[ -d "$PKG""$PREFIX"/man ] && find "$PKG""$PREFIX"/man -type f -name "*.?" -exec gzip -9 {} \;
|
||||||
|
|
||||||
chown -R root:root .
|
chown -R root:root .
|
||||||
find . \
|
find . \
|
||||||
|
@ -74,7 +73,7 @@ cat <<EOF > install/slack-desc
|
||||||
$PRGNAM: $PRGNAM (HP48 emulator)
|
$PRGNAM: $PRGNAM (HP48 emulator)
|
||||||
$PRGNAM:
|
$PRGNAM:
|
||||||
$PRGNAM: hpemung is an emulator of the Saturn Processor and the I/O of an
|
$PRGNAM: hpemung is an emulator of the Saturn Processor and the I/O of an
|
||||||
$PRGNAM: HP48 calculator. There is a debugger for the Saturn Processor.
|
$PRGNAM: HP 48G/GX calculator.
|
||||||
$PRGNAM:
|
$PRGNAM:
|
||||||
$PRGNAM: initialization:
|
$PRGNAM: initialization:
|
||||||
$PRGNAM: $ $PREFIX/share/$PRGNAM/setup-hpemung-home.sh
|
$PRGNAM: $ $PREFIX/share/$PRGNAM/setup-hpemung-home.sh
|
||||||
|
@ -84,5 +83,4 @@ $PRGNAM: https://codeberg.org/gwh/hpemung.git
|
||||||
$PRGNAM:
|
$PRGNAM:
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
rm -f $PKG/{,usr/}lib$(uname -m | grep -o 64)/*.la
|
/sbin/makepkg --linkadd y --chown n --prepend "$OUTPUT"/"$PRGNAM"-"$(echo "$VERSION" | tr -d '-')"-"$ARCH"-"$BUILD""$TAG".txz
|
||||||
/sbin/makepkg --linkadd y --chown n --prepend $OUTPUT/$PRGNAM-$(echo $VERSION | tr -d '-')-$ARCH-$BUILD$TAG.txz
|
|
||||||
|
|
Loading…
Reference in a new issue