From 80885890b46322164e6a13c1395f97900c1127fa Mon Sep 17 00:00:00 2001 From: Gwenhael Le Moine Date: Thu, 11 Nov 2021 16:05:29 +0100 Subject: [PATCH] [d/hptools] add --- d/hptools/SlackBuild | 72 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100755 d/hptools/SlackBuild diff --git a/d/hptools/SlackBuild b/d/hptools/SlackBuild new file mode 100755 index 00000000..60b496b4 --- /dev/null +++ b/d/hptools/SlackBuild @@ -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 < 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