diff -Naur qtiplot-0.9.7.6.orig/fitPlugins/exp_saturation/exp_saturation.pro qtiplot-0.9.7.6/fitPlugins/exp_saturation/exp_saturation.pro >qtiplot-qt4-x11.patch
--- qtiplot-0.9.7.6.orig/fitPlugins/exp_saturation/exp_saturation.pro	2009-04-01 16:16:14.000000000 +0200
+++ qtiplot-0.9.7.6/fitPlugins/exp_saturation/exp_saturation.pro	2009-03-27 10:03:07.000000000 +0100
@@ -12,14 +12,14 @@
 DESTDIR           = ../
  
 # statically link against GSL in 3rdparty
-INCLUDEPATH += ../../3rdparty/gsl/include/
-LIBS        += ../../3rdparty/gsl/lib/libgsl.a
-LIBS        += ../../3rdparty/gsl/lib/libgslcblas.a
+INCLUDEPATH += @PREFIX@/include/
+#LIBS        += @PREFIX@/lib/libgsl.a
+#LIBS        += @PREFIX@/lib/libgslcblas.a
 
 #dynamically link against GSL installed system-wide
-#unix:LIBS += -L /usr/lib$${libsuff} -lgsl -lgslcblas
+unix:LIBS += -L@PREFIX@/lib -lgsl -lgslcblas
 
-target.path=/usr/lib$${libsuff}/qtiplot/plugins
-INSTALLS += target
+#target.path=@PREFIX@/lib$${libsuff}/qtiplot/plugins
+#INSTALLS += target
 
 SOURCES += exp_saturation.c
diff -Naur qtiplot-0.9.7.6.orig/fitPlugins/explin/explin.pro qtiplot-0.9.7.6/fitPlugins/explin/explin.pro >> qtiplot-qt4-x11.patch
--- qtiplot-0.9.7.6.orig/fitPlugins/explin/explin.pro	2009-04-01 16:16:14.000000000 +0200
+++ qtiplot-0.9.7.6/fitPlugins/explin/explin.pro	2009-03-27 10:03:17.000000000 +0100
@@ -12,14 +12,14 @@
 DESTDIR           = ../
  
 # statically link against GSL in 3rdparty
-INCLUDEPATH += ../../3rdparty/gsl/include/
-LIBS        += ../../3rdparty/gsl/lib/libgsl.a
-LIBS        += ../../3rdparty/gsl/lib/libgslcblas.a
+INCLUDEPATH += @PREFIX@/include/
+#LIBS        += @PREFIX@/lib/libgsl.a
+#LIBS        += @PREFIX@/lib/libgslcblas.a
 
 #dynamically link against GSL installed system-wide
-#unix:LIBS += -L /usr/lib$${libsuff} -lgsl -lgslcblas
+unix:LIBS += -L@PREFIX@/lib -lgsl -lgslcblas
 
-target.path=/usr/lib$${libsuff}/qtiplot/plugins
-INSTALLS += target
+#target.path=@PREFIX@/lib$${libsuff}/qtiplot/plugins
+#INSTALLS += target
 
 SOURCES += explin.c
diff -Naur qtiplot-0.9.7.6.orig/fitPlugins/fitRational0/fitRational0.pro qtiplot-0.9.7.6/fitPlugins/fitRational0/fitRational0.pro >> qtiplot-qt4-x11.patch
--- qtiplot-0.9.7.6.orig/fitPlugins/fitRational0/fitRational0.pro	2009-04-01 16:16:14.000000000 +0200
+++ qtiplot-0.9.7.6/fitPlugins/fitRational0/fitRational0.pro	2009-03-27 10:03:23.000000000 +0100
@@ -1,25 +1,25 @@
-QMAKE_PROJECT_DEPTH = 0
-linux-g++-64: libsuff=64
-
-TARGET            = fitRational0
-TEMPLATE          = lib
-
-CONFIG           += thread
-CONFIG           += warn_on 
-CONFIG           += release
-CONFIG           += dll 
-
-DESTDIR           = ../
- 
-# statically link against GSL in 3rdparty
-INCLUDEPATH += ../../3rdparty/gsl/include/
-LIBS        += ../../3rdparty/gsl/lib/libgsl.a
-LIBS        += ../../3rdparty/gsl/lib/libgslcblas.a
-
-#dynamically link against GSL installed system-wide
-#unix:LIBS += -L /usr/lib$${libsuff} -lgsl -lgslcblas
-
-target.path=/usr/lib$${libsuff}/qtiplot/plugins
-INSTALLS += target
-
+QMAKE_PROJECT_DEPTH = 0
+linux-g++-64: libsuff=64
+
+TARGET            = fitRational0
+TEMPLATE          = lib
+
+CONFIG           += thread
+CONFIG           += warn_on 
+CONFIG           += release
+CONFIG           += dll 
+
+DESTDIR           = ../
+ 
+# statically link against GSL in 3rdparty
+INCLUDEPATH += @PREFIX@/include/
+#LIBS        += @PREFIX@/lib/libgsl.a
+#LIBS        += @PREFIX@/lib/libgslcblas.a
+
+#dynamically link against GSL installed system-wide
+unix:LIBS += -L@PREFIX@/lib -lgsl -lgslcblas
+
+#target.path=@PREFIX@/lib$${libsuff}/qtiplot/plugins
+#INSTALLS += target
+
 SOURCES += fitRational0.cpp
diff -Naur qtiplot-0.9.7.6.orig/fitPlugins/fitRational1/fitRational1.pro qtiplot-0.9.7.6/fitPlugins/fitRational1/fitRational1.pro >> qtiplot-qt4-x11.patch
--- qtiplot-0.9.7.6.orig/fitPlugins/fitRational1/fitRational1.pro	2009-04-01 16:16:14.000000000 +0200
+++ qtiplot-0.9.7.6/fitPlugins/fitRational1/fitRational1.pro	2009-03-27 10:03:29.000000000 +0100
@@ -12,14 +12,14 @@
 DESTDIR           = ../
  
 # statically link against GSL in 3rdparty
-INCLUDEPATH += ../../3rdparty/gsl/include/
-LIBS        += ../../3rdparty/gsl/lib/libgsl.a
-LIBS        += ../../3rdparty/gsl/lib/libgslcblas.a
+INCLUDEPATH += @PREFIX@/include/
+#LIBS        += @PREFIX@/lib/libgsl.a
+#LIBS        += @PREFIX@/lib/libgslcblas.a
 
 #dynamically link against GSL installed system-wide
-#unix:LIBS += -L /usr/lib$${libsuff} -lgsl -lgslcblas
+unix:LIBS += -L@PREFIX@/lib -lgsl -lgslcblas
 
-target.path=/usr/lib$${libsuff}/qtiplot/plugins
-INSTALLS += target
+#target.path=@PREFIX@/lib$${libsuff}/qtiplot/plugins
+#INSTALLS += target
 
 SOURCES += fitRational1.cpp
diff -Naur qtiplot-0.9.7.6.orig/manual/Makefile qtiplot-0.9.7.6/manual/Makefile >> qtiplot-qt4-x11.patch
--- qtiplot-0.9.7.6.orig/manual/Makefile	2009-04-01 16:16:49.000000000 +0200
+++ qtiplot-0.9.7.6/manual/Makefile	2009-03-26 12:50:12.000000000 +0100
@@ -1,3 +1,9 @@
 html-pdf:
-	docbook2html -d qtiplot.dsl docbook-en/index.docbook -e no-valid
-	dblatex -o qtiplot-manual-en.pdf -c dblatex.conf -p dblatex-param.xsl docbook-en/index.docbook
+#	docbook2html -d qtiplot.dsl docbook-en/index.docbook -e no-valid
+#	dblatex -o qtiplot-manual-en.pdf -c dblatex.conf -p dblatex-param.xsl docbook-en/index.docbook
+
+install:
+
+clean:
+
+distclean:
diff -Naur qtiplot-0.9.7.6.orig/qtiplot/qtiplot.pro qtiplot-0.9.7.6/qtiplot/qtiplot.pro >> qtiplot-qt4-x11.patch
--- qtiplot-0.9.7.6.orig/qtiplot/qtiplot.pro	2009-04-02 02:53:44.000000000 +0200
+++ qtiplot-0.9.7.6/qtiplot/qtiplot.pro	2009-04-08 09:47:16.000000000 +0200
@@ -1,6 +1,6 @@
 # building without muParser doesn't work yet
 SCRIPTING_LANGS += muParser
-SCRIPTING_LANGS += Python
+#SCRIPTING_LANGS += Python
 
 # a console displaying output of scripts; particularly useful on Windows
 # where running QtiPlot from a terminal is inconvenient
@@ -28,13 +28,14 @@
 #!!! Warning: You must modify these paths according to your computer settings
 #############################################################################
 
-INCLUDEPATH       += ../3rdparty/muparser/include
+INCLUDEPATH       += @PREFIX@/include
+INCLUDEPATH       += @PREFIX@/include/gsl
+INCLUDEPATH       += @PREFIX@/include/boost
+INCLUDEPATH       += @PREFIX@/lib/qt4-mac/include/qwt
 INCLUDEPATH       += ../3rdparty/qwtplot3d/include
-INCLUDEPATH       += ../3rdparty/qwt/src
 INCLUDEPATH       += ../3rdparty/liborigin
-INCLUDEPATH       += ../3rdparty/gsl/include
 INCLUDEPATH       += ../3rdparty/zlib
-INCLUDEPATH       += ../3rdparty/boost_1_36_0
+
 
 ##################### 3rd PARTY LIBRARIES SECTION ###########################
 #!!! Warning: You must modify these paths according to your computer settings
@@ -43,17 +44,14 @@
 ##################### Linux (Mac OS X) ######################################
 
 # statically link against libraries in 3rdparty
-unix:LIBS         += ../3rdparty/muparser/lib/libmuparser.a
-unix:LIBS         += ../3rdparty/qwt/lib/libqwt.a
-unix:LIBS         += ../3rdparty/gsl/lib/libgsl.a
-unix:LIBS         += ../3rdparty/gsl/lib/libgslcblas.a
-unix:LIBS         += ../3rdparty/boost_1_36_0/lib/libboost_date_time-gcc43-mt-1_36.a
-unix:LIBS         += ../3rdparty/boost_1_36_0/lib/libboost_thread-gcc43-mt-1_36.a
+#unix:LIBS         += @PREFIX@/lib/libboost_date_time-mt.a
+#unix:LIBS         += @PREFIX@/lib/libboost_thread-mt.a
 
 # dynamically link against dependencies if they are installed system-wide
-#unix:LIBS         += -lmuparser
-#unix:LIBS         += -lqwt
-#unix:LIBS         += -lgsl -lgslcblas
+unix:LIBS         += -lmuparser
+unix:LIBS         += -lqwt
+unix:LIBS         += -lgsl -lgslcblas
+unix:LIBS         += -lboost_date_time-mt -lboost_thread-mt
 
 ##################### Windows ###############################################
 
@@ -84,7 +82,7 @@
 	INSTALLS        += documentation
 	unix:INSTALLS        += man
 
-	unix: INSTALLBASE = /usr
+	unix: INSTALLBASE = @PREFIX@
 	win32: INSTALLBASE = C:/QtiPlot
 
 	unix: target.path = $$INSTALLBASE/bin
@@ -186,7 +184,7 @@
   				    qtiUtil.py \
   				    qti_wordlist.txt \
 
-  	unix: pythonconfig.path = /usr/local/qtiplot
+  	unix: pythonconfig.path = @PREFIX@/share/qtiplot
   	win32: pythonconfig.path = $$INSTALLBASE
   	DEFINES += PYTHON_CONFIG_PATH="\\\"$$replace(pythonconfig.path," ","\ ")\\\"
   }
@@ -210,8 +208,8 @@
 
 contains(CONFIG, HAVE_LIBPNG){
 	DEFINES += GL2PS_HAVE_LIBPNG
-	INCLUDEPATH += ../3rdparty/libpng/
-	LIBS        += ../3rdparty/libpng/libpng.a
+	INCLUDEPATH += @PREFIX@/include
+	LIBS        += -lpng
 }
 
 ###############################################################
