diff options
author | Martin Wilke <miwi@FreeBSD.org> | 2008-04-29 21:34:02 +0000 |
---|---|---|
committer | Martin Wilke <miwi@FreeBSD.org> | 2008-04-29 21:34:02 +0000 |
commit | ceabe272a7e49d14d6b3dcac853bb72ff4ec79aa (patch) | |
tree | 2741dc4d7abe3e53052b32355301d86215300d84 /shells/heirloom-sh | |
parent | a128f2fa88feb1af75a54443a168caf9f2cc4627 (diff) | |
download | freebsd-ports-ceabe272a7e49d14d6b3dcac853bb72ff4ec79aa.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/heirloom-sh')
-rw-r--r-- | shells/heirloom-sh/Makefile | 43 | ||||
-rw-r--r-- | shells/heirloom-sh/distinfo | 3 | ||||
-rw-r--r-- | shells/heirloom-sh/files/patch-acct | 12 | ||||
-rw-r--r-- | shells/heirloom-sh/pkg-deinstall | 22 | ||||
-rw-r--r-- | shells/heirloom-sh/pkg-descr | 7 | ||||
-rw-r--r-- | shells/heirloom-sh/pkg-install | 19 |
6 files changed, 106 insertions, 0 deletions
diff --git a/shells/heirloom-sh/Makefile b/shells/heirloom-sh/Makefile new file mode 100644 index 000000000000..8655c11ef170 --- /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 000000000000..2a7bd71ce4d7 --- /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 000000000000..68caa7ebd7c7 --- /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 000000000000..439041a4af1b --- /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 000000000000..e80d2ed3921f --- /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 000000000000..555ee92c82e7 --- /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 |