[x49gp] don't package binaries, run post-install.sh

This commit is contained in:
Gwenhael Le Moine 2021-12-02 16:27:35 +01:00
parent 611e4b87c8
commit 33d7792130
No known key found for this signature in database
GPG key ID: FDFE3669426707A7

View file

@ -4,11 +4,11 @@ set -x
CWD=$(pwd) CWD=$(pwd)
PRGNAM=$(basename $CWD) PRGNAM=$(basename $CWD)
GITHUB_REPO=claudiobsd/x49gp GITHUB_REPO=gwenhael-le-moine/x49gp #claudiobsd/x49gp
VERSION=${VERSION:-$(curl -s https://api.github.com/repos/${GITHUB_REPO}/releases/latest | jq -r .tag_name | sed 's|^null$|trunk|')} # or VERSION=trunk VERSION=${VERSION:-$(curl -s https://api.github.com/repos/${GITHUB_REPO}/releases/latest | jq -r .tag_name | sed 's|^null$|trunk|')} # or VERSION=trunk
NEWRPL_VERSION=1487 NEWRPL_VERSION=1487
BUILD=4 BUILD=5
ARCH=$(uname -m) ARCH=$(uname -m)
LIBSUFFIX=$(echo $ARCH | grep -o "\(64\)") LIBSUFFIX=$(echo $ARCH | grep -o "\(64\)")
@ -45,14 +45,6 @@ find . \
\( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \ \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
-exec chmod 644 {} \; -exec chmod 644 {} \;
# Building
./pull-roms.sh
# temporary fix
[ ! -e ./firmware/boot-49g+.bin ] && [ -e $CWD/boot-49g+.bin ] && cp $CWD/boot-49g+.bin firmware/
[ ! -e ./firmware/boot-50g.bin ] && [ -e $CWD/boot-50g.bin ] && cp $CWD/boot-50g.bin firmware/
sed -i 's|= boot-|= firmware/boot-|g' Makefile
make INSTALL_PREFIX=/usr INSTALL_MAN_DIR=/usr/man/man1 make INSTALL_PREFIX=/usr INSTALL_MAN_DIR=/usr/man/man1
make sdcard INSTALL_PREFIX=/usr INSTALL_MAN_DIR=/usr/man/man1 make sdcard INSTALL_PREFIX=/usr INSTALL_MAN_DIR=/usr/man/man1
@ -60,35 +52,31 @@ make sdcard INSTALL_PREFIX=/usr INSTALL_MAN_DIR=/usr/man/man1
mkdir -p $PKG mkdir -p $PKG
make install DESTDIR=$PKG INSTALL_PREFIX=/usr INSTALL_MAN_DIR=/usr/man/man1 make install DESTDIR=$PKG INSTALL_PREFIX=/usr INSTALL_MAN_DIR=/usr/man/man1
mkdir -p $PKG$PREFIX/share/$PRGNAM
[ ! -e $CWD/hp4950v215.zip ] && wget -c -O $CWD/hp4950v215.zip https://www.hpcalc.org/hp49/pc/rom/hp4950v215.zip
unzip -d $PKG$PREFIX/share/$PRGNAM/ $CWD/hp4950v215.zip
# mkdir -p $PKG$PREFIX/share/$PRGNAM/newrpl-${NEWRPL_VERSION}/
# wget -c -O $PKG$PREFIX/share/$PRGNAM/newrpl-${NEWRPL_VERSION}/newrpl.bin https://phoenixnap.dl.sourceforge.net/project/newrpl/TARGET%2050g-ROM/newRPL-${NEWRPL_VERSION}-firmware-50g.bin
# echo "newrpl.bin" > $PKG$PREFIX/share/$PRGNAM/newrpl-${NEWRPL_VERSION}/update.scp
mkdir -p $PKG$PREFIX/share/$PRGNAM/newrpl/
wget -c -O $PKG$PREFIX/share/$PRGNAM/newrpl/newrplfw.bin https://www.hpgcc3.org/downloads/newrplfw.bin
echo "newrplfw.bin" > $PKG$PREFIX/share/$PRGNAM/newrpl/update.scp
mkdir -p $PKG$PREFIX/doc/$PRGNAM/ mkdir -p $PKG$PREFIX/doc/$PRGNAM/
cp README* sdcard $PKG$PREFIX/doc/$PRGNAM/ cp README* sdcard $PKG$PREFIX/doc/$PRGNAM/
mkdir -p $PKG$PREFIX/doc/$PRGNAM/HP_50g_Advanced_User-s_Reference_Manual_Edition_2 cat <<EOF > $PKG$PREFIX/doc/$PRGNAM/post-install.sh
[ ! -e $CWD/hp50gaur.zip ] && wget -c -O $CWD/hp50gaur.zip https://www.hpcalc.org/hp49/docs/misc/hp50gaur.zip #!/bin/bash
unzip -d $PKG$PREFIX/doc/$PRGNAM/HP_50g_Advanced_User-s_Reference_Manual_Edition_2/ $CWD/hp50gaur.zip
mkdir -p $PKG$PREFIX/doc/$PRGNAM/HP_50g_User-s_Guide mkdir -p $PREFIX/share/$PRGNAM
[ ! -e $CWD/hp50gug.zip ] && wget -c -O $CWD/hp50gug.zip https://www.hpcalc.org/hp49/docs/misc/hp50gug.zip [ ! -e $PREFIX/doc/$PRGNAM/hp-arm-models-bootloader.zip ] && wget -c -O $PREFIX/doc/$PRGNAM/hp-arm-models-bootloader.zip https://www.hpcalc.org/hp49/pc/rom/hp-arm-models-bootloader.zip
unzip -d $PKG$PREFIX/doc/$PRGNAM/HP_50g_User-s_Guide/ $CWD/hp50gug.zip unzip -d $PREFIX/share/$PRGNAM/ $PREFIX/doc/$PRGNAM/hp-arm-models-bootloader.zip
[ ! -e $REPOSITORIES/newRPL-hp50g-usersguide ] && git clone https://github.com/smartin-calc/newRPL-hp50g-usersguide.git $REPOSITORIES/newRPL-hp50g-usersguide [ ! -e $PREFIX/doc/$PRGNAM/hp4950v215.zip ] && wget -c -O $PREFIX/doc/$PRGNAM/hp4950v215.zip https://www.hpcalc.org/hp49/pc/rom/hp4950v215.zip
cd $REPOSITORIES/newRPL-hp50g-usersguide unzip -d $PREFIX/share/$PRGNAM/ $PREFIX/doc/$PRGNAM/hp4950v215.zip
git pull --all
cp -R $REPOSITORIES/newRPL-hp50g-usersguide $PKG$PREFIX/doc/$PRGNAM/ mkdir -p $PREFIX/share/$PRGNAM/newrpl/
rm -fr $PKG$PREFIX/doc/$PRGNAM/newRPL-hp50g-usersguide/.git wget -c -O $PREFIX/share/$PRGNAM/newrpl/newrplfw.bin https://www.hpgcc3.org/downloads/newrplfw.bin
echo "newrplfw.bin" > $PREFIX/share/$PRGNAM/newrpl/update.scp
mkdir -p $PREFIX/doc/$PRGNAM/HP_50g_Advanced_User-s_Reference_Manual_Edition_2
[ ! -e $PREFIX/doc/$PRGNAM/hp50gaur.zip ] && wget -c -O $PREFIX/doc/$PRGNAM/hp50gaur.zip https:/www.hpcalc.org/hp49/docs/misc/hp50gaur.zip
unzip -d $PREFIX/doc/$PRGNAM/HP_50g_Advanced_User-s_Reference_Manual_Edition_2/ $PREFIX/doc/$PRGNAM/hp50gaur.zip
mkdir -p $PREFIX/doc/$PRGNAM/HP_50g_User-s_Guide
[ ! -e $PREFIX/doc/$PRGNAM/hp50gug.zip ] && wget -c -O $PREFIX/doc/$PRGNAM/hp50gug.zip https:/www.hpcalc.org/hp49/docs/misc/hp50gug.zip
unzip -d $PREFIX/doc/$PRGNAM/HP_50g_User-s_Guide/ $PREFIX/doc/$PRGNAM/hp50gug.zip
EOF
# Cleaning # Cleaning
cd $PKG cd $PKG
@ -111,8 +99,9 @@ cat <<EOF > install/doinst.sh
cat /usr/doc/x49gp/README.md | grep "First launch setup" --before-context=2 --after-context=28 cat /usr/doc/x49gp/README.md | grep "First launch setup" --before-context=2 --after-context=28
echo "Prepared folders are installed in $PREFIX/share/$PRGNAM/hp4950v215" echo "Run $PREFIX/doc/$PRGNAM/post-install.sh"
EOF EOF
cat <<EOF > install/slack-desc cat <<EOF > install/slack-desc
$PRGNAM: $PRGNAM (HP49/50 emulator) $PRGNAM: $PRGNAM (HP49/50 emulator)
$PRGNAM: $PRGNAM: