[d/hptools] add

This commit is contained in:
Gwenhael Le Moine 2021-11-11 16:05:29 +01:00
parent 542a49c71e
commit 80885890b4
No known key found for this signature in database
GPG key ID: FDFE3669426707A7

72
d/hptools/SlackBuild Executable file
View file

@ -0,0 +1,72 @@
#!/bin/bash
set -x -e
CWD=$(pwd)
PRGNAM=$(basename $CWD)
ARCH=$(uname -m)
BUILD=1
VERSION=${VERSION:-3.0.8}
PATCH_VERSION=${PATCH_VERSION:-0.3.2.1}
TAG=gwh
OUTPUT=/tmp
TMP=/tmp/$TAG
PKG=$TMP/pkg-$PRGNAM
PREFIX=/usr
REPOSITORY=${REPOSITORY:-/home/installs/SlackBuilds/repositories/$PRGNAM}
mkdir -p $REPOSITORY
# cleaning
rm -fr $PKG $TMP
# download
[ ! -e $REPOSITORY/hptools-src-${VERSION}.tar.gz ] && wget -c https://www.hpcalc.org/hp48/pc/programming/hptools-src-${VERSION}.tar.gz -O $REPOSITORY/hptools-src-${VERSION}.tar.gz
[ ! -e $REPOSITORY/hptools-patch-${PATCH_VERSION}.zip ] && wget -c https://www.hpcalc.org/hp48/pc/programming/hptools-patch-${PATCH_VERSION}.zip -O $REPOSITORY/hptools-patch-${PATCH_VERSION}.zip
# installation
mkdir -p $PKG $TMP
cd $TMP
tar xvf $REPOSITORY/hptools-src-${VERSION}.tar.gz
cd Hptools
unzip $REPOSITORY/hptools-patch-${PATCH_VERSION}.zip
gunzip hptools.patch.gz
patch -p2 < ./hptools.patch
bash -x ./fixperms.sh
./autogen.sh
./configure \
--prefix=$PREFIX
make
sed -i "s|dir = $PREFIX|dir = $PKG$PREFIX|g" x86_64-unknown-linux-gnu/Makefile
mkdir -p $PKG$PREFIX/bin
make install DESTDIR=$PKG
mkdir -p $PKG$PREFIX/doc/$PRGNAM
cp -R doc/* $PKG$PREFIX/doc/$PRGNAM
chmod 644 $PKG$PREFIX/doc/$PRGNAM/*
# packaging
cd $PKG
mkdir install
cat <<EOF > install/slack-desc
$PRGNAM: $PRGNAM (System RPL and assembly language development kit)
$PRGNAM:
$PRGNAM: free System RPL and assembly language (HP syntax and MASD [Meta Kernel] syntax) development kit.
$PRGNAM:
$PRGNAM:
$PRGNAM:
$PRGNAM:
$PRGNAM:
$PRGNAM:
$PRGNAM: https://www.hpcalc.org/details/4263
$PRGNAM: https://www.hpcalc.org/details/8971
EOF
rm -f $PKG/{,usr/}lib$(uname -m | grep -o 64)/*.la
/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-${VERSION}_$PATCH_VERSION-$ARCH-$BUILD$TAG.txz