summaryrefslogtreecommitdiff
path: root/system/heirloom-sh
diff options
context:
space:
mode:
authorslakmagik <slakmagik@gmail.com>2010-12-15 22:44:07 -0200
committerErik Hanson <erik@slackbuilds.org>2010-12-17 07:56:48 -0600
commit33fb5cc27e33b9a000e39a79ccad69f976605bb2 (patch)
treefef8c269f3ff5bd5f78c8383495d0bd7983c7946 /system/heirloom-sh
parentc0b229f21e7a7bdb26ca429b307f1580df71a79b (diff)
downloadslackbuilds-33fb5cc27e33b9a000e39a79ccad69f976605bb2.tar.gz
system/heirloom-sh: Added (portable variant of Unix shell)
Signed-off-by: Niels Horn <niels.horn@slackbuilds.org>
Diffstat (limited to 'system/heirloom-sh')
-rw-r--r--system/heirloom-sh/README13
-rw-r--r--system/heirloom-sh/heirloom-sh.SlackBuild77
-rw-r--r--system/heirloom-sh/heirloom-sh.info11
-rw-r--r--system/heirloom-sh/makefile.patch83
-rw-r--r--system/heirloom-sh/slack-desc19
5 files changed, 203 insertions, 0 deletions
diff --git a/system/heirloom-sh/README b/system/heirloom-sh/README
new file mode 100644
index 0000000000..ee9453c7d2
--- /dev/null
+++ b/system/heirloom-sh/README
@@ -0,0 +1,13 @@
+The Heirloom Bourne Shell is a portable variant of the traditional Unix
+shell. It has been derived from OpenSolaris code and thus implements the
+SVR4/SVID3 level of the shell.
+
+The Bourne shell is suitable for
+
+ * script portability testing
+ * processing of legacy scripts
+ * general script processing
+ * interactive use
+
+Note that this SlackBuild installs the shell as /usr/bin/hsh rather than
+/usr/5bin/sh.
diff --git a/system/heirloom-sh/heirloom-sh.SlackBuild b/system/heirloom-sh/heirloom-sh.SlackBuild
new file mode 100644
index 0000000000..86ba98b12b
--- /dev/null
+++ b/system/heirloom-sh/heirloom-sh.SlackBuild
@@ -0,0 +1,77 @@
+#!/bin/sh
+
+# Slackware build script for heirloom-sh
+# Written by slakmagik <slakmagik@gmail.com>
+# Released under the WTFPL
+
+PRGNAM=heirloom-sh
+VERSION=${VERSION:-050706}
+BUILD=${BUILD:-1}
+TAG=${TAG:-_SBo}
+
+if [ -z "$ARCH" ]; then
+ case "$( uname -m )" in
+ i?86) ARCH=i486 ;;
+ arm*) ARCH=arm ;;
+ *) ARCH=$( uname -m ) ;;
+ esac
+fi
+
+CWD=$(pwd)
+TMP=${TMP:-/tmp/SBo}
+PKG=$TMP/package-$PRGNAM
+OUTPUT=${OUTPUT:-/tmp}
+
+if [ "$ARCH" = "i486" ]; then
+ SLKCFLAGS="-O2 -march=i486 -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
+
+rm -rf $PKG
+mkdir -p $TMP $PKG $OUTPUT
+cd $TMP
+rm -rf $PRGNAM-$VERSION
+tar xvf $CWD/$PRGNAM-$VERSION.tar.bz2
+cd $PRGNAM-$VERSION
+chown -R root:root .
+find . \
+ \( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \
+ -exec chmod 755 {} \; -o \
+ \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 \
+ -o -perm 400 \) -exec chmod 644 {} \;
+
+# configure is the worst way to build a package except for all the others
+# 1. make static changes to the makefile with a patch
+patch -p1 < $CWD/makefile.patch
+# 2. make dynamic changes to the makefile with sed
+sed -i~ "/^CFLAGS=/s:-O:$SLKCFLAGS:;/^ROOT=/s:$:$PKG:" makefile
+# 3. make static changes to the manpage with sed (easier maintenance)
+sed -i~ 's/\<sh\>/h&/g;s/\<Sh\>/Hsh/g;s/\\fBsh\\fR/\\fBhsh\\fR/' sh.1
+
+make install
+
+find $PKG/usr/man -type f -exec gzip -9 {} \;
+for i in $(find $PKG/usr/man -type l); do
+ ln -s $(readlink $i).gz $i.gz; rm $i
+done
+
+mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
+cp -a [COR]* $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/system/heirloom-sh/heirloom-sh.info b/system/heirloom-sh/heirloom-sh.info
new file mode 100644
index 0000000000..d87568a203
--- /dev/null
+++ b/system/heirloom-sh/heirloom-sh.info
@@ -0,0 +1,11 @@
+PRGNAM="heirloom-sh"
+VERSION="050706"
+HOMEPAGE="http://heirloom.sourceforge.net/sh.html"
+DOWNLOAD="http://downloads.sourceforge.net/heirloom/heirloom-sh-050706.tar.bz2"
+MD5SUM="9169d9b3b845cb63c598ea29b8d2dfa0"
+DOWNLOAD_x86_64=""
+MD5SUM_x86_64=""
+MAINTAINER="slakmagik"
+EMAIL="slakmagik@gmail.com"
+APPROVED="Niels Horn"
+
diff --git a/system/heirloom-sh/makefile.patch b/system/heirloom-sh/makefile.patch
new file mode 100644
index 0000000000..5f370d9d9f
--- /dev/null
+++ b/system/heirloom-sh/makefile.patch
@@ -0,0 +1,83 @@
+diff -Naurp heirloom-sh-050706.orig//makefile heirloom-sh-050706//makefile
+--- heirloom-sh-050706.orig//makefile 2005-07-06 06:59:57.000000000 -0400
++++ heirloom-sh-050706//makefile 2010-11-09 23:52:32.200954003 -0500
+@@ -7,12 +7,12 @@ ROOT=
+ #
+ # The destination directory for the "sh" and "jsh" binaries.
+ #
+-SV3BIN=/usr/5bin
++SV3BIN=/usr/bin
+
+ #
+ # Location for manual pages (with man1 below).
+ #
+-MANDIR=/usr/share/man/5man
++MANDIR=/usr/man
+
+ #
+ # Enable this definition if spell checking should be done for the
+@@ -23,7 +23,7 @@ MANDIR=/usr/share/man/5man
+ #
+ # A BSD-compatible install command.
+ #
+-UCBINST=/usr/ucb/install
++UCBINST=/usr/bin/install
+
+ #
+ # The strip command that is used at installation time.
+@@ -49,7 +49,7 @@ CFLAGS=-O
+ #
+ # Flags for the C preprocessor.
+ #
+-CFLAGS=-D_GNU_SOURCE
++CPPFLAGS=-D_GNU_SOURCE
+
+ #
+ # A define for large file support, if necessary.
+@@ -81,11 +81,11 @@ OBJ = args.o blok.o bltin.o cmd.o ctype.
+ all: sh jsh sh.1.out
+
+ sh: $(OBJ)
+- $(CC) $(LDFLAGS) $(OBJ) $(LIBS) -o sh
++ $(CC) $(LDFLAGS) $(OBJ) $(LIBS) -o hsh
+
+ jsh: sh
+ rm -f jsh
+- $(LNS) sh jsh
++ $(LNS) hsh jsh
+
+ sh.1.out: sh.1
+ test "x$(SPELL)" != x && cat sh.1 >$@ || \
+@@ -93,17 +93,17 @@ sh.1.out: sh.1
+
+ install: all
+ test -d $(ROOT)$(SV3BIN) || mkdir -p $(ROOT)$(SV3BIN)
+- $(UCBINST) -c -m 755 sh $(ROOT)$(SV3BIN)/sh
+- $(STRIP) $(ROOT)$(SV3BIN)/sh
++ $(UCBINST) -c -m 755 hsh $(ROOT)$(SV3BIN)/hsh
++ $(STRIP) $(ROOT)$(SV3BIN)/hsh
+ rm -f $(ROOT)$(SV3BIN)/jsh
+- cd $(ROOT)$(SV3BIN) && $(LNS) sh jsh
++ cd $(ROOT)$(SV3BIN) && $(LNS) hsh jsh
+ test -d $(ROOT)$(MANDIR)/man1 || mkdir -p $(ROOT)$(MANDIR)/man1
+- $(UCBINST) -c -m 644 sh.1.out $(ROOT)$(MANDIR)/man1/sh.1
++ $(UCBINST) -c -m 644 sh.1.out $(ROOT)$(MANDIR)/man1/hsh.1
+ rm -f $(ROOT)$(MANDIR)/man1/jsh.1
+- cd $(ROOT)$(MANDIR)/man1 && $(LNS) sh.1 jsh.1
++ cd $(ROOT)$(MANDIR)/man1 && $(LNS) hsh.1 jsh.1
+
+ maninstall: sh.1.out
+- $(UCBINST) -c -m 644 sh.1.out $(ROOT)$(MANDIR)/man1/sh.1
++ $(UCBINST) -c -m 644 sh.1.out $(ROOT)$(MANDIR)/man1/hsh.1
+
+ diet:
+ $(MAKE) CC='diet gcc -Ifakewchar' CFLAGS='-Os -fomit-frame-pointer' \
+@@ -123,7 +123,7 @@ world:
+ $(MAKE) clean
+
+ clean:
+- rm -f $(OBJ) sh jsh sh.1.out core log *~
++ rm -f $(OBJ) hsh jsh sh.1.out core log *~
+
+ mrproper: clean
+
diff --git a/system/heirloom-sh/slack-desc b/system/heirloom-sh/slack-desc
new file mode 100644
index 0000000000..c8a834c676
--- /dev/null
+++ b/system/heirloom-sh/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------------------------------------------------------|
+heirloom-sh: heirloom-sh (portable variant of the traditional Unix shell)
+heirloom-sh:
+heirloom-sh: The Heirloom Bourne Shell is a portable variant of the traditional
+heirloom-sh: Unix shell. It has been derived from OpenSolaris code and thus
+heirloom-sh: implements the SVR4/SVID3 level of the shell.
+heirloom-sh:
+heirloom-sh: The Bourne shell is suitable for script portability testing,
+heirloom-sh: processing of legacy scripts, general script processing, and
+heirloom-sh: interactive use.
+heirloom-sh:
+heirloom-sh: Homepage: http://heirloom.sourceforge.net/sh.html