aboutsummaryrefslogtreecommitdiffstats
path: root/shells
diff options
context:
space:
mode:
authormiwi <miwi@FreeBSD.org>2008-04-30 05:34:02 +0800
committermiwi <miwi@FreeBSD.org>2008-04-30 05:34:02 +0800
commit3e51980ec4b946aff4aec37aca6cee75ff5a4103 (patch)
tree228bdef064b396b63997c9e585d782cd334e784f /shells
parenta4ccdc92b0a531144032beac09559d5a3f5b0068 (diff)
downloadfreebsd-ports-graphics-3e51980ec4b946aff4aec37aca6cee75ff5a4103.tar.gz
freebsd-ports-graphics-3e51980ec4b946aff4aec37aca6cee75ff5a4103.tar.zst
freebsd-ports-graphics-3e51980ec4b946aff4aec37aca6cee75ff5a4103.zip
Heirloom-sh is a portable version of OpenSolaris' #!/bin/sh.
If one need to write portable shell scripts, this one is excellent for testing them. It is installed as jsh (job shell). Other OpenSolaris user land tools are available in sysutils/heirloom WWW: http://heirloom.sourceforge.net/sh.html PR: ports/122192 Submitted by: Danijel Tasov <danielt at pilgerer.org>
Diffstat (limited to 'shells')
-rw-r--r--shells/Makefile1
-rw-r--r--shells/heirloom-sh/Makefile43
-rw-r--r--shells/heirloom-sh/distinfo3
-rw-r--r--shells/heirloom-sh/files/patch-acct12
-rw-r--r--shells/heirloom-sh/pkg-deinstall22
-rw-r--r--shells/heirloom-sh/pkg-descr7
-rw-r--r--shells/heirloom-sh/pkg-install19
7 files changed, 107 insertions, 0 deletions
diff --git a/shells/Makefile b/shells/Makefile
index bd3a27f544b..7e04bc3b1f0 100644
--- a/shells/Makefile
+++ b/shells/Makefile
@@ -15,6 +15,7 @@
SUBDIR += fish
SUBDIR += flash
SUBDIR += gscommander
+ SUBDIR += heirloom-sh
SUBDIR += ibsh
SUBDIR += ksh93
SUBDIR += mksh
diff --git a/shells/heirloom-sh/Makefile b/shells/heirloom-sh/Makefile
new file mode 100644
index 00000000000..8655c11ef17
--- /dev/null
+++ b/shells/heirloom-sh/Makefile
@@ -0,0 +1,43 @@
+# Ports collection makefile for: heirloom-sh
+# Date created: 2008-03-28
+# Whom: Danijel Tasov <danielt@pilgerer.org>
+#
+# $FreeBSD$
+#
+
+PORTNAME= heirloom-sh
+PORTVERSION= 050706
+CATEGORIES= shells
+MASTER_SITES= SF/heirloom
+
+MAINTAINER= danielt@pilgerer.org
+COMMENT= Portable version of OpenSolaris' Bourne Shell
+
+USE_BZIP2= yes
+MAN1= jsh.1
+PLIST_FILES= bin/jsh
+PORTDOCS= CALDERA.LICENSE OPENSOLARIS.LICENSE CHANGES README
+
+PKGINSTALL= pkg-install
+PKGDEINSTALL= pkg-deinstall
+
+do-build:
+ cd ${WRKSRC} && make
+
+do-install:
+ ${INSTALL_PROGRAM} ${WRKSRC}/jsh ${PREFIX}/bin
+ ${INSTALL_MAN} ${WRKSRC}/sh.1.out ${MANPREFIX}/man/man1/jsh.1
+
+pre-install:
+ @${SETENV} PKG_PREFIX="${PREFIX}" PKG_DESTDIR="${DESTDIR}" \
+ ${SH} ${PKGINSTALL} ${PKGNAME} PRE-INSTALL
+
+post-install:
+.if !defined(NOPORTDOCS)
+ @${MKDIR} ${DOCSDIR}
+ cd ${WRKSRC} && ${INSTALL_DATA} ${PORTDOCS} ${DOCSDIR}
+.endif
+ @${SETENV} PKG_PREFIX="${PREFIX}" PKG_DESTDIR="${DESTDIR}" \
+ ${SH} ${PKGINSTALL} ${PKGNAME} POST-INSTALL
+
+.include <bsd.port.mk>
diff --git a/shells/heirloom-sh/distinfo b/shells/heirloom-sh/distinfo
new file mode 100644
index 00000000000..2a7bd71ce4d
--- /dev/null
+++ b/shells/heirloom-sh/distinfo
@@ -0,0 +1,3 @@
+MD5 (heirloom-sh-050706.tar.bz2) = 9169d9b3b845cb63c598ea29b8d2dfa0
+SHA256 (heirloom-sh-050706.tar.bz2) = 25fb8409e1eb75bb5da21ca32baf2d5eebcb8b84a1288d66e65763a125809e1d
+SIZE (heirloom-sh-050706.tar.bz2) = 82725
diff --git a/shells/heirloom-sh/files/patch-acct b/shells/heirloom-sh/files/patch-acct
new file mode 100644
index 00000000000..68caa7ebd7c
--- /dev/null
+++ b/shells/heirloom-sh/files/patch-acct
@@ -0,0 +1,12 @@
+diff -ru heirloom-sh-050706/defs.h heirloom-sh-050706.new/defs.h
+--- defs.h 2005-07-03 21:25:46.000000000 +0200
++++ defs.h 2008-03-27 22:30:33.000000000 +0100
+@@ -148,7 +148,7 @@
+ #define ENDARGS 0
+
+ /* enable shell accounting */
+-#define ACCT
++/* #define ACCT */
+
+ #include <unistd.h>
+ #include "mac.h"
diff --git a/shells/heirloom-sh/pkg-deinstall b/shells/heirloom-sh/pkg-deinstall
new file mode 100644
index 00000000000..439041a4af1
--- /dev/null
+++ b/shells/heirloom-sh/pkg-deinstall
@@ -0,0 +1,22 @@
+#!/bin/sh
+#
+# $FreeBSD$
+#
+
+JSH="$(echo ${PKG_PREFIX-/usr/local}/bin/jsh | /usr/bin/sed -e 's|//|/|g')"
+SHELLS="${PKG_DESTDIR-}/etc/shells"
+
+case $2 in
+DEINSTALL)
+ if grep -qs "^$JSH\$" "$SHELLS"; then
+ if [ $(id -u) -eq 0 ]; then
+ TMPSHELLS=$(mktemp -t shells)
+ grep -v "^$JSH\$" "$SHELLS" > "$TMPSHELLS"
+ cat "$TMPSHELLS" > "$SHELLS"
+ rm "$TMPSHELLS"
+ else
+ echo "Not root, please remove $JSH from $SHELLS manually"
+ fi
+ fi
+ ;;
+esac
diff --git a/shells/heirloom-sh/pkg-descr b/shells/heirloom-sh/pkg-descr
new file mode 100644
index 00000000000..e80d2ed3921
--- /dev/null
+++ b/shells/heirloom-sh/pkg-descr
@@ -0,0 +1,7 @@
+Heirloom-sh is a portable version of OpenSolaris' #!/bin/sh.
+If one need to write portable shell scripts, this one is excellent for
+testing them. It is installed as jsh (job shell).
+
+Other OpenSolaris user land tools are available in sysutils/heirloom
+
+WWW: http://heirloom.sourceforge.net/sh.html
diff --git a/shells/heirloom-sh/pkg-install b/shells/heirloom-sh/pkg-install
new file mode 100644
index 00000000000..555ee92c82e
--- /dev/null
+++ b/shells/heirloom-sh/pkg-install
@@ -0,0 +1,19 @@
+#!/bin/sh
+#
+# $FreeBSD$
+#
+
+JSH="$(echo ${PKG_PREFIX-/usr/local}/bin/jsh | /usr/bin/sed -e 's|//|/|g')"
+SHELLS="/etc/shells"
+
+case $2 in
+POST-INSTALL)
+ if [ -d "${SHELLS%/*}" ] && ! grep -qs "^$JSH\$" "$SHELLS"; then
+ if [ $(id -u) -eq 0 ]; then
+ echo "$JSH" >> "$SHELLS"
+ else
+ echo "Not root, please add $JSH to $SHELLS manually"
+ fi
+ fi
+ ;;
+esac