slackbuilds/d/racket-lang-bin/SlackBuild

59 lines
1.5 KiB
Text
Raw Normal View History

2023-07-01 09:55:41 +02:00
#!/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||')}
2023-07-01 10:43:23 +02:00
BUILD=3
2023-07-01 09:55:41 +02:00
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
2023-07-01 10:43:23 +02:00
rm $PKG$PREFIX/bin/racket-uninstall
mv $PKG$PREFIX/lib/racket/compiled$PKG$PREFIX $PKG$PREFIX/lib/racket/compiled/
rm -r $PKG$PREFIX/lib/racket/compiled/tmp/
2023-07-01 09:55:41 +02:00
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