summaryrefslogtreecommitdiffstats
path: root/system/cbmbasic
diff options
context:
space:
mode:
Diffstat (limited to 'system/cbmbasic')
-rw-r--r--system/cbmbasic/README5
-rw-r--r--system/cbmbasic/cbmbasic.194
-rw-r--r--system/cbmbasic/cbmbasic.SlackBuild40
-rw-r--r--system/cbmbasic/cbmbasic.info10
-rw-r--r--system/cbmbasic/cbmbasic.rst75
-rw-r--r--system/cbmbasic/git2tarxz.sh48
6 files changed, 251 insertions, 21 deletions
diff --git a/system/cbmbasic/README b/system/cbmbasic/README
index 8fb257cf98..84386a8201 100644
--- a/system/cbmbasic/README
+++ b/system/cbmbasic/README
@@ -1,8 +1,9 @@
cbmbasic (Commodore BASIC V2 as a scripting language)
Commodore BASIC (cbmbasic) is a 100% compatible version of Commodore's
-version of Microsoft 6502 BASIC as found on the Commodore 64. You can use
-it in interactive mode or pass a BASIC file as a command line parameter.
+version of Microsoft 6502 BASIC as found on the Commodore 64. You
+can use it in interactive mode or pass a BASIC file as a command line
+parameter.
This does not emulate 6502 code; all code is completely native. On a
1GHz CPU you get about 1000x speed compared to a 1MHz 6502.
diff --git a/system/cbmbasic/cbmbasic.1 b/system/cbmbasic/cbmbasic.1
new file mode 100644
index 0000000000..2f4273baac
--- /dev/null
+++ b/system/cbmbasic/cbmbasic.1
@@ -0,0 +1,94 @@
+.\" Man page generated from reStructuredText.
+.
+.
+.nr rst2man-indent-level 0
+.
+.de1 rstReportMargin
+\\$1 \\n[an-margin]
+level \\n[rst2man-indent-level]
+level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
+-
+\\n[rst2man-indent0]
+\\n[rst2man-indent1]
+\\n[rst2man-indent2]
+..
+.de1 INDENT
+.\" .rstReportMargin pre:
+. RS \\$1
+. nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin]
+. nr rst2man-indent-level +1
+.\" .rstReportMargin post:
+..
+.de UNINDENT
+. RE
+.\" indent \\n[an-margin]
+.\" old: \\n[rst2man-indent\\n[rst2man-indent-level]]
+.nr rst2man-indent-level -1
+.\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
+.in \\n[rst2man-indent\\n[rst2man-indent-level]]u
+..
+.TH "CBMBASIC" 1 "2022-12-27" "1.0+20221218_352a313" "SlackBuilds.org"
+.SH NAME
+cbmbasic \- port of Commodore 64 BASIC to modern systems
+.\" RST source for cbmbasic(1) man page. Convert with:
+.
+.\" rst2man.py cbmbasic.rst > cbmbasic.1
+.
+.\" rst2man.py comes from the SBo development/docutils package.
+.
+.SH SYNOPSIS
+.sp
+\fBcbmbasic\fP
+.sp
+\fBcbmbasic\fP \fIprogram.bas\fP
+.SH DESCRIPTION
+.sp
+\fBcbmbasic\fP is a 100% compatible version of Commodore\(aqs version of
+Microsoft BASIC 6502 as found on the Commodore 64. You can use it in
+interactive mode or pass a BASIC file as a command line parameter.
+.sp
+\fBcbmbasic\fP does not emulate 6502 code; all code is completely native. On a 1 GHz CPU you get about 1000x speed compared to a 1 MHz 6502.
+.sp
+There are no command\-line options.
+.SH USAGE
+.sp
+You can use \fBcbmbasic\fP in interactive mode by just running the binary
+without parameters, or you can specify an ASCII\-encoded BASIC program
+on the command line. You can also use \fBcbmbasic\fP as a UNIX scripting
+language by adding a hashbang line to your BASIC program and making
+it executable:
+.INDENT 0.0
+.INDENT 3.5
+.sp
+.nf
+.ft C
+$ ls \-l hello.bas
+\-rwxr\-xr\-x 1 mist staff 40 7 Apr 21:30 hello.bas
+$ cat hello.bas
+#!/usr/bin/env cbmbasic
+PRINT"HELLO WORLD!"
+$ ./hello.bas
+HELLO WORLD!
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.sp
+\fBcbmbasic\fP implements a small plugin system that lets developers add
+additional statements, functions etc. Right now, you can turn this on
+with \fBSYS 1\fP (turn off with \fBSYS 0\fP) and use the new statements
+LOCATE \fIy\fP, \fIx\fP (set cursor position), SYSTEM \fIstring\fP (run shell
+command) and the extended WAIT \fIport\fP, \fImask\fP, which implements the
+Bill Gates easter egg.
+.SH AUTHORS
+.sp
+\fBcbmbasic\fP was ported by Michael Steil and James Abbatiello. The
+original 6502 version was written by Microsoft.
+.sp
+This man page written for the SlackBuilds.org project
+by B. Watson, and is licensed under the WTFPL.
+.SH SEE ALSO
+.sp
+The cbmbasic homepage: \fI\%https://github.com/mist64/cbmbasic\fP
+.\" Generated by docutils manpage writer.
+.
diff --git a/system/cbmbasic/cbmbasic.SlackBuild b/system/cbmbasic/cbmbasic.SlackBuild
index c79a12ce26..3dfce9ebc4 100644
--- a/system/cbmbasic/cbmbasic.SlackBuild
+++ b/system/cbmbasic/cbmbasic.SlackBuild
@@ -1,15 +1,21 @@
-#!/bin/sh
+#!/bin/bash
# Slackware build script for cbmbasic
-# Written by B. Watson (yalhcru@gmail.com)
+# Written by B. Watson (urchlay@slackware.uk)
# Licensed under the WTFPL. See http://www.wtfpl.net/txt/copying/ for details.
+# 20221227 bkw: update to latest git, add man page
+# 20210827 bkw: fix build on -current
+
+cd $(dirname $0) ; CWD=$(pwd)
+
PRGNAM=cbmbasic
-VERSION=${VERSION:-1.0}
+VERSION=${VERSION:-1.0+20221218_352a313}
BUILD=${BUILD:-1}
TAG=${TAG:-_SBo}
+PKGTYPE=${PKGTYPE:-tgz}
if [ -z "$ARCH" ]; then
case "$( uname -m )" in
@@ -19,7 +25,11 @@ if [ -z "$ARCH" ]; then
esac
fi
-CWD=$(pwd)
+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}
@@ -44,25 +54,27 @@ rm -rf $PKG
mkdir -p $TMP $PKG $OUTPUT
cd $TMP
rm -rf $PRGNAM-$VERSION
-tar xvf $CWD/$PRGNAM-$VERSION.tgz
+tar xvf $CWD/$PRGNAM-$VERSION.tar.xz
cd $PRGNAM-$VERSION
chown -R root:root .
-find -L . \
- \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \
- -o -perm 511 \) -exec chmod 755 {} \; -o \
- \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
- -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
+find -L . -perm /111 -a \! -perm 755 -a -exec chmod 755 {} \+ -o \
+ \! -perm /111 -a \! -perm 644 -a -exec chmod 644 {} \+
make CFLAGS="$SLKCFLAGS" LDFLAGS="-L/usr/lib$LIBDIRSUFFIX"
mkdir -p $PKG/usr/bin
install -s -m0755 $PRGNAM $PKG/usr/bin
-mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
-cp -a README.txt test/*.bas $PKG/usr/doc/$PRGNAM-$VERSION
-cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
+mkdir -p $PKG/usr/man/man1
+gzip -9c < $CWD/$PRGNAM.1 > $PKG/usr/man/man1/$PRGNAM.1.gz
+
+PKGDOC=$PKG/usr/doc/$PRGNAM-$VERSION
+mkdir -p $PKGDOC/examples
+cp -a README.* $PKGDOC
+cp -a test/*.bas $PKGDOC/examples
+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:-tgz}
+/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE
diff --git a/system/cbmbasic/cbmbasic.info b/system/cbmbasic/cbmbasic.info
index ae226159f9..5723de8317 100644
--- a/system/cbmbasic/cbmbasic.info
+++ b/system/cbmbasic/cbmbasic.info
@@ -1,10 +1,10 @@
PRGNAM="cbmbasic"
-VERSION="1.0"
-HOMEPAGE="http://cbmbasic.sourceforge.net/"
-DOWNLOAD="http://downloads.sourceforge.net/project/cbmbasic/cbmbasic/1.0/cbmbasic-1.0.tgz"
-MD5SUM="966cf93950809c3eace244af702cf895"
+VERSION="1.0+20221218_352a313"
+HOMEPAGE="https://github.com/mist64/cbmbasic"
+DOWNLOAD="https://slackware.uk/~urchlay/src/cbmbasic-1.0+20221218_352a313.tar.xz"
+MD5SUM="259ba3cda69d9436545e5e5ae6427330"
DOWNLOAD_x86_64=""
MD5SUM_x86_64=""
REQUIRES=""
MAINTAINER="B. Watson"
-EMAIL="yalhcru@gmail.com"
+EMAIL="urchlay@slackware.uk"
diff --git a/system/cbmbasic/cbmbasic.rst b/system/cbmbasic/cbmbasic.rst
new file mode 100644
index 0000000000..bc34a0d8bb
--- /dev/null
+++ b/system/cbmbasic/cbmbasic.rst
@@ -0,0 +1,75 @@
+.. RST source for cbmbasic(1) man page. Convert with:
+.. rst2man.py cbmbasic.rst > cbmbasic.1
+.. rst2man.py comes from the SBo development/docutils package.
+
+.. |version| replace:: 1.0+20221218_352a313
+.. |date| date::
+
+========
+cbmbasic
+========
+
+--------------------------------------------
+port of Commodore 64 BASIC to modern systems
+--------------------------------------------
+
+:Manual section: 1
+:Manual group: SlackBuilds.org
+:Date: |date|
+:Version: |version|
+
+SYNOPSIS
+========
+
+**cbmbasic**
+
+**cbmbasic** *program.bas*
+
+DESCRIPTION
+===========
+
+**cbmbasic** is a 100% compatible version of Commodore's version of
+Microsoft BASIC 6502 as found on the Commodore 64. You can use it in
+interactive mode or pass a BASIC file as a command line parameter.
+
+**cbmbasic** does not emulate 6502 code; all code is completely native. On a 1 GHz CPU you get about 1000x speed compared to a 1 MHz 6502.
+
+There are no command-line options.
+
+USAGE
+=====
+
+You can use **cbmbasic** in interactive mode by just running the binary
+without parameters, or you can specify an ASCII-encoded BASIC program
+on the command line. You can also use **cbmbasic** as a UNIX scripting
+language by adding a hashbang line to your BASIC program and making
+it executable::
+
+ $ ls -l hello.bas
+ -rwxr-xr-x 1 mist staff 40 7 Apr 21:30 hello.bas
+ $ cat hello.bas
+ #!/usr/bin/env cbmbasic
+ PRINT"HELLO WORLD!"
+ $ ./hello.bas
+ HELLO WORLD!
+
+**cbmbasic** implements a small plugin system that lets developers add
+additional statements, functions etc. Right now, you can turn this on
+with **SYS 1** (turn off with **SYS 0**) and use the new statements
+LOCATE *y*, *x* (set cursor position), SYSTEM *string* (run shell
+command) and the extended WAIT *port*, *mask*, which implements the
+Bill Gates easter egg.
+
+AUTHORS
+=======
+
+**cbmbasic** was ported by Michael Steil and James Abbatiello. The
+original 6502 version was written by Microsoft.
+
+This man page written for the SlackBuilds.org project
+by B. Watson, and is licensed under the WTFPL.
+
+SEE ALSO
+========
+
+The cbmbasic homepage: https://github.com/mist64/cbmbasic
diff --git a/system/cbmbasic/git2tarxz.sh b/system/cbmbasic/git2tarxz.sh
new file mode 100644
index 0000000000..c2be8b2710
--- /dev/null
+++ b/system/cbmbasic/git2tarxz.sh
@@ -0,0 +1,48 @@
+#!/bin/sh
+
+# Create source tarball from git repo, with generated version
+# number.
+
+# Note that this script doesn't need to be run as root. It does
+# need to be able to write to the current directory it's run from.
+
+# Takes one optional argument, which is the commit or tag to create
+# a tarball of. With no arg, HEAD is used.
+
+# Upstream doesn't use tags. Old (sourceforge) release was 1.0
+# before the move to github, so include 1.0 in VERSION.
+OLDVER=1.0
+
+PRGNAM=cbmbasic
+CLONE_URL=https://github.com/mist64/cbmbasic
+
+set -e
+
+GITDIR=$( mktemp -dt $PRGNAM.git.XXXXXX )
+rm -rf $GITDIR
+git clone $CLONE_URL $GITDIR
+
+CWD="$( pwd )"
+cd $GITDIR
+
+if [ "$1" != "" ]; then
+ git reset --hard "$1" || exit 1
+fi
+
+GIT_SHA=$( git rev-parse --short HEAD )
+
+DATE=$( git log --date=format:%Y%m%d --format=%cd | head -1 )
+
+VERSION=${OLDVER}+${DATE}_${GIT_SHA}
+
+rm -rf .git
+find . -name .gitignore -print0 | xargs -0 rm -f
+
+cd "$CWD"
+rm -rf $PRGNAM-$VERSION $PRGNAM-$VERSION.tar.xz
+mv $GITDIR $PRGNAM-$VERSION
+tar cvfJ $PRGNAM-$VERSION.tar.xz $PRGNAM-$VERSION
+
+echo
+echo "Created tarball: $PRGNAM-$VERSION.tar.xz"
+echo "VERSION=$VERSION"