#!/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. # 20250223 bkw: update for latest upstream git, 0.2+20250222_db15677. # Got an email from upstream, he's moved the code to github and done a # bit of work on it recently. cd $(dirname $0) ; CWD=$(pwd) PRGNAM=msbasic2ascii VERSION=${VERSION:-0.2+20250222_db15677} COMMIT=${COMMIT:-db15677bc904fca004290ac0f7c6a89663a86f3e} SRCNAM=detokenizers 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 $SRCNAM-$COMMIT tar xvf $CWD/$SRCNAM-$COMMIT.tar.gz cd $SRCNAM-$COMMIT 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 {} + PKGMAN1=$PKG/usr/man/man1 PKGBIN=$PKG/usr/bin mkdir -p $PKGBIN $PKGMAN1 # 20250223 bkw: Fix implicit prototype warnings. echo 'extern void gwb_dprintf(char *format, ...);' >> gwbasic.h # 20250223 bkw: Upstream removed the experimental/untested stuff # from the Makefile; put it back. Also fix missing commas in nascom.h. patch -p1 < $CWD/restore_untested.diff # 20250223 bkw: 'make install' is broken, don't use. sed -i "/^CFLAGS/s,-g,$SLKCFLAGS," Makefile make install -s \ trs80ascii msxascii gwascii cpmascii cocoascii drascii trsm4ascii \ $PKGBIN # '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 install -s osiascii sorcascii nscmascii xtalascii compucolorascii $PKGBIN cp -a *.1 $PKGMAN1 gzip $PKGMAN1/*.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