diff -r -c openssh-3.0.2p1-orig/contrib/solaris/README openssh-3.0.2p1-solaris/contrib/solaris/README *** openssh-3.0.2p1-orig/contrib/solaris/README Sat Oct 20 06:24:14 2001 --- openssh-3.0.2p1-solaris/contrib/solaris/README Sat Mar 2 23:54:40 2002 *************** *** 23,28 **** TODO: - Expand to cover all sysvr4 family of OSes - Clean things up a bit more. - - Detect if sshd is running and refuse to start. - - SHOULD check for existing sshd_config nor ssh_config (does not currently). - [Post install script? Ugh.. Nasty] --- 23,25 ---- diff -r -c openssh-3.0.2p1-orig/contrib/solaris/buildpkg.sh openssh-3.0.2p1-solaris/contrib/solaris/buildpkg.sh *** openssh-3.0.2p1-orig/contrib/solaris/buildpkg.sh Sat Oct 20 06:36:24 2001 --- openssh-3.0.2p1-solaris/contrib/solaris/buildpkg.sh Sat Mar 2 23:54:40 2002 *************** *** 25,30 **** --- 25,32 ---- ETCDIR=`grep "^sysconfdir=" Makefile | sed 's/sysconfdir=//'` PREFIX=`grep "^prefix=" Makefile | cut -d = -f 2` PIDDIR=`grep "^piddir=" Makefile | cut -d = -f 2` + prefix=$PREFIX + eval ETCDIR=$ETCDIR cd $FAKE_ROOT ## Setup our run level stuff while we are at it. *************** *** 47,52 **** --- 49,60 ---- ln -s ../init.d/opensshd $FAKE_ROOT/etc/rc1.d/K30opensshd ln -s ../init.d/opensshd $FAKE_ROOT/etc/rc2.d/S98opensshd + # Rename config files so they won't be overwritten + # postinstall script will copy if required + mv $FAKE_ROOT/$ETCDIR/ssh_config $FAKE_ROOT/$ETCDIR/ssh_config.default + mv $FAKE_ROOT/$ETCDIR/sshd_config $FAKE_ROOT/$ETCDIR/sshd_config.default + mv $FAKE_ROOT/$ETCDIR/ssh_prng_cmds $FAKE_ROOT/$ETCDIR/ssh_prng_cmds.default + ## Ok, this is outright wrong, but it will work. I'm tired of pkgmk ## whining. *************** *** 68,78 **** BASEDIR=/ _EOF ## Next Build our prototype echo "Building prototype file..." find . | egrep -v "prototype|pkginfo" | sort | pkgproto $PROTO_ARGS | \ awk ' ! BEGIN { print "i pkginfo" } { $5="root"; $6="sys"; } { print; }' > prototype --- 76,116 ---- BASEDIR=/ _EOF + echo "Building postinstall file..." + cat >postinstall <<_EOF + #!/bin/sh + + for cfgfile in ssh_config sshd_config ssh_prng_cmds + do + if [ ! -f $ETCDIR/\$cfgfile ] + then + echo "Creating \$cfgfile from default" + cp $ETCDIR/\$cfgfile.default $ETCDIR/\$cfgfile + else + echo "\$cfgfile already exists." + fi + done + + if [ -f $PIDDIR/sshd.pid ] + then + pid=\`cat $PIDDIR/sshd.pid\` + if ps -p \$pid | grep sshd >/dev/null + then + echo "Stopping sshd (pid \$pid)." + kill \$pid + fi + fi + + echo "Starting sshd." + /etc/init.d/opensshd start + _EOF + + ## Next Build our prototype echo "Building prototype file..." find . | egrep -v "prototype|pkginfo" | sort | pkgproto $PROTO_ARGS | \ awk ' ! BEGIN { print "i pkginfo"; print "i postinstall" } { $5="root"; $6="sys"; } { print; }' > prototype