Author: Ole Streicher
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
@if [ "x${C_LIB_OPTION}" = xstatic ]; then \
@@ -68,11 +69,12 @@
cp ${STATIC_LIB} ${INSTALLDIR}/lib/; \
else \
echo "cp ${SHARED_LIB} ${INSTALLDIR}/lib/"; \
- cp ${SHARED_LIB} ${INSTALLDIR}/lib/; \
+ mkdir -p ${INSTALLDIR}/lib/tcltk/${DEB_HOST_MULTIARCH}/fitsTcl; \
+ cp ${SHARED_LIB} pkgIndex.tcl ${INSTALLDIR}/lib/tcltk/${DEB_HOST_MULTIARCH}/fitsTcl; \
fi
clean:
- -rm -rf ${LOCAL_OBJ} ${STATIC_LIB} ${SHARED_LIB}
+ -rm -rf ${LOCAL_OBJ} ${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
@@ -160,6 +160,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,24 +39,14 @@
-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
+fitsTcl is compiled as a TCL packge. To load fitsTcl, type the following
+command in a Tcl shell
(i.e. tclsh):
-% load libfitstcl.so (Linux)
-
-% load libfitstcl.dylib (Mac OS X)
-
-% load libfitstcl (Cygwin)
+% package require fitsTcl
-If the library is not found you may need to
-set the environment variable LD_LIBRARY_PATH (Unix only) to the
-directory containing libfitstcl.so or include an explicit path to the
-file.
-
-
In fitsTcl, every FITS file is treated as a FitsFile object. The
following sections describe how to create FitsFile objects and all