From 9dc4e3c8f30bd2a68c22520e8419bc69cd7f6520 Mon Sep 17 00:00:00 2001 From: Gwenhael Le Moine Date: Sat, 1 Jul 2023 09:55:41 +0200 Subject: [PATCH] [d/racket-lang-bin] Added --- d/racket-lang-bin/SlackBuild | 56 ++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100755 d/racket-lang-bin/SlackBuild diff --git a/d/racket-lang-bin/SlackBuild b/d/racket-lang-bin/SlackBuild new file mode 100755 index 00000000..b111f511 --- /dev/null +++ b/d/racket-lang-bin/SlackBuild @@ -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 < 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