diff -uNr sparky/Makefile sparky.fink/Makefile
--- sparky/Makefile	2004-02-18 13:40:04.000000000 -0500
+++ sparky.fink/Makefile	2005-12-14 19:47:39.000000000 -0500
@@ -25,10 +25,10 @@
 INSTALL		= \cp
 INSTALLDIR	= \cp -R
 
-SPARKY		= /usr/local/src/sparky
+SPARKY		= @BUILDDIR@
 SPARKY_SRC	= $(SPARKY)/c++
 SPARKY_OBJ	= $(SPARKY)/c++
-SPARKY_INSTALL	= /usr/local/sparky
+SPARKY_INSTALL	= @FINKDESTDIR@@FINKPREFIX@/lib/sparky-py2X
 SPARKY_SCRIPT	= sparky
 SCRIPT_SUFFIX	=
 
@@ -38,7 +38,7 @@
 		  bruk2ucsf$(EXE_SUFFIX) peaks2ucsf$(EXE_SUFFIX) \
 		  matrix2ucsf$(EXE_SUFFIX)
 
-PYTHON_VERSION	= 2.5
+PYTHON_VERSION	= 2.X
 PYTHON_DIR	= 
 
 PYMOD_SUFFIX	= .so
@@ -51,10 +51,12 @@
 Makefile.dep TAGS: force
 	cd $(SPARKY_SRC) && $(MAKE) -f Makefile -e $@
 
-install: install-nopython $(SPARKY_INSTALL) install-python
+install: install-nopython $(SPARKY_INSTALL) 
 	cd $(SPARKY_OBJ) && \
 	$(MAKE) -f $(SPARKY_SRC)/Makefile -e install-python
 	cd $(SPARKY)/python && $(MAKE) -f Makefile -e install
+	cp $(SPARKY_SRC)/_tkinter.so $(SPARKY_INSTALL)/python/lib-tk
+	cp $(SPARKY_SRC)/spy.so $(SPARKY_INSTALL)/python/sparky
 
 install-nopython: install-bin install-example install-lib \
 		  install-man install-misc
@@ -79,17 +81,10 @@
 	cd $(SPARKY) ; $(INSTALL) LICENSE README $(SPARKY_INSTALL)
 	cd $(SPARKY_INSTALL) ; chmod 644 LICENSE README
 
-install-python: $(SPARKY_INSTALL) $(SPARKY_INSTALL)/python$(PYTHON_VERSION)
-ifdef PYTHON_DIR
-	$(INSTALLDIR) $(PYTHON_DIR)/* $(SPARKY_INSTALL)/python$(PYTHON_VERSION)
-else
-	echo "Not packaging Python with Sparky."
-endif
-
 install-mac:
 	cd $(SPARKY)/mac && $(MAKE) -f Makefile -e install
 
-$(SPARKY_INSTALL) $(SPARKY_INSTALL)/bin $(SPARKY_INSTALL)/python$(PYTHON_VERSION):
+$(SPARKY_INSTALL) $(SPARKY_INSTALL)/bin:
 	mkdir $@
 	chmod 755 $@
 
diff -uNr sparky/bin/sparky sparky.fink/bin/sparky
--- sparky/bin/sparky	2004-03-05 14:32:10.000000000 -0500
+++ sparky.fink/bin/sparky	2005-12-09 15:03:51.000000000 -0500
@@ -25,15 +25,15 @@
 # If Python is available start Sparky as a Python extension.
 # Otherwise the standalone version of Sparky is started.
 #
-set PYTHON = "$SPARKY_INSTALL/python2.5/bin/python2.5"
+set PYTHON = "@FINKPREFIX@/bin/python2.X"
 if (! -e "$PYTHON") then
-  set PYTHON = python2.5
+  set PYTHON = python2.X
 endif
 
 # -----------------------------------------------------------------------------
 # Where to find Tcl/Tk shared libraries and resources.
 #
-setenv TCLTK_LIB		"$SPARKY_INSTALL/lib"
+setenv TCLTK_LIB		"@FINKPREFIX@/lib"
 setenv LD_LIBRARY_PATH		"$TCLTK_LIB"
 setenv LD_LIBRARYN32_PATH	"$TCLTK_LIB"
 setenv DYLD_LIBRARY_PATH	"$TCLTK_LIB"
diff -uNr sparky/c++/Makefile sparky.fink/c++/Makefile
--- sparky/c++/Makefile	2004-02-03 18:56:24.000000000 -0500
+++ sparky.fink/c++/Makefile	2005-12-14 19:40:06.000000000 -0500
@@ -15,32 +15,33 @@
 INSTALL		= \cp
 REMOVE		= \rm -f
 
-SPARKY		= /usr/local/src/sparky
+SPARKY		= @BUILDDIR@
 SPARKY_SRC	= $(SPARKY)/c++
-PYTHON_VERSION	= 2.5
-PY_VER_WIN32	= 25
-PYTHON_PREFIX	= /usr/local
+SPARKY_INSTALL = @FINKDESTDIR@@FINKPREFIX@/lib/sparky-py2X
+PYTHON_VERSION	= 2.X
+PY_VER_WIN32	= 2X
+PYTHON_PREFIX	= @FINKPREFIX@
 PYTHON_LIB	= $(PYTHON_PREFIX)/lib/python$(PYTHON_VERSION)
 PYTHON_INC	= $(PYTHON_PREFIX)/include/python$(PYTHON_VERSION)
 TCLTK_VERSION	= 8.4
 TCLTK_VER_WIN32	= 84
-TK_PREFIX	= /usr/local
+TK_PREFIX	= @FINKPREFIX@
 TK_LIBNAME	= tk$(TCLTK_VERSION)
 TCL_LIBNAME	= tcl$(TCLTK_VERSION)
 PLATFORM	= unix
 
 CXX		= g++
-CXXFLAGS	= 
+CXXFLAGS	= -O3 -ffast-math -fPIC -fno-common -Wno-long-double
 CC		= gcc
-CFLAGS		=
+CFLAGS		= -O3 -ffast-math -fPIC -fno-common
 PYFLAGS		= -I$(PYTHON_INC) -I$(PYTHON_LIB)/config
-TKFLAGS		= -I$(TK_PREFIX)/include
-TKLIBS		= -L$(TK_PREFIX)/lib -l$(TK_LIBNAME) -l$(TCL_LIBNAME) -lX11
+TKFLAGS                = -I$(TK_PREFIX)/include -I@X11DIR@/include
+TKLIBS		= -L$(TK_PREFIX)/lib -l$(TK_LIBNAME) -l$(TCL_LIBNAME) -L@X11DIR@/lib -lX11
 EXTRALIBS	= 
 SYSLIBS		= -lm
 LDLIBS		= $(TKLIBS) $(SYSLIBS) $(EXTRALIBS)
 LDFLAGS		=
-LDSHARED	= -shared
+LDSHARED	= -bundle -flat_namespace -undefined suppress 
 DEPEND		= -MM
 
 CXX_RULE_PREFIX	=
diff -uNr sparky/lib/Makefile sparky.fink/lib/Makefile
--- sparky/lib/Makefile	2004-02-18 13:53:29.000000000 -0500
+++ sparky.fink/lib/Makefile	2005-12-09 16:34:17.000000000 -0500
@@ -6,31 +6,23 @@
 INSTALL		= \cp
 INSTALLDIR	= \cp -r
 
-SPARKY_INSTALL	= /usr/local/sparky
+SPARKY_INSTALL	= @FINKDESTDIR@@FINKPREFIX@/lib/sparky-py2X
 
 TCLTK_VERSION	= 8.4
 TK_VERSION	= tk$(TCLTK_VERSION)
 TCL_VERSION	= tcl$(TCLTK_VERSION)
-TK_PREFIX	= /usr/local
+TK_PREFIX	= @FINKPREFIX@
 TCL_TK_LIB	= $(TK_PREFIX)/lib
 TCL_TK_SHLIB	= $(TCL_TK_LIB)
-TCLTK_SHLIB_SUFFIX	= .so
+TCLTK_SHLIB_SUFFIX	= .dylib
 TCL_SHLIB	= lib$(TCL_VERSION)$(TCLTK_SHLIB_SUFFIX)
 TK_SHLIB	= lib$(TK_VERSION)$(TCLTK_SHLIB_SUFFIX)
 
-install: $(SPARKY_INSTALL)/lib install-tcl-tk
+install: $(SPARKY_INSTALL)/lib
 	$(INSTALL) Sparky print-prolog.ps $(SPARKY_INSTALL)/lib
 	cd $(SPARKY_INSTALL)/lib ; \
 	chmod 644 Sparky print-prolog.ps
 
-install-tcl-tk: $(SPARKY_INSTALL)/lib
-	$(INSTALL) $(TCL_TK_SHLIB)/$(TCL_SHLIB) $(SPARKY_INSTALL)/lib
-	$(INSTALL) $(TCL_TK_SHLIB)/$(TK_SHLIB) $(SPARKY_INSTALL)/lib
-	chmod 755 $(SPARKY_INSTALL)/lib/$(TCL_SHLIB)
-	chmod 755 $(SPARKY_INSTALL)/lib/$(TK_SHLIB)
-	$(INSTALLDIR) $(TCL_TK_LIB)/$(TCL_VERSION) $(TCL_TK_LIB)/$(TK_VERSION) \
-		$(SPARKY_INSTALL)/lib
-
 $(SPARKY_INSTALL)/lib:
 	mkdir $@
 	chmod 755 $@
diff -uNr sparky/manual/Makefile sparky.fink/manual/Makefile
--- sparky/manual/Makefile	2004-03-08 18:40:06.000000000 -0500
+++ sparky.fink/manual/Makefile	2005-12-09 16:58:17.000000000 -0500
@@ -11,7 +11,7 @@
 
 INSTALL		= \cp
 
-SPARKY_INSTALL	= /usr/local/sparky
+SPARKY_INSTALL	= @FINKDESTDIR@@FINKPREFIX@/lib/sparky-py2X
 MANUAL_WWW	= /usr/local/html/cgl/sparky/manual
 
 MANUAL_SECTIONS = overview.html intro.html views.html peaks.html \
Binary files sparky/manual/manual-postscript.gz and sparky.fink/manual/manual-postscript.gz differ
diff -uNr sparky/python/Makefile sparky.fink/python/Makefile
--- sparky/python/Makefile	2004-02-18 13:51:06.000000000 -0500
+++ sparky.fink/python/Makefile	2005-12-14 19:42:20.000000000 -0500
@@ -4,9 +4,9 @@
 
 INSTALL		= \cp
 
-SPARKY_INSTALL	= /usr/local/sparky
-PYTHON_PREFIX	= /usr/local
-PYTHON_VERSION	= 2.5
+SPARKY_INSTALL	= @FINKDESTDIR@@FINKPREFIX@/lib/sparky-py2X
+PYTHON_PREFIX	= @FINKPREFIX@
+PYTHON_VERSION	= 2.X
 PYTHON		= $(PYTHON_PREFIX)/bin/python$(PYTHON_VERSION)
 PYTHON_LIB	= $(PYTHON_PREFIX)/lib/python$(PYTHON_VERSION)
 
@@ -35,8 +35,8 @@
 	chmod 644 $(SPARKY_INSTALL)/python/README
 	cd $(SPARKY_INSTALL)/python/sparky ; chmod 644 $(PYTHON_CODE)
 	chmod 644 $(SPARKY_INSTALL)/python/lib-tk/*.py
-	$(PYTHON) $(PYTHON_LIB)/compileall.py $(SPARKY_INSTALL)/python/sparky
-	$(PYTHON) $(PYTHON_LIB)/compileall.py $(SPARKY_INSTALL)/python/lib-tk
+	$(PYTHON) $(PYTHON_LIB)/compileall.py -d @FINKPREFIX@/lib/sparky-py2X/python/sparky $(SPARKY_INSTALL)/python/sparky
+	$(PYTHON) $(PYTHON_LIB)/compileall.py -d @FINKPREFIX@/lib/sparky-py2X/python/lib-tk $(SPARKY_INSTALL)/python/lib-tk
 
 $(SPARKY_INSTALL)/python $(SPARKY_INSTALL)/python/sparky \
   $(SPARKY_INSTALL)/python/lib-tk:

 	  	 
