xref: /titanic_52/usr/src/contrib/ast/lib/package/ast-ksh.pkg (revision 906afcb89d0412cc073b95c2d701a804a8cdb62c)
1*906afcb8SAndy Fiddamanast-ksh :PACKAGE: ksh93 libast libcmd libcoshell libsum libdll
2*906afcb8SAndy Fiddaman
3*906afcb8SAndy Fiddaman:COVERS: ksh
4*906afcb8SAndy Fiddaman
5*906afcb8SAndy Fiddaman:LICENSE: *.open
6*906afcb8SAndy Fiddaman
7*906afcb8SAndy Fiddaman:CATEGORY: shells
8*906afcb8SAndy Fiddaman
9*906afcb8SAndy Fiddaman:INDEX: ksh and support libraries
10*906afcb8SAndy Fiddaman
11*906afcb8SAndy Fiddaman:DESCRIPTION:
12*906afcb8SAndy Fiddaman	The AT&T Software Technology ast-ksh package from AT&T Research
13*906afcb8SAndy Fiddaman	contains ksh and support libraries. This is the minimal set of
14*906afcb8SAndy Fiddaman	components needed to build ksh.
15*906afcb8SAndy Fiddaman
16*906afcb8SAndy Fiddaman:DETAILS: cyg
17*906afcb8SAndy Fiddaman	:README:
18*906afcb8SAndy Fiddaman		This package installs a standalone ksh93 executable ksh93.exe
19*906afcb8SAndy Fiddaman		and its man page ksh93.1.  If /bin/ksh.exe does not exist then
20*906afcb8SAndy Fiddaman		these symlinks
21*906afcb8SAndy Fiddaman			/bin/ksh.exe => ksh93.exe
22*906afcb8SAndy Fiddaman			/usr/share/man/man1/ksh93.1 => ksh.1
23*906afcb8SAndy Fiddaman		are created.  This allows alternative ksh impelementations,
24*906afcb8SAndy Fiddaman		e.g., /bin/pdksh.exe, to be selected by changing the ksh.exe
25*906afcb8SAndy Fiddaman		and ksh.1 symbolic links.  In addition, ksh and ksh93 paths are
26*906afcb8SAndy Fiddaman		added to /etc/shells if not already present.
27*906afcb8SAndy Fiddaman		$()
28*906afcb8SAndy Fiddaman		Each builtin or special command accepts the --man and --html
29*906afcb8SAndy Fiddaman		options to list the man page on the standard error. The --???
30*906afcb8SAndy Fiddaman		option describes the self documenting options available to all
31*906afcb8SAndy Fiddaman		builtin and special commands.
32*906afcb8SAndy Fiddaman		$()
33*906afcb8SAndy Fiddaman		The stanadlone ksh is statically linked with the ast libcmd
34*906afcb8SAndy Fiddaman		library which provides several builtin versions of /bin
35*906afcb8SAndy Fiddaman		commands. "builtin | grep /opt/ast/bin" lists the libcmd
36*906afcb8SAndy Fiddaman		builtins on the standard output. /opt/ast/bin/FOO accesses
37*906afcb8SAndy Fiddaman		the FOO builtin, whether the /opt/ast/bin directory exists
38*906afcb8SAndy Fiddaman		or not. "builtin FOO" allows /opt/ast/bin/FOO to be accessed
39*906afcb8SAndy Fiddaman		as FOO, bypassing the $PATH setting. To enable all libcmd
40*906afcb8SAndy Fiddaman		builtins do one of the following:
41*906afcb8SAndy Fiddaman		  (a) create the directory /opt/ast/bin and the file
42*906afcb8SAndy Fiddaman		      /opt/ast/bin/.paths with this line
43*906afcb8SAndy Fiddaman		      	BUILTIN_LIB=.
44*906afcb8SAndy Fiddaman		      and place /opt/ast/bin before /bin and /usr/bin in $PATH
45*906afcb8SAndy Fiddaman		      (this will affect all ksh subshells and scripts)
46*906afcb8SAndy Fiddaman		  (b) run "builtin $( builtin | sed -e '/\//!d' -e 's,.*/,,' )"
47*906afcb8SAndy Fiddaman		      (this will affect only the current shell)
48*906afcb8SAndy Fiddaman		Some scripts may run significantly faster with libcmd builtins
49*906afcb8SAndy Fiddaman		enabled.
50*906afcb8SAndy Fiddaman		$()
51*906afcb8SAndy Fiddaman		The ast library checks the DOSPATHVARS environment variable
52*906afcb8SAndy Fiddaman		for variable path values to convert to and from native windows
53*906afcb8SAndy Fiddaman		format when cross-executing between cygwin and non-cygwin
54*906afcb8SAndy Fiddaman		programs. The value is a space separated list of environment
55*906afcb8SAndy Fiddaman		variables to convert. PATH is handled by cygwin so it is not
56*906afcb8SAndy Fiddaman		converted by the ast library.
57*906afcb8SAndy Fiddaman		$()
58*906afcb8SAndy Fiddaman		The astksh cygwin source package provides a bootstrap build
59*906afcb8SAndy Fiddaman		environment that is not suited for an edit/build/debug cycle.
60*906afcb8SAndy Fiddaman		If you want to explore and modify the source then you should
61*906afcb8SAndy Fiddaman		install the (non-cygwinized) ast-base package which includes
62*906afcb8SAndy Fiddaman		AT&T nmake. With ast-base you will also be able to regenerate
63*906afcb8SAndy Fiddaman		the astksh cygwin source and binary packages.
64*906afcb8SAndy Fiddaman		$()
65*906afcb8SAndy Fiddaman		For more information on ksh and other AT&T ast tools see
66*906afcb8SAndy Fiddaman		   http://www.research.att.com/sw/download/
67*906afcb8SAndy Fiddaman	:EXPORT:
68*906afcb8SAndy Fiddaman		SHOPT_CMDLIB_DIR=1
69*906afcb8SAndy Fiddaman	bin/ksh93.exe :INSTALL: bin/ksh.exe
70*906afcb8SAndy Fiddaman	share/man/man1/ksh93.1 :INSTALL: man/man1/sh.1
71*906afcb8SAndy Fiddaman	:POSTINSTALL:
72*906afcb8SAndy Fiddaman		if	[ ! -e /bin/ksh.exe ]
73*906afcb8SAndy Fiddaman		then	ln -fs ksh93.exe /bin/ksh.exe
74*906afcb8SAndy Fiddaman			ln -fs ksh93.1 /usr/share/man/man1/ksh.1
75*906afcb8SAndy Fiddaman		else	echo "/bin/ksh.exe already exists"
76*906afcb8SAndy Fiddaman		fi
77*906afcb8SAndy Fiddaman		if [ -f /etc/shells ]
78*906afcb8SAndy Fiddaman		then	for i in /bin/ksh93 /bin/ksh /usr/bin/ksh93 /usr/bin/ksh
79*906afcb8SAndy Fiddaman			do	if	grep $i /etc/shells >/dev/null 2>&1
80*906afcb8SAndy Fiddaman				then	echo "$i already in /etc/shells"
81*906afcb8SAndy Fiddaman				else	echo $i >> /etc/shells
82*906afcb8SAndy Fiddaman					echo "$i added to /etc/shells"
83*906afcb8SAndy Fiddaman				fi
84*906afcb8SAndy Fiddaman			done
85*906afcb8SAndy Fiddaman		else	echo "no /etc/shells file"
86*906afcb8SAndy Fiddaman		fi
87*906afcb8SAndy Fiddaman		exit 0
88*906afcb8SAndy Fiddaman	:TEST: bin/ksh
89*906afcb8SAndy Fiddaman		KSH=$<; cd src/cmd/ksh93/tests; CYGWIN="$$CYGWIN ntsec binmode" SHELL=$$KSH $$KSH shtests
90