diff -urN qtiplot-0.8.9-rc2.orig/fitPlugins/fitRational0/fitRational0.pro qtiplot-0.8.9-rc2/fitPlugins/fitRational0/fitRational0.pro
--- qtiplot-0.8.9-rc2.orig/fitPlugins/fitRational0/fitRational0.pro	2006-11-21 13:03:43.000000000 +0000
+++ qtiplot-0.8.9-rc2/fitPlugins/fitRational0/fitRational0.pro	2006-12-05 05:44:36.000000000 +0000
@@ -10,13 +10,14 @@
 CONFIG           += dll 
 
 DESTDIR           = ../
-unix:LIBS += -L /usr/lib$${libsuff} -lgsl
- 
+unix:LIBS += -L@PREFIX@/lib -lgsl
+unix:INCLUDEPATH  += @PREFIX@/include
+
 win32:INCLUDEPATH += C:/WinGsl
 win32:LIBS     += C:/WinGsl/Lib/WinGsl.lib 
 win32:DEFINES  += GSL_DLL 
 
-#target.path=/usr/lib$${libsuff}
+#target.path=@PREFIX@/lib
 #INSTALLS += target
 
 SOURCES += fitRational0.cpp
diff -urN qtiplot-0.8.9-rc2.orig/fitPlugins/fitRational1/fitRational1.pro qtiplot-0.8.9-rc2/fitPlugins/fitRational1/fitRational1.pro
--- qtiplot-0.8.9-rc2.orig/fitPlugins/fitRational1/fitRational1.pro	2006-11-21 13:03:43.000000000 +0000
+++ qtiplot-0.8.9-rc2/fitPlugins/fitRational1/fitRational1.pro	2006-12-05 05:44:28.000000000 +0000
@@ -9,14 +9,14 @@
 CONFIG           += release
 CONFIG           += dll 
 
-DESTDIR           = ../
-unix:LIBS += -L /usr/lib$${libsuff} -lgsl 
+unix:LIBS += -L@PREFIX@/lib -lgsl 
+unix:INCLUDEPATH  += @PREFIX@/include
 
 win32:INCLUDEPATH += C:/WinGsl
 win32:LIBS     += C:/WinGsl/Lib/WinGsl.lib 
 win32:DEFINES  += GSL_DLL 
 
-target.path=/usr/lib$${libsuff}
+target.path=@PREFIX@/lib
 INSTALLS += target
 
 SOURCES += fitRational1.cpp
diff -urN qtiplot-0.8.9-rc2.orig/qtiplot/qtiplot.pro qtiplot-0.8.9-rc2/qtiplot/qtiplot.pro
--- qtiplot-0.8.9-rc2.orig/qtiplot/qtiplot.pro	2006-11-21 14:17:42.000000000 +0000
+++ qtiplot-0.8.9-rc2/qtiplot/qtiplot.pro	2006-12-06 21:26:09.000000000 +0000
@@ -1,7 +1,8 @@
 QMAKE_PROJECT_DEPTH = 0
 linux-g++-64: libsuff=64
 
-TARGET		= qtiplot
+TARGET		= qtiplot
+QMAKE_LIBDIR = $(QTDIR)/libQMAKE_LFLAGS_SHLIB	= -prebind -dynamiclib -single_module -headerpad_max_install_names -install_name @PREFIX@/lib/qt3/lib/$(TARGET1)
 TEMPLATE	= app
 CONFIG		+= qt warn_on exceptions opengl
 CONFIG		+= release
@@ -15,7 +16,7 @@
 
 SCRIPTING_LANGS = muParser
 # Python support is unstable; use at your own risk
-unix:SCRIPTING_LANGS += Python
+#unix:SCRIPTING_LANGS += Python
 
 TRANSLATIONS = translations/qtiplot_de.ts \
 			   translations/qtiplot_es.ts \
@@ -26,19 +27,23 @@
 #system(lupdate -verbose qtiplot.pro)
 #system(lrelease -verbose qtiplot.pro)
 
-INCLUDEPATH	+= ../3rdparty/qwt/include
-INCLUDEPATH	+= ../3rdparty/liborigin
+INCLUDEPATH	+= @PREFIX@/lib/qt3/qwt/include
+# INCLUDEPATH	+= @PREFIX@/lib/liborigin/include
 
 ##################### Linux (Mac OS X) settings ##################### 
+
+unix:INCLUDEPATH  += @PREFIX@/include
+unix:INCLUDEPATH  += @PREFIX@/lib/qt3/qwtplot3d/include
+unix:LIBS         += -L@PREFIX@/lib/qt3/qwtplot3d/lib -lqwtplot3d
+unix:LIBS         += -L@PREFIX@/lib/qt3/qwt/lib -lqwt
+unix:LIBS         += -L@PREFIX@/lib -lgsl -lgslcblas 
+unix:LIBS         += -L/usr/lib -lz 
+unix:LIBS         += -L@PREFIX@/lib/liborigin -lorigin
 
-unix:INCLUDEPATH  += -I /usr/include/qwtplot3d
-unix:LIBS         += ../3rdparty/qwt/lib$${libsuff}/libqwt.a
-unix:LIBS         += -L /usr/lib$${libsuff} -lgsl -lgslcblas -lqwtplot3d -lz -lorigin
-
-unix:target.path=/usr/bin
+unix:target.path=@PREFIX@/bin
 unix:INSTALLS += target
 
-unix:documentation.path = /usr/share/doc/qtiplot
+unix:documentation.path = @PREFIX@/share/doc/qtiplot-python2X
 unix:documentation.files = doc/*
 unix:INSTALLS += documentation
 
@@ -258,12 +263,12 @@
   DEFINES +=	SCRIPTING_PYTHON
   HEADERS +=	src/PythonScripting.h
   SOURCES +=	src/PythonScripting.cpp
-  unix:INCLUDEPATH += /usr/include/python2.4
-  LIBS +=	-lpython2.4 -lm
+   unix:INCLUDEPATH += @PREFIX@/include/python2.X
+  LIBS +=	-L@PREFIX@/lib/python2.X/config/ -lpython2.X -lm
   
   # TODO: is there a way to do this in the Makefile?
   unix:system(mkdir -p $${MOC_DIR})
-  unix:system(sip -I /usr/share/sip -t Qt_3_3_0 -t WS_X11 -c $${MOC_DIR} src/qti.sip)
+  unix:system(sip -I @PREFIX@/bin/sip -t Qt_3_3_0 -t WS_X11 -c $${MOC_DIR} src/qti.sip)
 
   HEADERS +=\
 	 ../tmp/qtiplot/sipqtiApplicationWindow.h\
diff -urN qtiplot-0.8.9-rc2.orig/qtiplot.pro qtiplot-0.8.9-rc2/qtiplot.pro
--- qtiplot-0.8.9-rc2.orig/qtiplot.pro	2006-11-21 13:04:47.000000000 +0000
+++ qtiplot-0.8.9-rc2/qtiplot.pro	2006-12-05 05:19:03.000000000 +0000
@@ -1,6 +1,5 @@
 TEMPLATE    =	subdirs
 
-SUBDIRS = 3rdparty/qwt\
-	  fitPlugins/fitRational0\
+SUBDIRS = fitPlugins/fitRational0\
 	  fitPlugins/fitRational1\
 	  qtiplot

 	  	 
