diff -u -r -N openssh-3.0.2p1-orig/contrib/aix/README openssh-3.0.2p1/contrib/aix/README
--- openssh-3.0.2p1-orig/contrib/aix/README	Thu Jan  1 11:00:00 1970
+++ openssh-3.0.2p1/contrib/aix/README	Sat Mar  2 15:15:23 2002
@@ -0,0 +1,41 @@
+Overview:
+
+This directory contains files to build an AIX native (SMIT-installable)
+package.
+
+
+Directions:
+
+./configure [options]
+cd contrib/aix; ./buildbff.sh
+
+This should result in a package openssh-[ver].bff being built in the
+contrib/aix directory. This can be installed via "smitty install" or
+similar. The results of "make install" will be left in install.log
+for troubleshooting if necessary.
+
+
+Acknowledgements:
+
+The contents of this directory are based on Ben Lindstrom's Solaris
+buildpkg.sh.
+
+Jim Abbey's (GPL'ed) lppbuild-2.1 was used to learn how to build .bff's
+and for comparison with the output from this script, however no code
+from lppbuild is included and it is not required for operation.
+
+
+Other notes:
+
+At the moment the script is hard-coded to generate a .bff from the
+default locations OpenSSH uses (ie /usr/local/[bin|sbin|etc]).
+
+
+Disclaimer:
+
+It is hoped that it is useful but there is no warranty. If it breaks
+you get to keep both pieces.
+
+
+	- Darren Tucker (dtucker at zip dot com dot au)
+	  2002/03/01
diff -u -r -N openssh-3.0.2p1-orig/contrib/aix/buildbff.sh openssh-3.0.2p1/contrib/aix/buildbff.sh
--- openssh-3.0.2p1-orig/contrib/aix/buildbff.sh	Thu Jan  1 11:00:00 1970
+++ openssh-3.0.2p1/contrib/aix/buildbff.sh	Sat Mar  2 14:31:01 2002
@@ -0,0 +1,117 @@
+#!/bin/sh
+#
+# buildbff.sh: Create AIX SMIT-installable OpenSSH packages
+#
+# Author: Darren Tucker (dtucker at zip dot com dot au)
+# This file is placed in the public domain and comes with absolutely
+# no warranty.
+# 
+# Based originally on Ben Lindstrom's buildpkg.sh for Solaris
+#
+
+umask 022
+PKGNAME=openssh
+
+## Extract common info requires for the 'info' part of the package.
+VERSION=`tail -1 ../../version.h | sed -e 's/.*_\([0-9]\)/\1/g' | sed 's/\"$//'`
+BFFVERSION=`echo $VERSION | sed 's/p/./g'`
+
+echo "Building BFF for $PKGNAME $VERSION ($BFFVERSION)"
+#PKGDIR=$PKGNAME-$BFFVERSION
+PKGDIR=package
+
+# Clean build directory
+rm -rf $PKGDIR
+mkdir $PKGDIR
+
+## Start by faking root install 
+echo "Faking root install..."
+START=`pwd`
+FAKE_ROOT=$START/$PKGDIR
+( cd ../.. ; make install-nokeys DESTDIR=$FAKE_ROOT ) >install.log 2>&1
+
+# Rename config files; postinstall script will copy them if necessary
+mv $FAKE_ROOT/usr/local/etc/ssh_config $FAKE_ROOT/usr/local/etc/ssh_config.default
+mv $FAKE_ROOT/usr/local/etc/sshd_config $FAKE_ROOT/usr/local/etc/sshd_config.default
+
+cd $PKGDIR
+
+echo Generating LPP control files
+#
+# Generate openssl.al file
+#
+mkdir -p usr/lpp/openssh
+find . -print | sed '/^\.$/d' | sed '/^\.\/usr\/lpp/d' >usr/lpp/openssh/openssh.al
+
+#
+# Create inventory post_i and copyright, files
+#	actually, we cheat by using a pre-generated ones
+#
+cp ../openssh.inventory usr/lpp/openssh/openssh.inventory
+cp ../openssh.post_i usr/lpp/openssh/openssh.post_i
+cp ../../../LICENCE usr/lpp/openssh/openssh.copyright
+
+#
+# Create liblpp.a and move control files into it
+#
+echo Creating liblpp.a
+(
+	cd usr/lpp/openssh
+	for i in openssh.*
+	do
+		ar -r liblpp.a $i
+		rm $i
+	done
+)
+
+#
+# Create lpp_name
+#
+# This will end up looking something like:
+# 4 R I OpenSSH {
+# OpenSSH 3.0.2.1 1 N U en_US OpenSSH 3.0.2p1 Portable for AIX
+# [
+# %
+# /usr/local/bin 8073
+# /usr/local/etc 189
+# /usr/local/libexec 185
+# /usr/local/man/man1 145
+# /usr/local/man/man8 83
+# /usr/local/sbin 2105
+# /usr/local/share 3
+# %
+# ]
+echo Creating lpp_name
+cat <<EOF >lpp_name
+4 R I $PKGNAME {
+$PKGNAME $BFFVERSION 1 N U en_US OpenSSH $VERSION Portable for AIX
+[
+%
+EOF
+
+for i in bin etc libexec man/man1 man/man8 sbin share
+do
+	size=`du usr/local/$i`	# size in 512 byte blocks
+	echo "/usr/local/$i $size" >>lpp_name
+done
+
+echo '%' >>lpp_name
+echo ']' >>lpp_name
+echo '}' >>lpp_name
+
+#
+# Now invoke backup to create .bff file
+#	note: lpp_name needs to be the first file do we generate the
+#	file list on the fly and feed it to backup using -i
+#
+echo Creating $PKGNAME-$VERSION.bff with backup...
+(
+	echo "./lpp_name"
+	find . ! -name lpp_name -a ! -name . -print 
+) | backup  -i -q -f ../$PKGNAME-$VERSION.bff $filelist
+
+cd ..
+
+echo $0: done.
+#rm -rf $PKGDIR
+
diff -u -r -N openssh-3.0.2p1-orig/contrib/aix/openssh.inventory openssh-3.0.2p1/contrib/aix/openssh.inventory
--- openssh-3.0.2p1-orig/contrib/aix/openssh.inventory	Thu Jan  1 11:00:00 1970
+++ openssh-3.0.2p1/contrib/aix/openssh.inventory	Sat Mar  2 13:07:50 2002
@@ -0,0 +1,258 @@
+/usr:
+	 class=apply,inventory,openssh
+	 owner=root
+	 group=system
+	 mode=755
+	 type=DIRECTORY
+/usr/local:
+	 class=apply,inventory,openssh
+	 owner=root
+	 group=system
+	 mode=755
+	 type=DIRECTORY
+/usr/local/share:
+	 class=apply,inventory,openssh
+	 owner=root
+	 group=system
+	 mode=755
+	 type=DIRECTORY
+/usr/local/share/Ssh.bin:
+	 class=apply,inventory,openssh
+	 owner=root
+	 group=system
+	 mode=644
+	 type=FILE
+	 size=VOLATILE
+	 checksum=VOLATILE
+/usr/local/bin:
+	 class=apply,inventory,openssh
+	 owner=root
+	 group=system
+	 mode=755
+	 type=DIRECTORY
+/usr/local/bin/slogin:
+	 class=apply,inventory,openssh
+	 owner=root
+	 group=system
+	 mode=777
+	 type=SYMLINK
+	 target=ssh
+/usr/local/bin/ssh:
+	 class=apply,inventory,openssh
+	 owner=root
+	 group=system
+	 mode=4711
+	 type=FILE
+	 size=VOLATILE
+	 checksum=VOLATILE
+/usr/local/bin/scp:
+	 class=apply,inventory,openssh
+	 owner=root
+	 group=system
+	 mode=755
+	 type=FILE
+	 size=VOLATILE
+	 checksum=VOLATILE
+/usr/local/bin/ssh-add:
+	 class=apply,inventory,openssh
+	 owner=root
+	 group=system
+	 mode=755
+	 type=FILE
+	 size=VOLATILE
+	 checksum=VOLATILE
+/usr/local/bin/ssh-agent:
+	 class=apply,inventory,openssh
+	 owner=root
+	 group=system
+	 mode=755
+	 type=FILE
+	 size=VOLATILE
+	 checksum=VOLATILE
+/usr/local/bin/ssh-keygen:
+	 class=apply,inventory,openssh
+	 owner=root
+	 group=system
+	 mode=755
+	 type=FILE
+	 size=VOLATILE
+	 checksum=VOLATILE
+/usr/local/bin/ssh-keyscan:
+	 class=apply,inventory,openssh
+	 owner=root
+	 group=system
+	 mode=755
+	 type=FILE
+	 size=VOLATILE
+	 checksum=VOLATILE
+/usr/local/bin/sftp:
+	 class=apply,inventory,openssh
+	 owner=root
+	 group=system
+	 mode=755
+	 type=FILE
+	 size=VOLATILE
+	 checksum=VOLATILE
+/usr/local/sbin:
+	 class=apply,inventory,openssh
+	 owner=root
+	 group=system
+	 mode=755
+	 type=DIRECTORY
+/usr/local/sbin/sshd:
+	 class=apply,inventory,openssh
+	 owner=root
+	 group=system
+	 mode=755
+	 type=FILE
+	 size=VOLATILE
+	 checksum=VOLATILE
+/usr/local/man:
+	 class=apply,inventory,openssh
+	 owner=root
+	 group=system
+	 mode=755
+	 type=DIRECTORY
+/usr/local/man/man1:
+	 class=apply,inventory,openssh
+	 owner=root
+	 group=system
+	 mode=755
+	 type=DIRECTORY
+/usr/local/man/man1/slogin.1:
+	 class=apply,inventory,openssh
+	 owner=root
+	 group=system
+	 mode=777
+	 type=SYMLINK
+	 target=ssh.1
+/usr/local/man/man1/ssh.1:
+	 class=apply,inventory,openssh
+	 owner=root
+	 group=system
+	 mode=644
+	 type=FILE
+	 size=VOLATILE
+	 checksum=VOLATILE
+/usr/local/man/man1/scp.1:
+	 class=apply,inventory,openssh
+	 owner=root
+	 group=system
+	 mode=644
+	 type=FILE
+	 size=VOLATILE
+	 checksum=VOLATILE
+/usr/local/man/man1/ssh-add.1:
+	 class=apply,inventory,openssh
+	 owner=root
+	 group=system
+	 mode=644
+	 type=FILE
+	 size=VOLATILE
+	 checksum=VOLATILE
+/usr/local/man/man1/ssh-agent.1:
+	 class=apply,inventory,openssh
+	 owner=root
+	 group=system
+	 mode=644
+	 type=FILE
+	 size=VOLATILE
+	 checksum=VOLATILE
+/usr/local/man/man1/ssh-keygen.1:
+	 class=apply,inventory,openssh
+	 owner=root
+	 group=system
+	 mode=644
+	 type=FILE
+	 size=VOLATILE
+	 checksum=VOLATILE
+/usr/local/man/man1/ssh-keyscan.1:
+	 class=apply,inventory,openssh
+	 owner=root
+	 group=system
+	 mode=644
+	 type=FILE
+	 size=VOLATILE
+	 checksum=VOLATILE
+/usr/local/man/man1/sftp.1:
+	 class=apply,inventory,openssh
+	 owner=root
+	 group=system
+	 mode=644
+	 type=FILE
+	 size=VOLATILE
+	 checksum=VOLATILE
+/usr/local/man/man8:
+	 class=apply,inventory,openssh
+	 owner=root
+	 group=system
+	 mode=755
+	 type=DIRECTORY
+/usr/local/man/man8/sshd.8:
+	 class=apply,inventory,openssh
+	 owner=root
+	 group=system
+	 mode=644
+	 type=FILE
+	 size=VOLATILE
+	 checksum=VOLATILE
+/usr/local/man/man8/sftp-server.8:
+	 class=apply,inventory,openssh
+	 owner=root
+	 group=system
+	 mode=644
+	 type=FILE
+	 size=VOLATILE
+	 checksum=VOLATILE
+/usr/local/libexec:
+	 class=apply,inventory,openssh
+	 owner=root
+	 group=system
+	 mode=755
+	 type=DIRECTORY
+/usr/local/libexec/sftp-server:
+	 class=apply,inventory,openssh
+	 owner=root
+	 group=system
+	 mode=755
+	 type=FILE
+	 size=VOLATILE
+	 checksum=VOLATILE
+/usr/local/etc:
+	 class=apply,inventory,openssh
+	 owner=root
+	 group=system
+	 mode=755
+	 type=DIRECTORY
+/usr/local/etc/sshd_config.default:
+	 class=apply,inventory,openssh
+	 owner=root
+	 group=system
+	 mode=644
+	 type=FILE
+	 size=VOLATILE
+	 checksum=VOLATILE
+/usr/local/etc/ssh_prng_cmds:
+	 class=apply,inventory,openssh
+	 owner=root
+	 group=system
+	 mode=644
+	 type=FILE
+	 size=VOLATILE
+	 checksum=VOLATILE
+/usr/local/etc/moduli:
+	 class=apply,inventory,openssh
+	 owner=root
+	 group=system
+	 mode=644
+	 type=FILE
+	 size=VOLATILE
+	 checksum=VOLATILE
+/usr/local/etc/ssh_config.default:
+	 class=apply,inventory,openssh
+	 owner=root
+	 group=system
+	 mode=644
+	 type=FILE
+	 size=VOLATILE
+	 checksum=VOLATILE
diff -u -r -N openssh-3.0.2p1-orig/contrib/aix/openssh.post_i openssh-3.0.2p1/contrib/aix/openssh.post_i
--- openssh-3.0.2p1-orig/contrib/aix/openssh.post_i	Thu Jan  1 11:00:00 1970
+++ openssh-3.0.2p1/contrib/aix/openssh.post_i	Sat Mar  2 14:32:51 2002
@@ -0,0 +1,79 @@
+#!/bin/sh
+#
+# OpenSSH Post-install script for AIX
+#
+# Author: Darren Tucker (dtucker at zip dot com dot au)
+#
+# This file is placed in the public domain and comes with no warranty
+#
+
+DESTDIR=/usr/local
+sysconfdir=etc
+PATH=/usr/local/bin:$PATH
+
+#
+# Generate keys unless they already exisit
+#
+if [ -f "$DESTDIR/$sysconfdir/ssh_host_key" ] ; then
+	echo "$DESTDIR$sysconfdir/ssh_host_key already exists, skipping."
+else
+	ssh-keygen -t rsa1 -f $DESTDIR/$sysconfdir/ssh_host_key -N ""
+fi
+if [ -f $DESTDIR/$sysconfdir/ssh_host_dsa_key ] ; then
+	echo "$DESTDIR/$sysconfdir/ssh_host_dsa_key already exists, skipping."
+else
+	ssh-keygen -t dsa -f $DESTDIR/$sysconfdir/ssh_host_dsa_key -N ""
+fi
+if [ -f $DESTDIR/$sysconfdir/ssh_host_rsa_key ] ; then
+	echo "$DESTDIR/$sysconfdir/ssh_host_rsa_key already exists, skipping."
+else 
+	ssh-keygen -t rsa -f $DESTDIR/$sysconfdir/ssh_host_rsa_key -N ""
+fi
+
+#
+# Create configs from defaults if they don't exist
+#
+if [ ! -f $DESTDIR/$sysconfdir/ssh_config ]
+then
+	cp $DESTDIR/$sysconfdir/ssh_config.default $DESTDIR/$sysconfdir/ssh_config
+else
+	echo $DESTDIR/$sysconfdir/ssh_config already exists, skipping.
+fi
+if [ ! -f $DESTDIR/$sysconfdir/sshd_config ]
+then
+	cp $DESTDIR/$sysconfdir/sshd_config.default $DESTDIR/$sysconfdir/sshd_config
+else
+	echo $DESTDIR/$sysconfdir/sshd_config already exists, skipping.
+fi
+
+#
+# Add to system startup if required
+#
+if grep /usr/local/sbin/sshd /etc/rc.tcpip >/dev/null
+then
+	echo "sshd found in rc.tcpip, not adding."
+else
+	
+	echo >>/etc/rc.tcpip
+	echo "echo Starting sshd" >>/etc/rc.tcpip
+	echo "/usr/local/sbin/sshd" >>/etc/rc.tcpip
+fi
+
+#
+# Stop sshd if running
+#
+if [ -f $DESTDIR/$sysconfdir/sshd.pid ]
+then
+	pid=`cat $DESTDIR/$sysconfdir/sshd.pid`
+	if ps $pid | grep sshd >/dev/null
+	then
+		echo "Stopping sshd (pid $pid)."
+		kill $pid
+	fi
+fi
+
+#
+# Start now
+#
+echo "Starting sshd."
+/usr/local/sbin/sshd
