Author: Ole Streicher <debian@liska.ath.cx>
Description: Correct the installation directory
--- a/Makefile.in
+++ b/Makefile.in
@@ -22,7 +22,7 @@
 #----------------------------------------------------------------------------
 # Configurable macros:
 #----------------------------------------------------------------------------
-INSTALLDIR	= @prefix@
+INSTALLDIR	= $(DESTDIR)@prefix@
 CC		= @CC@
 RANLIB		= @RANLIB@
 CFLAGS		= @CFLAGS@
@@ -61,6 +61,7 @@
 		${SHLIB_LD} ${LD_FLAGS} ${SHARED_OBJ} ${SHLIB_LD_LIBS} \
 			 -L${TCL_LIB_PATH} -l${TCL_LIB} -o ${SHARED_LIB}; \
 	fi
+	echo "pkg_mkIndex  . ${SHARED_LIB}" | tclsh
 
 
 install: all
@@ -68,12 +69,13 @@
 		echo "cp ${STATIC_LIB} ${INSTALLDIR}/lib/"; \
 		cp ${STATIC_LIB} ${INSTALLDIR}/lib/; \
 	else \
+		mkdir -p ${INSTALLDIR}/lib/tcltk/fitsTcl; \
 		echo "cp ${SHARED_LIB} ${INSTALLDIR}/lib/"; \
-		cp ${SHARED_LIB} ${INSTALLDIR}/lib/; \
+		cp ${SHARED_LIB} pkgIndex.tcl ${INSTALLDIR}/lib/tcltk/fitsTcl; \
 	fi
 
 clean:
-	-rm -rf *.o *~ ${STATIC_LIB} ${SHARED_LIB}
+	-rm -rf *.o *~ ${STATIC_LIB} ${SHARED_LIB} pkgIndex.tcl
 
 distclean: clean
 	-rm -f config.cache config.status config.log Makefile so_locations
--- a/fitsInit.c
+++ b/fitsInit.c
@@ -24,6 +24,8 @@
 
     int i;
 
+    Tcl_PkgProvide(interp, "fitsTcl", FITSTCL_VERSION);
+
     for ( i = 0; i < FITS_MAX_OPEN_FILES; i++) {
 	FitsOpenFiles[i].fptr = NULL;
 	FitsOpenFiles[i].kwds = FitsOpenKwds + i;
--- a/fitsTcl.html
+++ b/fitsTcl.html
@@ -39,19 +39,13 @@
 </p>
 
 <p>
-fitsTcl is compiled as a dynamic library which can be loaded as a TCL 
-extension. To load fitsTcl, type the following command in a Tcl shell
-(running on UNIX)
+fitsTcl is compiled as a TCL packge. To load fitsTcl, type the following
+command in a Tcl shell
 
 <pre>
-% load libfitstcl.so
+% package require fitsTcl
 </pre>
 
-(Under Mac&nbsp;OS and Windows, the library is instead named
-<tt>fitstcl.dll</tt>.)  If the library is not found you may need to
-set the environment variable <tt>LD_LIBRARY_PATH</tt> (Unix only) to the
-directory containing libfitstcl.so or include an explicit path to the
-file.
 </p>
 
 <p>
