[d/racket-lang-bin] Added

This commit is contained in:
Gwenhael Le Moine 2023-07-01 09:55:41 +02:00
parent bdb9404ee3
commit 9dc4e3c8f3
No known key found for this signature in database
GPG key ID: FDFE3669426707A7

56
d/racket-lang-bin/SlackBuild Executable file
View file

@ -0,0 +1,56 @@
#!/bin/bash
set -x -e
CWD=$(pwd)
PRGNAM=$(basename $CWD)
ARCH=$(uname -m)
GITHUB_REPO=racket/racket
VERSION=${VERSION:-$(curl -s https://api.github.com/repos/${GITHUB_REPO}/releases/latest | jq -r .tag_name | sed 's|^v||')}
BUILD=1
TAG=gwh
OUTPUT=/tmp
TMP=/tmp/$TAG
PKG=$TMP/pkg-$PRGNAM
PREFIX=/usr
REPOSITORY=${REPOSITORY:-/home/installs/SlackBuilds/_repositories/$PRGNAM}
# cleaning
rm -fr $PKG
mkdir -p $PKG
# getting
mkdir -p $REPOSITORY
[ ! -e $REPOSITORY/racket-${VERSION}-${ARCH}-linux-cs.sh ] && wget -c https://download.racket-lang.org/installers/${VERSION}/racket-${VERSION}-${ARCH}-linux-cs.sh -O $REPOSITORY/racket-${VERSION}-${ARCH}-linux-cs.sh
# installing
chmod +x $REPOSITORY/racket-${VERSION}-${ARCH}-linux-cs.sh
$REPOSITORY/racket-${VERSION}-${ARCH}-linux-cs.sh --unix-style --create-dir --dest $PKG$PREFIX
# post-install
[ -e $PKG$PREFIX/bin/racket-uninstall ] && rm $PKG$PREFIX/bin/racket-uninstall
mv $PKG$PREFIX/share/man $PKG$PREFIX
[ -d $PKG$PREFIX/man ] && find $PKG$PREFIX/man -type f -not -name \*.gz -exec gzip -9 {} \;
# packaging
cd $PKG
mkdir install
cat <<EOF > install/slack-desc
$PRGNAM: $PRGNAM (the Language-Oriented Programming Language)
$PRGNAM:
$PRGNAM:
$PRGNAM:
$PRGNAM:
$PRGNAM:
$PRGNAM:
$PRGNAM:
$PRGNAM:
$PRGNAM: https://racket-lang.org/
$PRGNAM:
EOF
rm -f $PKG/{,usr/}lib$(uname -m | grep -o 64)/*.la
/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$(echo $VERSION | tr -d '-')-$ARCH-$BUILD$TAG.txz