+Thu Oct 3 13:16:19 1996 Ezra Peisach <epeisach@kangaroo.mit.edu>
+
+ * env-setup.shin: Renamed env-setup.sh for autoconf use.
+
+ * init_db, start_servers, start_servers_local, stop_servers:
+ Invoke scripts from source directory or build tree as needed.
+
+ * configure.in, Makefile.in: generate env-setup.sh with proper
+ paths already.
+
+
Wed Oct 2 13:41:04 1996 Ezra Peisach <epeisach@kangaroo.mit.edu>
* configure.in, Makefile.in: Let autoconf determine path to perl.
GEN_SCRIPTS = compare_dump.pl fixup-conf-files.pl make-host-keytab.pl \
simple_dump.pl verify_xrunner_report.pl qualname.pl
-all:: $(GEN_SCRIPTS) restore_files.sh
+all:: env-setup.sh $(GEN_SCRIPTS) restore_files.sh
+
+# Should only rebuild env_setup.sh here (use CONFIG_FILES=), but the weird krb5
+# makefile post-processing is unconditional and would trash the makefile.
+env-setup.sh: env-setup.stamp
+env-setup.stamp: $(srcdir)/env-setup.shin config.status
+ $(SHELL) config.status
+ chmod +x env-setup.sh
+ touch env-setup.stamp
restore_files.sh:
rm -f restore_files.sh
- ln -s save_files.sh restore_files.sh
+ ln -s $(srcdir)/save_files.sh restore_files.sh
%.pl: %.pl.in
-rm -f $@.tmp
mv $@.tmp $@
clean::
- -rm -f $(GEN_SCRIPTS) *.tmp
+ -rm -f $(GEN_SCRIPTS) *.tmp env-setup.sh env-setup.stamp restore_files.sh
AC_INIT(init_db)
CONFIG_RULES
AC_PATH_PROG(PERL,perl)
-V5_AC_OUTPUT_MAKEFILE
+dnl The following are substituted into env-setup.sh
+AC_SUBST(BUILDTOP)
+AC_SUBST(SRCTOP)
+V5_AC_OUTPUT_MAKEFILE( ,env-setup.sh:env-setup.shin)
+++ /dev/null
-#!/bin/sh
-#
-# The KADM5 unit tests were developed to work under gmake. As a
-# result, they expect to inherit a number of environment variables.
-# Rather than rewrite the tests, we simply use this script as an
-# execution wrapper that sets all the necessary environment variables
-# before running the program specified on its command line.
-#
-# The variable settings all came from OV's config.mk.
-#
-# Usage: env-setup.sh <command line>
-#
-
-if [ "$TOP" = "" ]; then
- echo "Error! \$TOP is not set."
- exit 1
-fi
-
-TESTDIR=$TOP/testing; export TESTDIR
-if [ "$K5ROOT" = "" ]; then
- K5ROOT="`cd $TESTDIR; pwd`/krb5-test-root"
- export K5ROOT
-fi
-
-REALM=SECURE-TEST.OV.COM; export REALM
-
-# XXX This should be detected by configure!
-EXPECT=/mit/gnu/bin/expect; export EXPECT
-
-COMPARE_DUMP=$TESTDIR/scripts/compare_dump.pl; export COMPARE_DUMP
-FIX_CONF_FILES=$TESTDIR/scripts/fixup-conf-files.pl
-export FIX_CONF_FILES
-INITDB=$TESTDIR/scripts/init_db; export INITDB
-MAKE_KEYTAB=$TESTDIR/scripts/make-host-keytab.pl; export MAKE_KEYTAB
-LOCAL_MAKE_KEYTAB=$TESTDIR/scripts/make-host-keytab.pl
-export LOCAL_MAKE_KEYTAB
-RESTORE_FILES=$TESTDIR/scripts/restore_files.sh; export RESTORE_FILES
-SAVE_FILES=$TESTDIR/scripts/save_files.sh; export SAVE_FILES
-SIMPLE_DUMP=$TESTDIR/scripts/simple_dump.pl; export SIMPLE_DUMP
-TCLUTIL=$TESTDIR/tcl/util.t; export TCLUTIL
-BSDDB_DUMP=$TESTDIR/util/bsddb_dump; export BSDDB_DUMP
-CLNTTCL=$TESTDIR/util/ovsec_kadm_clnt_tcl; export CLNTTCL
-SRVTCL=$TESTDIR/util/ovsec_kadm_srv_tcl; export SRVTCL
-QUALNAME=$TOP/inst-scripts/qualname.pl; export QUALNAME
-
-KRB5_CONFIG=$K5ROOT/krb5.conf; export KRB5_CONFIG
-KRB5_KDC_PROFILE=$K5ROOT/kdc.conf; export KRB5_KDC_PROFILE
-KRB5_KTNAME=$K5ROOT/ovsec_adm.srvtab; export KRB5_KTNAME
-
-if [ "$TEST_SERVER" != "" ]; then
- MAKE_KEYTAB="$MAKE_KEYTAB -server $TEST_SERVER"
-fi
-if [ "$TEST_PATH" != "" ]; then
- MAKE_KEYTAB="$MAKE_KEYTAB -top $TEST_PATH"
-fi
-
-if [ "x$PS_ALL" = "x" ]; then
- ps -axwwu >/dev/null 2>&1
- ps_bsd=$?
-
- ps -ef >/dev/null 2>&1
- ps_sysv=$?
-
- if [ $ps_bsd = 0 -a $ps_sysv = 1 ]; then
- PS_ALL="ps -auxww"
- PS_PID="ps -auxww"
- elif [ $ps_bsd = 1 -a $ps_sysv = 0 ]; then
- PS_ALL="ps -ef"
- PS_PID="ps -fp"
- else
- PS_ALL="ps -auxww"
- PS_PID="ps -auxww"
- echo "WARNING! Cannot auto-detect ps type, assuming BSD."
- fi
-
- export PS_ALL PS_PID
-fi
-
-exec ${1+"$@"}
# Usage: env-setup.sh <command line>
#
-if [ "$TOP" = "" ]; then
- echo "Error! \$TOP is not set."
- exit 1
-fi
+TOP=@BUILDTOP@/kadmin
+STOP=@SRCTOP@/kadmin
+export TOP
+export STOP
TESTDIR=$TOP/testing; export TESTDIR
+STESTDIR=$STOP/testing; export STESTDIR
if [ "$K5ROOT" = "" ]; then
K5ROOT="`cd $TESTDIR; pwd`/krb5-test-root"
export K5ROOT
COMPARE_DUMP=$TESTDIR/scripts/compare_dump.pl; export COMPARE_DUMP
FIX_CONF_FILES=$TESTDIR/scripts/fixup-conf-files.pl
export FIX_CONF_FILES
-INITDB=$TESTDIR/scripts/init_db; export INITDB
+INITDB=$STESTDIR/scripts/init_db; export INITDB
MAKE_KEYTAB=$TESTDIR/scripts/make-host-keytab.pl; export MAKE_KEYTAB
LOCAL_MAKE_KEYTAB=$TESTDIR/scripts/make-host-keytab.pl
export LOCAL_MAKE_KEYTAB
RESTORE_FILES=$TESTDIR/scripts/restore_files.sh; export RESTORE_FILES
-SAVE_FILES=$TESTDIR/scripts/save_files.sh; export SAVE_FILES
+SAVE_FILES=$STESTDIR/scripts/save_files.sh; export SAVE_FILES
SIMPLE_DUMP=$TESTDIR/scripts/simple_dump.pl; export SIMPLE_DUMP
-TCLUTIL=$TESTDIR/tcl/util.t; export TCLUTIL
+TCLUTIL=$STESTDIR/tcl/util.t; export TCLUTIL
BSDDB_DUMP=$TESTDIR/util/bsddb_dump; export BSDDB_DUMP
CLNTTCL=$TESTDIR/util/ovsec_kadm_clnt_tcl; export CLNTTCL
SRVTCL=$TESTDIR/util/ovsec_kadm_srv_tcl; export SRVTCL
exit 1
fi
+if [ "$STOP" = "" ]; then
+ echo "init_db: Environment variable \$STOP must point to top of source tree" 1>&2
+ exit 1
+fi
+
IROOT=$TOP/..
ADMIN=$TOP/dbutil
BIN=$IROOT/bin
DUMMY=${REALM=SECURE-TEST.OV.COM}; export REALM
DUMMY=${TESTDIR=$TOP/testing}; export TESTDIR
+DUMMY=${STESTDIR=$STOP/testing}
DUMMY=${SRVTCL=$TESTDIR/util/ovsec_kadm_srv_tcl}; export SRVTCL
-DUMMY=${TCLUTIL=$TESTDIR/tcl/util.t}; export TCLUTIL
+DUMMY=${TCLUTIL=$STESTDIR/tcl/util.t}; export TCLUTIL
DUMMY=${LOCAL_MAKE_KEYTAB=$TESTDIR/scripts/make-host-keytab.pl}
PATH=$ADMIN:$BIN:$ETC:$SBIN:$PATH; export PATH
sed -e "s/__REALM__/$REALM/g" -e "s#__K5ROOT__#$K5ROOT#g" \
-e "s/__KDCHOST__/localhost/g" \
- < $TESTDIR/proto/krb5.conf.proto > $K5ROOT/krb5.conf
+ < $STESTDIR/proto/krb5.conf.proto > $K5ROOT/krb5.conf
sed -e "s/__REALM__/$REALM/g" -e "s#__K5ROOT__#$K5ROOT#g" \
- < $TESTDIR/proto/kdc.conf.proto > $K5ROOT/kdc.conf
+ < $STESTDIR/proto/kdc.conf.proto > $K5ROOT/kdc.conf
kdb5_util -r $REALM create -P mrroot -s $REDIRECT
-cp $TESTDIR/proto/ovsec_adm.dict $K5ROOT/ovsec_adm.dict
+cp $STESTDIR/proto/ovsec_adm.dict $K5ROOT/ovsec_adm.dict
eval $SRVTCL <<'EOF' $REDIRECT
source $env(TCLUTIL)
# TOP is used.
DUMMY=${TESTDIR=$TOP/testing}
-DUMMY=${SAVE_FILES=$TESTDIR/scripts/save_files.sh}
+DUMMY=${STESTDIR=$STOP/testing}
+DUMMY=${SAVE_FILES=$STESTDIR/scripts/save_files.sh}
DUMMY=${FIX_CONF_FILES=$TESTDIR/scripts/fixup-conf-files.pl}
-DUMMY=${START_SERVERS_LOCAL=$TESTDIR/scripts/start_servers_local}
+DUMMY=${START_SERVERS_LOCAL=$STESTDIR/scripts/start_servers_local}
# This'll be wrong sometimes
DUMMY=${RSH_CMD=rsh}
# Fix up the local krb5.conf to point to the remote
sed -e "s/__REALM__/$REALM/g" -e "s#__K5ROOT__#$K5ROOT#g" \
-e "s/__KDCHOST__/$hostname/g" \
- < $TESTDIR/proto/krb5.conf.proto > $K5ROOT/krb5.conf
+ < $STESTDIR/proto/krb5.conf.proto > $K5ROOT/krb5.conf
# Using /usr/ucb/rsh and getting rid of "-k $REALM" until we get
# around to fixing the fact that Kerberos rsh doesn't strip out "-k
#!/bin/sh
DUMMY=${TESTDIR=$TOP/testing}
-DUMMY=${SAVE_FILES=$TESTDIR/scripts/save_files.sh}
+DUMMY=${STESTDIR=$STOP/testing}
+DUMMY=${SAVE_FILES=$STESTDIR/scripts/save_files.sh}
DUMMY=${FIX_CONF_FILES=$TESTDIR/scripts/fixup-conf-files.pl}
-DUMMY=${INITDB=$TESTDIR/scripts/init_db}
+DUMMY=${INITDB=$STESTDIR/scripts/init_db}
DUMMY=${SRVTCL=$TESTDIR/util/ovsec_kadm_srv_tcl}; export SRVTCL
DUMMY=${LOCAL_MAKE_KEYTAB=$TESTDIR/scripts/make-host-keytab.pl}
-DUMMY=${STOP_SERVERS_LOCAL=$TESTDIR/scripts/stop_servers_local}
+DUMMY=${STOP_SERVERS_LOCAL=$STESTDIR/scripts/stop_servers_local}
if [ -d /usr/tmp ]; then
usrtmp=/usr/tmp
# TOP is used.
DUMMY=${TESTDIR=$TOP/testing}
+DUMMY=${STESTDIR=$STOP/testing}
DUMMY=${FIX_CONF_FILES=$TESTDIR/scripts/fixup-conf-files.pl}
-DUMMY=${STOP_SERVERS_LOCAL=$TESTDIR/scripts/stop_servers_local}
+DUMMY=${STOP_SERVERS_LOCAL=$STESTDIR/scripts/stop_servers_local}
# This'll be wrong sometimes
DUMMY=${RSH_CMD=rsh}
DUMMY=${RESTORE_FILES=$TESTDIR/scripts/restore_files.sh}