aboutsummaryrefslogtreecommitdiff
path: root/development/bascat
diff options
context:
space:
mode:
authorB. Watson <urchlay@slackware.uk>2023-05-08 18:24:58 +0100
committerWilly Sudiarto Raharjo <willysr@slackbuilds.org>2023-05-13 19:27:03 +0700
commit67a6accbaa9354bb422aef290f063d0aa83d913a (patch)
tree45556e06d3a29c6fbc125e1e17de2679ae0c10e6 /development/bascat
parent5793f20488503443961e5e95b916d4cffc8b3ba2 (diff)
development/bascat: Added (detokenizer for BBC BASIC programs)
Signed-off-by: bedlam <dave@slackbuilds.org> Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
Diffstat (limited to 'development/bascat')
-rw-r--r--development/bascat/README7
-rw-r--r--development/bascat/bascat.1114
-rw-r--r--development/bascat/bascat.SlackBuild96
-rw-r--r--development/bascat/bascat.info14
-rw-r--r--development/bascat/bascat.rst98
-rw-r--r--development/bascat/git2tarxz.sh47
-rw-r--r--development/bascat/slack-desc19
7 files changed, 395 insertions, 0 deletions
diff --git a/development/bascat/README b/development/bascat/README
new file mode 100644
index 0000000000000..3a78a70c47f5b
--- /dev/null
+++ b/development/bascat/README
@@ -0,0 +1,7 @@
+bascat (detokenizer for BBC BASIC programs)
+
+bascat is a program that will convert BBC BASIC files to text, like
+the LIST command does.
+
+bascat reads tokenized BASIC files, not disk images. To extract a file
+from a disk image, use dfsimage (also available on SlackBuild.org).
diff --git a/development/bascat/bascat.1 b/development/bascat/bascat.1
new file mode 100644
index 0000000000000..0d7fedd62d243
--- /dev/null
+++ b/development/bascat/bascat.1
@@ -0,0 +1,114 @@
+.\" 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 "BASCAT" 1 "2023-05-05" "1.2pre2" "SlackBuilds.org"
+.SH NAME
+bascat \- detokenizer for BBC Micro BASIC programs
+.\" RST source for bascat(1) man page. Convert with:
+.
+.\" rst2man.py bascat.rst > bascat.1
+.
+.\" rst2man.py comes from the SBo development/docutils package.
+.
+.SH SYNOPSIS
+.sp
+\fBbascat\fP [\fI\-\-help\fP | \fI\-h\fP] [\fI\-\-version\fP | \fI\-v\fP] [\fI\-\-line\-numbers\fP | \fI\-n\fP] [\fI\-\-no\-line\-numbers\fP | \fI+n\fP] [\fI\-\-highlight\fP | \fI\-l\fP ] [\fI\-\-no\-highlight\fP | \fI+l\fP ] [\fI\-\-pager=PAGER\fP | \fI\-p PAGER\fP] [\fIfile\fP ...]
+.SH DESCRIPTION
+.sp
+Types tokenized (SAVEd) BBC BASIC programs in a readable way.
+.sp
+With no \fIfile\fP arguments, \fBbascat\fP reads from standard input.
+.sp
+If standard output is a terminal, output will be piped through a
+pager. The default is \fB$PAGER\fP from the environment, or \fBless\fP if
+not set. Note that if standard output is not a terminal (e.g. if redirecting to
+a file), no pager is used.
+.sp
+Options can be placed in the \fBBASCAT\fP environment variable, if you don\(aqt
+like the standard settings.
+.SH OPTIONS
+.sp
+Prefix long options with \fBno\-\fP to cancel them. Use \fB+\fP to cancel short options.
+.INDENT 0.0
+.TP
+.B \-\-help\fP,\fB \-h
+Display built\-in help message and exit.
+.TP
+.B \-\-version\fP,\fB \-h
+Display version number and exit.
+.TP
+.B \-\-line\-numbers\fP,\fB \-n
+Display line numbers for each line. This is enabled by default; use \fB+n\fP or
+\fB\-\-no\-line\-numbers\fP to disable.
+.TP
+.B \-\-highlight\fP,\fB \-l
+Attempts to highlight keywords. Whether this works properly or not depends on
+the pager in use; \fBmore\fP(1), \fBless\fP(1), and \fBmost\fP(1) work correctly.
+\fBlv\fP(1) will work if you have \fB\-c\fP in \fB~/.lv\fP or \fBLV\fP in the environment.
+.TP
+.BI \-\-pager\fB= pager\fR,\fB \ \-p \ pager
+Sets pager to use, if standard output is a terminal. Overrides \fBPAGER\fP environment variable.
+If you don\(aqt want a pager, use \fB\-p cat\fP\&.
+.UNINDENT
+.\" FILES
+.
+.\" =====
+.
+.\" ENVIRONMENT
+.
+.\" ===========
+.
+.\" EXIT STATUS
+.
+.\" ===========
+.
+.\" BUGS
+.
+.\" ====
+.
+.\" EXAMPLES
+.
+.\" ========
+.
+.SH COPYRIGHT
+.sp
+See the file /usr/doc/bascat\-1.2pre2/README for license information.
+.SH AUTHORS
+.sp
+\fBbascat\fP was written by Matthew Wilcox and Mark Wooding.
+.sp
+This man page written for the SlackBuilds.org project
+by B. Watson, and is licensed under the WTFPL.
+.SH SEE ALSO
+.sp
+\fBdfsimage\fP(1)
+.sp
+The bascat homepage: \fI\%https://git.distorted.org.uk/~mdw/\fP
+.\" Generated by docutils manpage writer.
+.
diff --git a/development/bascat/bascat.SlackBuild b/development/bascat/bascat.SlackBuild
new file mode 100644
index 0000000000000..19b824c78c820
--- /dev/null
+++ b/development/bascat/bascat.SlackBuild
@@ -0,0 +1,96 @@
+#!/bin/bash
+
+# Slackware build script for bascat
+
+# 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=bascat
+VERSION=${VERSION:-1.2pre2+20121019_39f2290}
+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.xz
+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 {} \+
+
+# These 2 files came from another git repo by the same author.
+cat $CWD/mdwopt.c > mdwopt.c
+cat $CWD/mdwopt.h > mdwopt.h
+
+# Set correct version number in the binary, use a less ancient pager.
+# The --with-pager option is broken, or else I'd use that instead.
+sed -i -e "s,AUTO_VERSION,$VERSION," \
+ -e '/PAGER/s,"more","less",' \
+ configure.ac
+
+# Enable the -n/--line-numbers option by default. It's *completely stupid*
+# to have this disabled by default.
+sed -i '/^static int flags/s|;| = f_linenumbers;|' $PRGNAM.c
+
+autoreconf -if
+
+# The termcap stuff is supposed to be autodetected, but it fails. It's
+# needed for the -l/--highlight option to work.
+CFLAGS="$SLKCFLAGS -DHAVE_LIBTERMCAP" \
+LIBS="-ltermcap" \
+./configure \
+ --prefix=/usr \
+ --build=$ARCH-slackware-linux
+
+make
+make install-strip DESTDIR=$PKG
+
+# Man page by SlackBuild author.
+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
+cp -a AUTHORS ChangeLog NEWS README $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
diff --git a/development/bascat/bascat.info b/development/bascat/bascat.info
new file mode 100644
index 0000000000000..a7903d77a8f04
--- /dev/null
+++ b/development/bascat/bascat.info
@@ -0,0 +1,14 @@
+PRGNAM="bascat"
+VERSION="1.2pre2+20121019_39f2290"
+HOMEPAGE="https://git.distorted.org.uk/~mdw/bascat"
+DOWNLOAD="https://slackware.uk/~urchlay/src/bascat-1.2pre2+20121019_39f2290.tar.xz \
+ https://git.distorted.org.uk/~mdw/cfd/blob_plain/9419af788cb0a97690da8b3ee6c59f2665d36533:/mdwopt.c \
+ https://git.distorted.org.uk/~mdw/cfd/blob_plain/9419af788cb0a97690da8b3ee6c59f2665d36533:/mdwopt.h"
+MD5SUM="a785092ec971679797d87474333906fb \
+ 1beee96e71ff21c0349f09fbdee7c5dc \
+ 42267e18170dbe0767f58964fb428e34"
+DOWNLOAD_x86_64=""
+MD5SUM_x86_64=""
+REQUIRES=""
+MAINTAINER="B. Watson"
+EMAIL="urchlay@slackware.uk"
diff --git a/development/bascat/bascat.rst b/development/bascat/bascat.rst
new file mode 100644
index 0000000000000..f0f089319e670
--- /dev/null
+++ b/development/bascat/bascat.rst
@@ -0,0 +1,98 @@
+.. RST source for bascat(1) man page. Convert with:
+.. rst2man.py bascat.rst > bascat.1
+.. rst2man.py comes from the SBo development/docutils package.
+
+.. |version| replace:: 1.2pre2
+.. |date| date::
+
+======
+bascat
+======
+
+----------------------------------------
+detokenizer for BBC Micro BASIC programs
+----------------------------------------
+
+:Manual section: 1
+:Manual group: SlackBuilds.org
+:Date: |date|
+:Version: |version|
+
+SYNOPSIS
+========
+
+**bascat** [*--help* | *-h*] [*--version* | *-v*] [*--line-numbers* | *-n*] [*--no-line-numbers* | *+n*] [*--highlight* | *-l* ] [*--no-highlight* | *+l* ] [*--pager=PAGER* | *-p PAGER*] [*file* ...]
+
+DESCRIPTION
+===========
+
+Types tokenized (SAVEd) BBC BASIC programs in a readable way.
+
+With no *file* arguments, **bascat** reads from standard input.
+
+If standard output is a terminal, output will be piped through a
+pager. The default is **$PAGER** from the environment, or **less** if
+not set. Note that if standard output is not a terminal (e.g. if redirecting to
+a file), no pager is used.
+
+Options can be placed in the **BASCAT** environment variable, if you don't
+like the standard settings.
+
+OPTIONS
+=======
+
+Prefix long options with **no-** to cancel them. Use **+** to cancel short options.
+
+--help, -h
+ Display built-in help message and exit.
+
+--version, -h
+ Display version number and exit.
+
+--line-numbers, -n
+ Display line numbers for each line. This is enabled by default; use **+n** or
+ **--no-line-numbers** to disable.
+
+--highlight, -l
+ Attempts to highlight keywords. Whether this works properly or not depends on
+ the pager in use; **more**\(1), **less**\(1), and **most**\(1) work correctly.
+ **lv**\(1) will work if you have **-c** in **~/.lv** or **LV** in the environment.
+
+--pager=pager, -p pager
+ Sets pager to use, if standard output is a terminal. Overrides **PAGER** environment variable.
+ If you don't want a pager, use **-p cat**.
+
+.. FILES
+.. =====
+
+.. ENVIRONMENT
+.. ===========
+
+.. EXIT STATUS
+.. ===========
+
+.. BUGS
+.. ====
+
+.. EXAMPLES
+.. ========
+
+COPYRIGHT
+=========
+
+See the file /usr/doc/bascat-|version|/README for license information.
+
+AUTHORS
+=======
+
+**bascat** was written by Matthew Wilcox and Mark Wooding.
+
+This man page written for the SlackBuilds.org project
+by B. Watson, and is licensed under the WTFPL.
+
+SEE ALSO
+========
+
+**dfsimage**\(1)
+
+The bascat homepage: https://git.distorted.org.uk/~mdw/
diff --git a/development/bascat/git2tarxz.sh b/development/bascat/git2tarxz.sh
new file mode 100644
index 0000000000000..fdda36380f1d1
--- /dev/null
+++ b/development/bascat/git2tarxz.sh
@@ -0,0 +1,47 @@
+#!/bin/sh
+
+# Create source tarball from repo
+
+# 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.
+
+PRGNAM=bascat
+CLONE_URL=git://git.distorted.org.uk/~mdw/bascat
+
+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 )
+
+VERTAG=$( git tag -l | tail -1 | sed 's,^v,,' )
+
+VERSION=${VERTAG}+${DATE}_${GIT_SHA}
+
+find . -name .git\* -print0 | xargs -0 rm -rf
+
+find . -type f -exec chmod 644 {} \+
+find . -type d -exec chmod 755 {} \+
+
+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"
diff --git a/development/bascat/slack-desc b/development/bascat/slack-desc
new file mode 100644
index 0000000000000..a2382a130d88a
--- /dev/null
+++ b/development/bascat/slack-desc
@@ -0,0 +1,19 @@
+# HOW TO EDIT THIS FILE:
+# The "handy ruler" below makes it easier to edit a package description.
+# Line up the first '|' above the ':' following the base package name, and
+# the '|' on the right side marks the last column you can put a character in.
+# You must make exactly 11 lines for the formatting to be correct. It's also
+# customary to leave one space after the ':' except on otherwise blank lines.
+
+ |-----handy-ruler------------------------------------------------------|
+bascat: bascat (detokenizer for BBC BASIC programs)
+bascat:
+bascat: bascat is a program that will convert BBC BASIC files to text, like
+bascat: the LIST command does.
+bascat:
+bascat:
+bascat:
+bascat:
+bascat:
+bascat:
+bascat: