2021-06-15 10:26:26 +02:00
|
|
|
#!/bin/bash
|
2009-11-14 12:48:50 +01:00
|
|
|
set -x -e
|
|
|
|
|
2010-01-29 03:44:37 +01:00
|
|
|
CWD=$(pwd)
|
|
|
|
|
|
|
|
PRGNAM=$(basename $CWD)
|
2009-11-14 12:48:50 +01:00
|
|
|
ARCH=$(uname -m)
|
2022-01-07 14:00:22 +01:00
|
|
|
GITHUB_REPO=factor/factor
|
|
|
|
VERSION=${VERSION:-$(curl -s https://api.github.com/repos/${GITHUB_REPO}/releases/latest | grep tag_name | grep -o "[0-9.]*")}
|
2023-08-25 13:27:23 +02:00
|
|
|
BUILD=${BUILD:-3}
|
2009-11-14 12:48:50 +01:00
|
|
|
|
2020-06-25 11:23:11 +02:00
|
|
|
TAG=gwh
|
2011-02-17 05:54:04 +01:00
|
|
|
OUTPUT=/tmp
|
2011-02-17 05:58:04 +01:00
|
|
|
TMP=/tmp/$TAG
|
|
|
|
PKG=$TMP/pkg-$PRGNAM
|
2009-11-14 12:48:50 +01:00
|
|
|
PREFIX=/usr
|
|
|
|
|
2024-11-18 09:55:36 +01:00
|
|
|
REPOSITORY=${REPOSITORY:-/var/cache/SlackBuilds.gwh/$PRGNAM}
|
2021-09-29 12:57:50 +02:00
|
|
|
|
2022-01-07 14:00:22 +01:00
|
|
|
mkdir -p $TMP
|
2021-09-29 12:57:50 +02:00
|
|
|
|
2009-11-14 12:48:50 +01:00
|
|
|
# cleaning
|
2022-03-03 10:44:46 +01:00
|
|
|
rm -fr $PKG $TMP/$PRGNAM
|
2009-11-14 12:48:50 +01:00
|
|
|
|
2022-01-07 14:00:22 +01:00
|
|
|
# mise en place
|
|
|
|
cd $TMP
|
|
|
|
[ ! -e $REPOSITORY ] && git clone https://github.com/${GITHUB_REPO}.git $REPOSITORY
|
2023-08-25 13:27:23 +02:00
|
|
|
cd $REPOSITORY
|
|
|
|
git pull --all
|
2019-02-27 16:17:20 +01:00
|
|
|
|
2022-01-07 14:00:22 +01:00
|
|
|
[ -e $TMP/$PRGNAM ] && rm -fr $TMP/$PRGNAM
|
|
|
|
cp -R $REPOSITORY $TMP/$PRGNAM
|
|
|
|
cd $TMP/$PRGNAM
|
2024-05-27 07:53:51 +02:00
|
|
|
[ "x$VERSION" == "xlatest" ] && VERSION=$(git tag --sort=-version:refname | head -n1)
|
2022-01-22 10:52:07 +01:00
|
|
|
[ "x$VERSION" == "x" ] && VERSION=trunk
|
2023-03-23 09:54:21 +01:00
|
|
|
[ "x$VERSION" == "xtrunk" ] && VERSION="git_r$(git rev-list --count HEAD)_$(git log -1 --format=%h)" || git checkout $VERSION
|
2022-01-07 14:00:22 +01:00
|
|
|
|
|
|
|
./build.sh update
|
2009-11-14 12:48:50 +01:00
|
|
|
|
|
|
|
# installation
|
2022-01-07 14:00:22 +01:00
|
|
|
mkdir -p $PKG$PREFIX/libexec/$PRGNAM
|
|
|
|
cp -a * $PKG$PREFIX/libexec/$PRGNAM
|
|
|
|
|
2022-03-03 10:44:46 +01:00
|
|
|
mkdir -p $PKG$PREFIX/{bin,doc/$PRGNAM}
|
2023-08-25 13:27:23 +02:00
|
|
|
cat <<EOF > $PKG$PREFIX/bin/factor
|
2021-06-15 10:26:26 +02:00
|
|
|
#!/bin/bash
|
2010-09-09 04:10:46 +02:00
|
|
|
cd $PREFIX/libexec/$PRGNAM
|
2023-08-25 13:27:23 +02:00
|
|
|
./factor \$@
|
2009-11-14 12:48:50 +01:00
|
|
|
EOF
|
2023-08-25 13:27:23 +02:00
|
|
|
chmod +x $PKG$PREFIX/bin/factor
|
|
|
|
|
2022-03-03 10:44:46 +01:00
|
|
|
( cd $PKG$PREFIX/doc/$PRGNAM
|
2010-05-12 08:55:17 +02:00
|
|
|
ln -s ../libexec/$PRGNAM/readme.html
|
|
|
|
ln -s ../libexec/$PRGNAM/license.txt
|
2009-11-14 12:48:50 +01:00
|
|
|
)
|
|
|
|
|
|
|
|
# packaging
|
|
|
|
cd $PKG
|
|
|
|
mkdir install
|
|
|
|
cat <<EOF > install/slack-desc
|
|
|
|
$PRGNAM: $PRGNAM (A practical stack language)
|
2019-02-27 16:17:20 +01:00
|
|
|
$PRGNAM:
|
2009-11-14 12:48:50 +01:00
|
|
|
$PRGNAM: Factor is expressive, fast, supports interactive development and has a
|
|
|
|
$PRGNAM: full-featured library. Factor runs on all common platforms and Factor
|
|
|
|
$PRGNAM: applications are portable between them. Factor can deploy stand-alone
|
|
|
|
$PRGNAM: applications on all platforms.
|
2019-02-27 16:17:20 +01:00
|
|
|
$PRGNAM:
|
2022-03-03 10:44:46 +01:00
|
|
|
$PRGNAM: see $PREFIX/doc/$PRGNAM
|
2019-02-27 16:17:20 +01:00
|
|
|
$PRGNAM:
|
2009-11-14 12:48:50 +01:00
|
|
|
$PRGNAM: http://factorcode.org/
|
2019-02-27 16:17:20 +01:00
|
|
|
$PRGNAM:
|
2009-11-14 12:48:50 +01:00
|
|
|
EOF
|
|
|
|
|
2018-04-20 23:02:35 +02:00
|
|
|
rm -f $PKG/{,usr/}lib$(uname -m | grep -o 64)/*.la
|
2023-08-16 12:23:26 +02:00
|
|
|
/sbin/makepkg --linkadd y --chown n --prepend $OUTPUT/$PRGNAM-$(echo $VERSION | tr -d '-')-$ARCH-$BUILD$TAG.txz
|