aboutsummaryrefslogtreecommitdiff
path: root/academic
diff options
context:
space:
mode:
authorDave Woodfall <dave@tty1.uk>2019-03-23 07:54:36 +0700
committerWilly Sudiarto Raharjo <willysr@slackbuilds.org>2019-03-23 07:54:36 +0700
commit2cbe59da4d03df86df06c98f7418692107b14a23 (patch)
treed5e1bcd8e6e8a44bc608ba6d119eb132de1420d2 /academic
parent1addb0e5760f4674cf755812361aec72395b6ef6 (diff)
academic/ed-v6: Added (old version of ed).
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
Diffstat (limited to 'academic')
-rw-r--r--academic/ed-v6/README85
-rw-r--r--academic/ed-v6/ed-v6.SlackBuild90
-rw-r--r--academic/ed-v6/ed-v6.info10
-rw-r--r--academic/ed-v6/slack-desc19
4 files changed, 204 insertions, 0 deletions
diff --git a/academic/ed-v6/README b/academic/ed-v6/README
new file mode 100644
index 000000000000..373767752c84
--- /dev/null
+++ b/academic/ed-v6/README
@@ -0,0 +1,85 @@
+Old UNIX V6 ed, lightly ported to modern systems.
+
+The old UNIX version of 'ed', the line editor. This is
+intended to be for academic interest more than anything and
+perhaps shouldn't be used for any serious editing of system
+files etc. You have been warned! :)
+
+The binary is named 'ed-v6' so as not to clobber gnu ed.
+
+There are some major differences between this and POSIX ed
+(see the notes at the end for more info.)
+
+NOTE: The linked sources are redistributed on github
+with no associated license.
+
+OPTIONS
+
+Build a 32 bit binary on x86_64 (Multilib needed):
+
+ M32=yes
+
+Build a static binary (size is ~ 800k vs. ~ 18k for the
+dynamic):
+
+ STATIC=yes
+
+
+DEVELOPER'S NOTES
+
+ 1. compile with a K&R compiler (not even ansified);
+ replacing =+ with += and using "=" for default
+ assignment
+ 2. assume 32-bits or better (ldiv and ldivr, increasing the
+ sbrk to 4096)
+ 3. use setjmp+longjmp instead of sysexit+reset
+ 4. use lseek() instead of seek() (although still assumes
+ 512 bytes)
+ 5. copies the tempfilename to work on systems without
+ writable strings
+ 6. use SIG_IGN instead of the numeric value "1"
+ 7. remove the goto errlab since that doesn't work in ANSI C
+ 8. commented out getpid() in favor of a local copy
+ 9. renamed unix() to run_unix() because some systems (at
+ least some linux) annoyingly do a -Dunix=1
+10. use sizeof(buf) instead of buf
+11. renamed putchar() to putc() because gcc and clang
+ generate errors if you create a function called putchar()
+ with a different signature.
+12. added a prototype for errfunc() because clang refuses to
+ honor `-ansi`
+
+I've tried to keep these modifications as minimal as
+possible in an effort to preserve the editor that I learned
+unix on.
+
+`ed.c.orig` is included so you can verify how minimal my
+changes were.
+
+
+MAINTAINER'S NOTES
+
+Compilation:
+
+Added -D_XOPEN_SOURCE=500 to compile with fcntl.h in
+glibc-2.23.
+
+Manual page:
+
+If you are unfamiliar with ed then gnu ed has a very good
+info page.
+
+This is the closest I can find to the original man page:
+
+https://www.freebsd.org/cgi/man.cgi?query=ed&apropos=0&sektion=0&manpath=Unix%20Seventh%20Edition&arch=default&format=html
+
+Among other things, there is no -p option, single , or ;
+will throw errors, no G//, and r does not support shell
+commands. H and h are also unsupported, so errors will lack
+any explanation.
+
+Using with rlwrap:
+
+This does work with rlwrap, however it repeats every
+command. This doesn't affect the functionality, but it can
+look quite confusing to have everything repeated.
diff --git a/academic/ed-v6/ed-v6.SlackBuild b/academic/ed-v6/ed-v6.SlackBuild
new file mode 100644
index 000000000000..f22d663f1a53
--- /dev/null
+++ b/academic/ed-v6/ed-v6.SlackBuild
@@ -0,0 +1,90 @@
+#!/bin/sh
+
+# Slackware build script for ed-v6
+# Copyright 2019 Dave Woodfall <dave@tty1.uk>
+# All rights reserved.
+#
+# Redistribution and use of this script, with or without modification, is
+# permitted provided that the following conditions are met:
+#
+# 1. Redistributions of this script must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ''AS IS'' AND ANY EXPRESS OR IMPLIED
+# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
+# EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+PRGNAM=ed-v6
+VERSION=${VERSION:-c72c0e}
+SRCVERSION=${SRCVERSION:-c72c0e9445af26bd9fde2d39da5628e6dabf36dd}
+BUILD=${BUILD:-1}
+TAG=${TAG:-_SBo}
+
+if [ -z "$ARCH" ]; then
+ case "$( uname -m )" in
+ i?86) ARCH=i586 ;;
+ arm*) ARCH=arm ;;
+ *) ARCH=$( uname -m ) ;;
+ esac
+fi
+
+CWD=$(pwd)
+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
+
+STRIP=${STRIP:-yes}
+[ "$M32" = "yes" ] && M32="-m32" || unset M32
+[ "$STATIC" = "yes" ] && STATIC="-static" || unset STATIC
+
+set -e
+
+rm -rf $PKG
+mkdir -p $TMP $PKG $OUTPUT
+cd $TMP
+rm -rf $PRGNAM-$SRCVERSION
+tar xvf $CWD/$SRCVERSION.tar.gz
+cd $PRGNAM-$SRCVERSION
+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 {} \;
+
+CFLAGS="$SLKCFLAGS" \
+ gcc $M32 $STATIC -Os -ansi -w -D_XOPEN_SOURCE=500 -o ed-v6 ed.c
+
+install -D -m 0755 ed-v6 $PKG/usr/bin/ed-v6
+
+if [ "$STRIP" = "yes" ]; then
+ strip --strip-unneeded 2>/dev/null $PKG/usr/bin/ed-v6
+fi
+
+mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
+cp -a README.md ed.c ed.c.orig \
+ $PKG/usr/doc/$PRGNAM-$VERSION
+cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$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}
diff --git a/academic/ed-v6/ed-v6.info b/academic/ed-v6/ed-v6.info
new file mode 100644
index 000000000000..fabe2ba511d5
--- /dev/null
+++ b/academic/ed-v6/ed-v6.info
@@ -0,0 +1,10 @@
+PRGNAM="ed-v6"
+VERSION="c72c0e"
+HOMEPAGE="https://github.com/geocar/ed-v6"
+DOWNLOAD="https://github.com/geocar/ed-v6/archive/c72c0e9/c72c0e9445af26bd9fde2d39da5628e6dabf36dd.tar.gz"
+MD5SUM="797a81796fdaf0b35bbce721d08d7bd7"
+DOWNLOAD_x86_64=""
+MD5SUM_x86_64=""
+REQUIRES=""
+MAINTAINER="Dave Woodfall"
+EMAIL="dave@tty1.uk"
diff --git a/academic/ed-v6/slack-desc b/academic/ed-v6/slack-desc
new file mode 100644
index 000000000000..667b5eb513ee
--- /dev/null
+++ b/academic/ed-v6/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 ':'.
+
+ |-----handy-ruler------------------------------------------------------|
+ed-v6: ed-v6 (Old UNIX V6 ed _lightly_ ported to modern systems)
+ed-v6:
+ed-v6: The old UNIX version of 'ed', the line editor. This is intended to
+ed-v6: be for academic interest more than anything and perhaps shouldn't be
+ed-v6: used for any serious editing of system files etc. You have been
+ed-v6: warned! :)
+ed-v6:
+ed-v6: https://github.com/geocar/ed-v6
+ed-v6:
+ed-v6:
+ed-v6: