Index: trunk/tools/ts-specs/ext-sources/which.sh |
— | — | @@ -0,0 +1,16 @@ |
| 2 | +#! /bin/ksh |
| 3 | + |
| 4 | +[[ $# = 1 ]] || { |
| 5 | + echo >&2 "usage: $0 <program>" |
| 6 | + exit 1 |
| 7 | +} |
| 8 | + |
| 9 | +for x in $(echo $PATH | tr : ' '); do |
| 10 | + if [[ -x $x/$1 ]]; then |
| 11 | + echo $x/$1 |
| 12 | + exit 0 |
| 13 | + fi |
| 14 | +done |
| 15 | + |
| 16 | +echo "$1 not found in $PATH" |
| 17 | +exit 1 |
Property changes on: trunk/tools/ts-specs/ext-sources/which.sh |
___________________________________________________________________ |
Added: svn:executable |
1 | 18 | + * |
Index: trunk/tools/ts-specs/TSwhich.spec |
— | — | @@ -0,0 +1,31 @@ |
| 2 | +%include Solaris.inc |
| 3 | + |
| 4 | +Name: TSwhich |
| 5 | +Summary: 'which' command |
| 6 | +Version: 1 |
| 7 | +Source1: which.sh |
| 8 | + |
| 9 | +SUNW_BaseDir: %{_basedir} |
| 10 | +BuildRoot: %{_tmppath}/%{name}-%{version}-build |
| 11 | +%include default-depend.inc |
| 12 | + |
| 13 | +# Requires: |
| 14 | + |
| 15 | +%prep |
| 16 | +%setup -q -T -c -n %name-%version |
| 17 | +cp %SOURCE1 . |
| 18 | + |
| 19 | +%build |
| 20 | + |
| 21 | +%install |
| 22 | +rm -rf $RPM_BUILD_ROOT |
| 23 | +mkdir -p $RPM_BUILD_ROOT%{_bindir} |
| 24 | +cp which.sh $RPM_BUILD_ROOT%{_bindir}/which |
| 25 | + |
| 26 | +%clean |
| 27 | +rm -rf $RPM_BUILD_ROOT |
| 28 | + |
| 29 | +%files |
| 30 | +%defattr (-, root, bin) |
| 31 | +%dir %attr (0755, root, bin) %{_bindir} |
| 32 | +%attr (0755, root, bin) %{_bindir}/which |