pkg-deinstall

#!/bin/sh
#

# Verify proper execution
#
if [ $# -ne 2 ]; then
echo "usage: $0 distname { DEINSTALL | POST-DEINSTALL }" >&2
exit 1
fi

# Verify/process the command
#
case $2 in
DEINSTALL)
cat /etc/crontab | /usr/bin/sed -e '/bsdsar/d' > /tmp/crontab.bsdsar
mv /tmp/crontab.bsdsar /etc/crontab
;;
POST-DEINSTALL)
: nothing to post-deinstall for this port
;;
*)
echo "usage: $0 distname { DEINSTALL | POST-DEINSTALL }" >&2
exit 1
;;
esac

exit 0

pkg-descr

WWW: http://www.googlebit.com/bsdsar/

System Activity Reporter for FreeBSD 4.x systems.
Stores/shows information on network, cpu, memory,
swap, and NFS usage.

Written by Eric Anderson
http://www.googlebit.com/bsdsar/

pkg-install

#!/bin/sh
#

PKG_PREFIX=${PKG_PREFIX:-/usr/local}

# Verify proper execution
#
if [ $# -ne 2 ]; then
echo "usage: $0 distname { PRE-INSTALL | POST-INSTALL }" >&2
exit 1
fi

# Verify/process the command
#
case $2 in
PRE-INSTALL)
: nothing to pre-install for this port
;;
POST-INSTALL)
echo "Adding 2 lines to /etc/crontab ..."
echo "# bsdsar execution" >> /etc/crontab
echo "20,40 8-18 * * * root $PKG_PREFIX/bin/bsdsar_gather" >> /etc/crontab
echo "0 * * * * root $PKG_PREFIX/bin/bsdsar_gather" >> /etc/crontab
;;
*)
echo "usage: $0 distname { PRE-INSTALL | POST-INSTALL }" >&2
exit 1
;;
esac

exit 0

pkg-message

====================================================
NOTE:

The following lines have been added to /etc/crontab:

20,40 8-18 * * * root $PREFIX/bin/bsdsar_gather /var/log
0 * * * * root $PREFIX/bin/bsdsar_gather /var/log

Where $PREFIX is typically "/usr/local".

====================================================

pkg-plist

bin/bsdsar
bin/bsdsar_gather
@unexec if cmp -s %D/etc/bsdsar.conf %D/etc/bsdsar.conf.sample; then rm -f %D/etc/bsdsar.conf; fi
etc/bsdsar.conf.sample
%%PORTDOCS%%%%DOCSDIR%%/CHANGELOG
%%PORTDOCS%%%%DOCSDIR%%/README
%%PORTDOCS%%@dirrm %%DOCSDIR%%