diff -ru tsp-0.8.2-Source.orig/CMakeLists.txt tsp-0.8.2-Source/CMakeLists.txt
--- tsp-0.8.2-Source.orig/CMakeLists.txt	2006-11-29 08:40:21.000000000 +0100
+++ tsp-0.8.2-Source/CMakeLists.txt	2007-01-15 11:46:03.000000000 +0100
@@ -494,13 +494,13 @@
   ADD_CUSTOM_TARGET(srpm
     COMMAND cp ${CMAKE_BINARY_DIR}/${CPACK_SOURCE_PACKAGE_FILE_NAME}.tar.gz ${CMAKE_BINARY_DIR}/RPM/SOURCES
     COMMAND cp ${CMAKE_BINARY_DIR}/src/scripts/tsp.spec ${CMAKE_BINARY_DIR}/RPM/SPECS
-    COMMAND rpmbuild -bs -vv --define="_topdir ${CMAKE_BINARY_DIR}/RPM" --buildroot=${CMAKE_BINARY_DIR}/RPM/tmp ${CMAKE_BINARY_DIR}/src/scripts/tsp.spec
+    COMMAND rpmbuild -bs --define=\"_topdir ${CMAKE_BINARY_DIR}/RPM\" --buildroot=${CMAKE_BINARY_DIR}/RPM/tmp ${CMAKE_BINARY_DIR}/src/scripts/tsp.spec
     )
   
   ADD_CUSTOM_TARGET(rpm
     COMMAND cp ${CMAKE_BINARY_DIR}/${CPACK_SOURCE_PACKAGE_FILE_NAME}.tar.gz ${CMAKE_BINARY_DIR}/RPM/SOURCES
     COMMAND cp ${CMAKE_BINARY_DIR}/src/scripts/tsp.spec ${CMAKE_BINARY_DIR}/RPM/SPECS
-    COMMAND rpmbuild -bb -vv  --define="_topdir ${CMAKE_BINARY_DIR}/RPM" --buildroot=${CMAKE_BINARY_DIR}/RPM/tmp ${CMAKE_BINARY_DIR}/src/scripts/tsp.spec
+    COMMAND rpmbuild -bb --define=\"_topdir ${CMAKE_BINARY_DIR}/RPM\" --buildroot=${CMAKE_BINARY_DIR}/RPM/tmp ${CMAKE_BINARY_DIR}/src/scripts/tsp.spec
     )  
 ENDIF (UNIX)
 
diff -ru tsp-0.8.2-Source.orig/src/scripts/tsp.spec.in tsp-0.8.2-Source/src/scripts/tsp.spec.in
--- tsp-0.8.2-Source.orig/src/scripts/tsp.spec.in	2006-11-29 08:40:23.000000000 +0100
+++ tsp-0.8.2-Source/src/scripts/tsp.spec.in	2007-01-15 13:47:27.000000000 +0100
@@ -1,3 +1,4 @@
+# -*- rpm-spec -*-
 Summary:        TSP : library for a generic Transport Sampling Protocol
 Name:           tsp
 Version:        @PACKAGE_VERSION@
@@ -8,6 +9,8 @@
 Vendor:		The TSP Team Worldwide
 Source:         %{name}-%{version}-Source.tar.gz
 BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root
+Requires:	pkgconfig 
+BuildRequires:	cmake doxygen libxml2-devel glut libGLU-devel gtk2-devel
 
 %package apidoc
 Group: 	 Documentation
@@ -15,13 +18,10 @@
 %description apidoc
 The TSP API documentation as generated by doxygen
 
-%define prefix @CMAKE_INSTALL_PREFIX@
+%define prefix /opt/tsp
 %define rpmprefix $RPM_BUILD_ROOT%{prefix}
-%define srcdir /%_topdir/SOURCES
 %define tspsrcdirname %{name}-%{version}-Source
 
-#BuildRequires:  
-
 %description
 TSP : library for a generic Transport Sampling Protocol
 TSP is both a protocol and a library available in C and Java
@@ -30,66 +30,53 @@
 be it realtime or not.
 
 %prep
-rm -rf %{tspsrcdirname}
-tar xvfz %{srcdir}/%{name}-%{version}-Source.tar.gz 
+%setup -q -n %{tspsrcdirname}
 
 %build
+cd ..
+rm -rf build_tree
 mkdir build_tree
 cd build_tree
-cmake -DBUILD_API_DOC:bool=ON ../%{tspsrcdirname}
+cmake -DBUILD_API_DOC:bool=ON -DCMAKE_INSTALL_PREFIX=%{rpmprefix} ../%{tspsrcdirname}
 make
+make apidoc
   
 %install 
-cd build_tree
+cd ../build_tree
 make install
+mkdir -p $RPM_BUILD_ROOT/etc/profile.d
+mv %{rpmprefix}/scripts/tsp.profile.sh $RPM_BUILD_ROOT/etc/profile.d/tsp.sh
+mv %{rpmprefix}/scripts/tsp.profile.csh $RPM_BUILD_ROOT/etc/profile.d/tsp.csh
+mkdir -p $RPM_BUILD_ROOT/usr/lib/pkgconfig
+mv %{rpmprefix}/scripts/tsp.pc $RPM_BUILD_ROOT/usr/lib/pkgconfig
+rm -rf %{rpmprefix}/doc
+tar cf - doc/api/html | (cd %{rpmprefix}; tar xf -)
+cd %{rpmprefix}/doc/api/html
+find . -type f | xargs chmod -x
 
 %clean
 rm -rf %{tspsrcdirname}
 rm -rf build_tree
 
-%post
-if [ -d  /etc/profile.d ]; then
-  cd /etc/profile.d
-  ln -sf %{prefix}/scripts/tsp_profile.sh
-  ln -sf %{prefix}/scripts/tsp_profile.csh
-fi
-if [ -d /usr/lib/pkgconfig ]; then
-  cd /usr/lib/pkgconfig
-  ln -sf %{prefix}/scripts/tsp.pc
-fi
-
-%preun
-
-%postun
-rm -rf %{prefix}/bin
-rm -rf %{prefix}/scripts
-rm -rf %{prefix}/include
-rm -rf %{prefix}/lib
-if [ ! -r /etc/profile.d/tsp_profile.sh ]; then
-   rm /etc/profile.d/tsp_profile.sh
-fi
-if [ ! -r /etc/profile.d/tsp_profile.sh ]; then
-   rm /etc/profile.d/tsp_profile.csh
-fi
-if [ ! -r /usr/lib/pkgconfig/tsp.pc ]; then
-   rm /usr/lib/pkgconfig/tsp.pc
-fi
-
-%postun apidoc
-rm -rf %{prefix}/doc
-
 %files
-%defattr(-,root,root,0644)
+%defattr(-,root,root,-)
+%dir %{prefix}
+%dir %{prefix}/bin
+%dir %{prefix}/scripts
 %attr(0755, root, root) %{prefix}/bin/*
 %attr(0755, root, root) %{prefix}/scripts/*
-%attr(0644, root, root) %{prefix}/include/*.h
-%attr(0644, root, root) %{prefix}/lib/lib*
+%{prefix}/lib
+%{prefix}/include
+/usr/lib/pkgconfig/*
+%attr(0755, root, root) /etc/profile.d/*
 
 %files apidoc
-%defattr(-,root,root,0644)
-%attr(0644, root, root) %{prefix}/doc/api/html/*
+%defattr(-,root,root,-)
+%{prefix}/doc
 
 %changelog
+* Mon Jan 15 2007 Robert de Vries <R.de.Vries@dutchspace.nl>
+- Fix package spec
 * Mon Oct 9 2006 Erk
   - Switch to cmake build system
 * Fri Apr 28 2006 Erk
