slackbuilds_ponce/development/msbasic2ascii/msbasic2ascii.SlackBuild
B. Watson 86af8dcfaa
development/msbasic2ascii: Added (detokenizers for MS BASIC)
Signed-off-by: bedlam <dave@slackbuilds.org>

Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
2023-04-29 18:11:44 +07:00

83 lines
2 KiB
Bash

#!/bin/bash
# Slackware build script for msbasic2ascii
# Written by B. Watson (urchlay@slackware.uk)
# Licensed under the WTFPL. See http://www.wtfpl.net/txt/copying/ for details.
cd $(dirname $0) ; CWD=$(pwd)
PRGNAM=msbasic2ascii
VERSION=${VERSION:-0.2}
BUILD=${BUILD:-1}
TAG=${TAG:-_SBo}
PKGTYPE=${PKGTYPE:-tgz}
if [ -z "$ARCH" ]; then
case "$( uname -m )" in
i?86) ARCH=i586 ;;
arm*) ARCH=arm ;;
*) ARCH=$( uname -m ) ;;
esac
fi
if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
exit 0
fi
TMP=${TMP:-/tmp/SBo}
PKG=$TMP/package-$PRGNAM
OUTPUT=${OUTPUT:-/tmp}
if [ "$ARCH" = "i586" ]; then
SLKCFLAGS="-O2 -march=i586 -mtune=i686"
elif [ "$ARCH" = "i686" ]; then
SLKCFLAGS="-O2 -march=i686 -mtune=i686"
elif [ "$ARCH" = "x86_64" ]; then
SLKCFLAGS="-O2 -fPIC"
else
SLKCFLAGS="-O2"
fi
set -e
rm -rf $PKG
mkdir -p $TMP $PKG $OUTPUT
cd $TMP
rm -rf $PRGNAM-$VERSION
tar xvf $CWD/$PRGNAM-$VERSION.tar.gz
cd $PRGNAM-$VERSION
chown -R root:root .
find -L . -perm /111 -a \! -perm 755 -a -exec chmod 755 {} \+ -o \
\! -perm /111 -a \! -perm 644 -a -exec chmod 644 {} \+
# Fixes for modern compilers. Actually some of this stuff would be broken
# on 2000-era gcc, even.
patch -p1 < $CWD/compile_fixes.diff
sed -i "/^CFLAGS/s,-g,$SLKCFLAGS," Makefile
make
mkdir -p $PKG/usr/bin $PKG/usr/man/man1
make install INSTDIR=$PKG/usr/bin
# 'make install' doesn't build/install these. Include them in case someone
# needs them. They ain't no man pages for 'em, but *shrug*.
make untst
cp -a osiascii sorcascii nscmascii xtalascii compucolorascii $PKG/usr/bin
strip $PKG/usr/bin/*
cp -a *.1 $PKG/usr/man/man1
gzip $PKG/usr/man/man1/*.1
PKGDOC=$PKG/usr/doc/$PRGNAM-$VERSION
mkdir -p $PKGDOC
cp -a CHANGES COPYRIGHT README* TODO $PKGDOC
cat $CWD/$PRGNAM.SlackBuild > $PKGDOC/$PRGNAM.SlackBuild
mkdir -p $PKG/install
cat $CWD/slack-desc > $PKG/install/slack-desc
cd $PKG
/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE