diff options
author | B. Watson <yalhcru@gmail.com> | 2018-08-08 19:34:58 +0100 |
---|---|---|
committer | Willy Sudiarto Raharjo <willysr@slackbuilds.org> | 2018-08-11 07:23:06 +0700 |
commit | adfaaae3f608e9a0d18ced8a5c55ffec21381aa9 (patch) | |
tree | 5e25c2a41cd04c4149bac93c82f446bbe539267d /development | |
parent | 84b33ca105637d481e550314f3c5ff07af7dc254 (diff) | |
download | slackbuilds-adfaaae3f608e9a0d18ced8a5c55ffec21381aa9.tar.gz |
development/beav: Added (curses-based binary/hex editor).
Signed-off-by: David Spencer <idlemoor@slackbuilds.org>
Diffstat (limited to 'development')
-rw-r--r-- | development/beav/README | 15 | ||||
-rw-r--r-- | development/beav/arrow_keys.diff | 24 | ||||
-rw-r--r-- | development/beav/beav.SlackBuild | 118 | ||||
-rw-r--r-- | development/beav/beav.info | 12 | ||||
-rw-r--r-- | development/beav/compilefixes.diff | 67 | ||||
-rw-r--r-- | development/beav/slack-desc | 19 |
6 files changed, 255 insertions, 0 deletions
diff --git a/development/beav/README b/development/beav/README new file mode 100644 index 0000000000..11ad72b194 --- /dev/null +++ b/development/beav/README @@ -0,0 +1,15 @@ +beav (curses-based binary/hex editor) + +BEAV (Binary Editor And Viewer), is a full featured binary file +editor. Just about any operation that you could want to do to a binary +file is possible with BEAV. You can insert or delete in the middle of a +file thereby changing it's size. You can edit multiple files in multiple +windows and cut and paste between them. You can display and edit data in +hex, octal, decimal, binary, ascii, or ebcdic formats. You can display +data in byte, word, or long word formats in either Intel or Motorola byte +ordering. You can send the formatted display mode to a file or printer. + +This build of beav includes a patch to support moving around the file +with the arrow keys on most terminals, without having to create a custom +.beavrc. The original key bindings are still active, if you're already +used to them. diff --git a/development/beav/arrow_keys.diff b/development/beav/arrow_keys.diff new file mode 100644 index 0000000000..40e87e58e9 --- /dev/null +++ b/development/beav/arrow_keys.diff @@ -0,0 +1,24 @@ +diff -Naur beav-140/symbol.c beav-140.patched/symbol.c +--- beav-140/symbol.c 2018-08-07 16:32:10.287386812 -0400 ++++ beav-140.patched/symbol.c 2018-08-07 18:01:00.110213510 -0400 +@@ -280,16 +280,20 @@ + { + { KCTRL | 'A', dispshift, MSG_byte_shift, 0 }, + { KCTRL | 'B', backchar, MSG_back_char, SSRCH | SRPLC }, ++ { KMETA | KCTRL | KCTLX | 'D', backchar, MSG_back_char, SSRCH | SRPLC }, + { KCTRL | 'C', quit, MSG_quit, 0 }, /* pvr */ + { KCTRL | 'D', forwdel, MSG_forw_del_char, SMOD | SSIZE | SSRCH | SRPLC }, + { KCTRL | 'E', dispswapbyte, MSG_toggle_swap, SSRCH | SRPLC }, /* pvr */ + { KCTRL | 'F', forwchar, MSG_forw_char, SSRCH | SRPLC }, ++ { KMETA | KCTRL | KCTLX | 'C', forwchar, MSG_forw_char, SSRCH | SRPLC }, + { KCTRL | 'G', ctrlg, MSG_abort, SSRCH | SRPLC }, + { KCTRL | 'I', selfinsert, MSG_ins_self, SMOD | SSRCH | SRPLC }, + { KCTRL | 'H', backdel, MSG_back_del_char, SMOD | SSIZE | SSRCH | SRPLC }, + { KCTRL | 'L', refresh, MSG_refresh, SSRCH | SRPLC }, + { KCTRL | 'N', forwline, MSG_forw_line, SSRCH | SRPLC }, ++ { KMETA | KCTRL | KCTLX | 'B', forwline, MSG_forw_line, SSRCH | SRPLC }, + { KCTRL | 'P', backline, MSG_back_line, SSRCH | SRPLC }, ++ { KMETA | KCTRL | KCTLX | 'A', backline, MSG_back_line, SSRCH | SRPLC }, + { KCTRL | 'Q', quote, MSG_quote, 0 }, + { KCTRL | 'R', recall, MSG_recall, SSRCH | SRPLC }, + { KCTRL | 'T', twiddle, MSG_twiddle, SMOD | SSRCH | SRPLC }, diff --git a/development/beav/beav.SlackBuild b/development/beav/beav.SlackBuild new file mode 100644 index 0000000000..8982fed283 --- /dev/null +++ b/development/beav/beav.SlackBuild @@ -0,0 +1,118 @@ +#!/bin/sh + +# Slackware build script for beav + +# Written by B. Watson (yalhcru@gmail.com) + +# Licensed under the WTFPL. See http://www.wtfpl.net/txt/copying/ for details. + +# This is a seriously old piece of software. The timestamps inside +# the tarball all read 'Nov 30 1994' so it's almost 24 years old (old +# enough to buy beer, even in the US). I'm adding it to SBo mainly for +# old-timers to use, people who are used to using beav on other distros +# or OSes. + +# At this point, the original maintainer and homepage for beav are long +# gone, so I'm considering the Debian page for it as the 'official' +# source. VERSION matches the Debian patchlevel, e.g. 1.40-18 => 1.40_18. +# Also included a compile fix patch based on one from AUR, plus my own +# patch to add the arrow keys to the default keybindings. + +# Entertaining piece of trivia for you: the Debian maintainer of beav +# is none other than Sam Hocevar, who also invented the WTFPL license +# that's used for this script and most of my other SBo builds. Hi, Sam! + +PRGNAM=beav +VERSION=${VERSION:-1.40_18} +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" + LIBDIRSUFFIX="" +elif [ "$ARCH" = "i686" ]; then + SLKCFLAGS="-O2 -march=i686 -mtune=i686" + LIBDIRSUFFIX="" +elif [ "$ARCH" = "x86_64" ]; then + SLKCFLAGS="-O2 -fPIC" + LIBDIRSUFFIX="64" +else + SLKCFLAGS="-O2" + LIBDIRSUFFIX="" +fi + +set -e + +MAINVER="$( echo $VERSION | cut -d_ -f1 )" +TARVER="$( echo $MAINVER | sed 's/\.//g' )" +PATCHVER="$( echo $VERSION | cut -d_ -f2 )" + +rm -rf $PKG +mkdir -p $TMP $PKG $OUTPUT +cd $TMP +rm -rf $PRGNAM-$TARVER +tar xvf $CWD/${PRGNAM}_$MAINVER.orig.tar.gz +cd $PRGNAM-$TARVER +chown -R root:root . +chmod 644 * + +# apply Debian's patches +zcat $CWD/${PRGNAM}_$MAINVER-$PATCHVER.diff.gz | patch -p1 + +# compile fix patch is basically this from AUR: +# https://aur.archlinux.org/cgit/aur.git/tree/beav_on_archlinux.patch?h=beav +# but with SLKCFLAGS support in the Makefile, and redone as a -p1 patch. +patch -p1 < $CWD/compilefixes.diff + +# Arrow key support: + +# FFS, arrow keys have been standard on damn near all keyboards for +# 40+ years now, even creaky old dinosaurs like me use them. beav only +# supports them if you go thru the laborious process of defining them +# in your .beavrc. + +# This patch adds them to the default keybind list (without affecting +# the original ^B ^F ^N ^P bindings, so they still work). + +# Bindings tested & working with: +# linux console, xterm, rxvt, urxvt, xfce4-terminal, konsole. + +# Might not work on some oddball terminal, but in that case, the user +# can define their weird arrow key combos in .beavrc as usual. Patch was +# sent to the Debian maintainer (Sam Hocevar) on 20180807. +patch -p1 < $CWD/arrow_keys.diff + +# fix Debianized doc dir reference +sed -i \ + 's:/usr/share/doc[^ ]*:/usr/doc/'$PRGNAM-$VERSION/$PRGNAM$TARVER.txt: \ + $PRGNAM.1 + +# can't use CFLAGS for this... +make SLKCFLAGS="$SLKCFLAGS" + +install -D -s -m0755 -oroot -groot $PRGNAM $PKG/usr/bin/$PRGNAM +mkdir -p $PKG/usr/man/man1 +gzip -9c $PRGNAM.1 > $PKG/usr/man/man1/$PRGNAM.1.gz + +mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION +cp -a read.me $PRGNAM$TARVER.txt debian/changelog $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/development/beav/beav.info b/development/beav/beav.info new file mode 100644 index 0000000000..89b2404c29 --- /dev/null +++ b/development/beav/beav.info @@ -0,0 +1,12 @@ +PRGNAM="beav" +VERSION="1.40_18" +HOMEPAGE="https://packages.debian.org/sid/beav" +DOWNLOAD="http://http.debian.net/debian/pool/main/b/beav/beav_1.40.orig.tar.gz \ + http://http.debian.net/debian/pool/main/b/beav/beav_1.40-18.diff.gz" +MD5SUM="9c30dce1697f468682eb2aae464de175 \ + 63a2f7a63334abc020cd37e86d349ec1" +DOWNLOAD_x86_64="" +MD5SUM_x86_64="" +REQUIRES="" +MAINTAINER="B. Watson" +EMAIL="yalhcru@gmail.com" diff --git a/development/beav/compilefixes.diff b/development/beav/compilefixes.diff new file mode 100644 index 0000000000..0560e5ac97 --- /dev/null +++ b/development/beav/compilefixes.diff @@ -0,0 +1,67 @@ +diff -Naur beav-140/Makefile beav-140.patched/Makefile +--- beav-140/Makefile 2018-08-07 16:09:02.441431939 -0400 ++++ beav-140.patched/Makefile 2018-08-07 16:20:08.928410267 -0400 +@@ -1,6 +1,6 @@ + # This is the makefile for BSD UNIX +-#CFLAGS= -g -DUNIX +-CFLAGS= -g -DUNIX -Wall ++CFLAGS= -DUNIX $(SLKCFLAGS) ++#CFLAGS= -g -DUNIX -Wall + CC=gcc + + OFILES= basic.o ebcdic.o fileio.o region.o text.o wangpc.o \ +diff -Naur beav-140/basic.c beav-140.patched/basic.c +--- beav-140/basic.c 1994-11-30 12:43:34.000000000 -0500 ++++ beav-140.patched/basic.c 2018-08-07 16:19:18.515411907 -0400 +@@ -9,7 +9,6 @@ + + #include "def.h" + +-bool move_ptr (); + bool forwchar (); + bool wind_on_dot (); + bool backline (); +diff -Naur beav-140/def.h beav-140.patched/def.h +--- beav-140/def.h 2018-08-07 16:09:02.443431938 -0400 ++++ beav-140.patched/def.h 2018-08-07 16:19:18.515411907 -0400 +@@ -16,6 +16,7 @@ + + #ifdef UNIX + #include <sys/types.h> ++#include <string.h> + #endif /* UNIX */ + + #define BACKUP 1 /* Make backup file. */ +diff -Naur beav-140/file.c beav-140.patched/file.c +--- beav-140/file.c 2018-08-07 16:09:02.448431938 -0400 ++++ beav-140.patched/file.c 2018-08-07 16:19:18.515411907 -0400 +@@ -10,7 +10,6 @@ + char load_file (); + char readin (); + void makename (); +-bool writeout (); + bool parse_f_name (); + A32 ffseek (); + A32 file_len (); +diff -Naur beav-140/random.c beav-140.patched/random.c +--- beav-140/random.c 2018-08-07 16:09:02.455431938 -0400 ++++ beav-140.patched/random.c 2018-08-07 16:19:18.516411907 -0400 +@@ -73,7 +73,6 @@ + extern bool dont_repeat; + extern BUFFER sav_buf; + +-char dec_chr_ok (); + ulong get_long (); + void wind_on_dot_all (); + +diff -Naur beav-140/symbol.c beav-140.patched/symbol.c +--- beav-140/symbol.c 2018-08-07 16:09:02.459431938 -0400 ++++ beav-140.patched/symbol.c 2018-08-07 16:19:18.516411907 -0400 +@@ -8,7 +8,6 @@ + #include <string.h> + #include "def.h" + +-void keyadd (); + void keydup (); + + diff --git a/development/beav/slack-desc b/development/beav/slack-desc new file mode 100644 index 0000000000..715541a104 --- /dev/null +++ b/development/beav/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------------------------------------------------------| +beav: beav (curses-based binary/hex editor) +beav: +beav: BEAV (Binary Editor And Viewer), is a full featured binary file +beav: editor. Just about any operation that you could want to do to a +beav: binary file is possible with BEAV. You can insert or delete in the +beav: middle of a file thereby changing it's size. You can edit multiple +beav: files in multiple windows and cut and paste between them. You can +beav: display and edit data in hex, octal, decimal, binary, ascii, or +beav: ebcdic formats. You can display data in byte, word, or long word +beav: formats in either Intel or Motorola byte ordering. You can send the +beav: formatted display mode to a file or printer. |