pkg-deinstall

#!/bin/sh
#
# $FreeBSD: ports/shells/bash/pkg-deinstall,v 1.5 2007/06/29 01:06:38 obrien Exp $
#

BASH="$(echo ${PKG_PREFIX-/usr/local}/bin/bash | /usr/bin/sed -e 's|//|/|g')"
RBASH="$(echo ${PKG_PREFIX-/usr/local}/bin/rbash | /usr/bin/sed -e 's|//|/|g')"
SHELLS="${PKG_DESTDIR-}/etc/shells"

case $2 in
DEINSTALL)
if grep -qs "^$BASH\$" "$SHELLS"; then
if [ `id -u` -eq 0 ]; then
TMPSHELLS=`mktemp -t shells`
grep -v "^$BASH\$" "$SHELLS" > "$TMPSHELLS"
cat "$TMPSHELLS" > "$SHELLS"
rm "$TMPSHELLS"
else
echo "Not root, please remove $BASH from $SHELLS manually"
fi
fi
if grep -qs "^$RBASH\$" "$SHELLS"; then
if [ `id -u` -eq 0 ]; then
TMPSHELLS=`mktemp -t shells`
grep -v "^$RBASH\$" "$SHELLS" > "$TMPSHELLS"
cat "$TMPSHELLS" > "$SHELLS"
rm "$TMPSHELLS"
else
echo "Not root, please remove $RBASH from $SHELLS manually"
fi
fi
;;
esac

pkg-descr

This is GNU Bash, version 3.0. Bash is the GNU Project's Bourne
Again SHell, a complete implementation of the POSIX.2 shell spec,
but also with interactive command line editing, job control on
architectures that support it, csh-like features such as history
substitution and brace expansion, and a slew of other features.

WWW: http://cnswww.cns.cwru.edu/~chet/bash/bashtop.html

pkg-install

#!/bin/sh
#
# $FreeBSD: ports/shells/bash/pkg-install,v 1.6 2007/08/04 11:41:18 gabor Exp $
#

BASH="$(echo ${PKG_PREFIX-/usr/local}/bin/bash | /usr/bin/sed -e 's|//|/|g')"
RBASH="$(echo ${PKG_PREFIX-/usr/local}/bin/rbash | /usr/bin/sed -e 's|//|/|g')"
SHELLS="/etc/shells"

case $2 in
POST-INSTALL)
if [ -d "${SHELLS%/*}" ] && ! grep -qs "^$BASH\$" "$SHELLS"; then
if [ `id -u` -eq 0 ]; then
echo "$BASH" >> "$SHELLS"
else
echo "Not root, please add $BASH to $SHELLS manually"
fi
fi
if [ -d "${SHELLS%/*}" ] && ! grep -qs "^$RBASH\$" "$SHELLS"; then
if [ `id -u` -eq 0 ]; then
echo "$RBASH" >> "$SHELLS"
else
echo "Not root, please add $RBASH to $SHELLS manually"
fi
fi
;;
esac

pkg-plist

@comment $FreeBSD: ports/shells/bash/pkg-plist,v 1.24 2007/06/30 19:42:35 obrien Exp $
bin/bash
bin/rbash
bin/bashbug
%%NLS%%share/locale/en@boldquot/LC_MESSAGES/bash.mo
%%NLS%%share/locale/en@quot/LC_MESSAGES/bash.mo
%%NLS%%share/locale/ru/LC_MESSAGES/bash.mo
%%HELP%%%%DATADIR%%/alias
%%HELP%%%%DATADIR%%/arith
%%HELP%%%%DATADIR%%/arith_for
%%HELP%%%%DATADIR%%/bg
%%HELP%%%%DATADIR%%/bind
%%HELP%%%%DATADIR%%/break
%%HELP%%%%DATADIR%%/builtin
%%HELP%%%%DATADIR%%/caller
%%HELP%%%%DATADIR%%/case
%%HELP%%%%DATADIR%%/cd
%%HELP%%%%DATADIR%%/colon
%%HELP%%%%DATADIR%%/command
%%HELP%%%%DATADIR%%/compgen
%%HELP%%%%DATADIR%%/complete
%%HELP%%%%DATADIR%%/conditional
%%HELP%%%%DATADIR%%/continue
%%HELP%%%%DATADIR%%/declare
%%HELP%%%%DATADIR%%/dirs
%%HELP%%%%DATADIR%%/disown
%%HELP%%%%DATADIR%%/dot
%%HELP%%%%DATADIR%%/echo
%%HELP%%%%DATADIR%%/enable
%%HELP%%%%DATADIR%%/eval
%%HELP%%%%DATADIR%%/exec
%%HELP%%%%DATADIR%%/exit
%%HELP%%%%DATADIR%%/export
%%HELP%%%%DATADIR%%/false
%%HELP%%%%DATADIR%%/fc
%%HELP%%%%DATADIR%%/fg
%%HELP%%%%DATADIR%%/fg_percent
%%HELP%%%%DATADIR%%/for
%%HELP%%%%DATADIR%%/function
%%HELP%%%%DATADIR%%/getopts
%%HELP%%%%DATADIR%%/grouping_braces
%%HELP%%%%DATADIR%%/hash
%%HELP%%%%DATADIR%%/help
%%HELP%%%%DATADIR%%/history
%%HELP%%%%DATADIR%%/if
%%HELP%%%%DATADIR%%/jobs
%%HELP%%%%DATADIR%%/kill
%%HELP%%%%DATADIR%%/let
%%HELP%%%%DATADIR%%/local
%%HELP%%%%DATADIR%%/logout
%%HELP%%%%DATADIR%%/popd
%%HELP%%%%DATADIR%%/printf
%%HELP%%%%DATADIR%%/pushd
%%HELP%%%%DATADIR%%/pwd
%%HELP%%%%DATADIR%%/read
%%HELP%%%%DATADIR%%/readonly
%%HELP%%%%DATADIR%%/return
%%HELP%%%%DATADIR%%/select
%%HELP%%%%DATADIR%%/set
%%HELP%%%%DATADIR%%/shift
%%HELP%%%%DATADIR%%/shopt
%%HELP%%%%DATADIR%%/source
%%HELP%%%%DATADIR%%/suspend
%%HELP%%%%DATADIR%%/test
%%HELP%%%%DATADIR%%/test_bracket
%%HELP%%%%DATADIR%%/time
%%HELP%%%%DATADIR%%/times
%%HELP%%%%DATADIR%%/trap
%%HELP%%%%DATADIR%%/true
%%HELP%%%%DATADIR%%/type
%%HELP%%%%DATADIR%%/typeset
%%HELP%%%%DATADIR%%/ulimit
%%HELP%%%%DATADIR%%/umask
%%HELP%%%%DATADIR%%/unalias
%%HELP%%%%DATADIR%%/unset
%%HELP%%%%DATADIR%%/until
%%HELP%%%%DATADIR%%/variable_help
%%HELP%%%%DATADIR%%/wait
%%HELP%%%%DATADIR%%/while
%%HELP%%@dirrm %%DATADIR%%
%%NLS%%@dirrmtry share/locale/en@boldquot/LC_MESSAGES
%%NLS%%@dirrmtry share/locale/en@boldquot
%%NLS%%@dirrmtry share/locale/en@quot/LC_MESSAGES
%%NLS%%@dirrmtry share/locale/en@quot