Index: client/Makefile ================================================================== --- client/Makefile +++ client/Makefile @@ -1,8 +1,34 @@ TCLKIT = tclkit +TCLCONFIGPATH = $(DESTDIR)/usr/lib $(DESTDIR)/usr/lib64 $(DESTDIR)/usr/local/lib $(DESTDIR)/usr/local/lib64 +TEAPOTCLIENTVERS = 0.1 +TCLDIR = + +all: + @echo 'Nothing to do.' -all: teapot-client.kit +install: + @echo TCLDIR="$(TCLDIR)"; \ + TCLDIR="$(TCLDIR)"; \ + if test -z "$${TCLDIR}"; then \ + for dir in $(TCLCONFIGPATH); do \ + if test -f "$${dir}/tclConfig.sh"; then \ + echo source "$${dir}/tclConfig.sh"; \ + source "$${dir}/tclConfig.sh"; \ + echo TCLDIR="$${TCL_PACKAGE_PATH}"; \ + TCLDIR="$${TCL_PACKAGE_PATH}"; \ + break; \ + fi; \ + done; \ + fi; \ + test -n "$${TCLDIR}" || (echo Unable to locate tclConfig.sh. Try specifying TCLDIR.; exit 1) || exit 1; \ + if test ! -e "$(DESTDIR)$${TCLDIR}/teapotclient$(TEAPOTCLIENTVERS)"; then \ + echo mkdir -p "$(DESTDIR)$${TCLDIR}/teapotclient$(TEAPOTCLIENTVERS)"; \ + mkdir -p "$(DESTDIR)$${TCLDIR}/teapotclient$(TEAPOTCLIENTVERS)" || exit 1; \ + fi; \ + echo cp "lib/teapotclient$(TEAPOTCLIENTVERS)"/*.tcl "$(DESTDIR)$${TCLDIR}/teapotclient$(TEAPOTCLIENTVERS)/"; \ + cp "lib/teapotclient$(TEAPOTCLIENTVERS)"/*.tcl "$(DESTDIR)$${TCLDIR}/teapotclient$(TEAPOTCLIENTVERS)/" || exit 1 teapot-client.kit: teapot-client.tcl lib/teapotclient0.1/pkgIndex.tcl lib/teapotclient0.1/teapotclient.tcl rm -rf teapot-client-tmp.vfs mkdir teapot-client-tmp.vfs cp -r lib teapot-client.tcl teapot-client-tmp.vfs/ @@ -18,6 +44,6 @@ rm -f teapot-client.kit rm -rf teapot-client-tmp.vfs distclean: clean -.PHONY: all clean distclean +.PHONY: all install clean distclean