Name: qtiplot
Summary: Data Analysis and Scientific Plotting
Version: 0.9
Release: 8%{?dist}
#>4.2 is needed for qtiplot
BuildRequires: qt4-devel >= 4.2
BuildRequires: qwt-devel
BuildRequires: qwtplot3d-qt4-devel
BuildRequires: gsl-devel
BuildRequires: muParser-devel
BuildRequires: desktop-file-utils
BuildRequires: dos2unix
#python-devel comes with sip-devel
#BuildRequires: python-devel
BuildRequires: PyQt4-devel
#sip-devel comes with PyQt4-devel
#BuildRequires: sip-devel
%if 0%{?rhel} > 4
%define epel5mode 1
%else
%define epel5mode 0
%endif
URL: http://soft.proindependent.com/qtiplot.html
License: GPLv2+
Group: Applications/Publishing
Source0: http://soft.proindependent.com/src/%{name}-%{version}.tar.bz2
Source1: http://soft.proindependent.com/misc/colormaps.tgz
Source2: %{name}.desktop
Patch0: qtiplot-path.patch
Buildroot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
%description
Scientists often need to use data analysis and plotting software.
For Windows systems there is a well known and widely used software
called Origin, which is not free, of course. The purpose of this
project is to develop a free (open source), platform independent
alternative to Origin.
%prep
%setup -q -n %{name}-%{version}
%patch0 -p1
sed -i "s\MUPARSERINC\ %{_includedir}/\1" qtiplot/qtiplot.pro
sed -i "s\QWTPLOT3DINC\ %{_includedir}/qwtplot3d\1" qtiplot/qtiplot.pro
sed -i "s\QWTINC\ %{_includedir}/qwt\1" qtiplot/qtiplot.pro
#sed -i "s\LIBORGININC\ %{_includedir}/liborigin\1" qtiplot/qtiplot.pro
sed -i "s\GSLINC\ %{_includedir}/gls\1" qtiplot/qtiplot.pro
sed -i "s\ZLIBINC\ %{_includedir}/\1" qtiplot/qtiplot.pro
sed -i "s\DOCDIR\ $RPM_BUILD_ROOT/%{_docdir}/%{name}/\1" qtiplot/qtiplot.pro
sed -i "s\BINDIR\ $RPM_BUILD_ROOT/%{_bindir}\1" qtiplot/qtiplot.pro
sed -i "s\TARGETPATH\ $RPM_BUILD_ROOT/%{_libdir}/%{name}/\1" fitPlugins/fitRational1/fitRational1.pro
sed -i "s\TARGETPATH\ $RPM_BUILD_ROOT/%{_libdir}/%{name}/\1" fitPlugins/fitRational0/fitRational0.pro
#fix default path for the Plug-Ins
sed -i "s\/usr/lib/qtiplot/plugins\%{_libdir}/%{name}\g" qtiplot/src/ApplicationWindow.cpp
#fix source files for debug package
dos2unix qtiplot/src/*
dos2unix fitPlugins/fitRational0/*
dos2unix fitPlugins/fitRational1/*
dos2unix 3rdparty/zlib123/*.c
dos2unix 3rdparty/zlib123/include/*
dos2unix 3rdparty/liborigin/*
chmod 0644 qtiplot/src/*
chmod 0644 fitPlugins/fitRational0/*
chmod 0644 fitPlugins/fitRational1/*
chmod 0644 3rdparty/zlib123/*.c
chmod 0644 3rdparty/zlib123/include/*
chmod 0644 3rdparty/liborigin/*
%build
%if %{epel5mode}
%{_libdir}/qt4/bin/qmake
%else
qmake-qt4
%endif
make %{?_smp_mflags}
lrelease-qt4 qtiplot/translations/*.ts
%install
rm -rf $RPM_BUILD_ROOT
make DESTDIR=$RPM_BUILD_ROOT install
desktop-file-install --vendor="fedora" \
--dir=${RPM_BUILD_ROOT}%{_datadir}/applications %{SOURCE2}
mkdir -p $RPM_BUILD_ROOT/%{_datadir}/qt4/translations
cp -p qtiplot/translations/*.qm $RPM_BUILD_ROOT/%{_datadir}/qt4/translations/
mkdir -p $RPM_BUILD_ROOT/%{_datadir}/%{name}
tar -xf %{SOURCE1} -C $RPM_BUILD_ROOT/%{_datadir}/%{name}
#fix permission of the doc files
chmod 0644 $RPM_BUILD_ROOT/%{_docdir}/%{name}/README.html
chmod 0644 $RPM_BUILD_ROOT/%{_docdir}/%{name}/gpl_licence.txt
#fix file encoding files
dos2unix $RPM_BUILD_ROOT/%{_docdir}/%{name}/gpl_licence.txt
#remove symlinks
rm $RPM_BUILD_ROOT/%{_libdir}/%{name}/libfitRational0.so
rm $RPM_BUILD_ROOT/%{_libdir}/%{name}/libfitRational0.so.1
rm $RPM_BUILD_ROOT/%{_libdir}/%{name}/libfitRational0.so.1.0
rm $RPM_BUILD_ROOT/%{_libdir}/%{name}/libfitRational1.so
rm $RPM_BUILD_ROOT/%{_libdir}/%{name}/libfitRational1.so.1
rm $RPM_BUILD_ROOT/%{_libdir}/%{name}/libfitRational1.so.1.0
#for the icon
mkdir -p $RPM_BUILD_ROOT/%{_datadir}/pixmaps
install -m 0644 -p qtiplot_logo.png $RPM_BUILD_ROOT/%{_datadir}/pixmaps/qtiplot_logo.png
#post -p /sbin/ldconfig
#postun -p /sbin/ldconfig
%clean
rm -rf $RPM_BUILD_ROOT
%files
%{_docdir}/%{name}
%{_libdir}/%{name}
%{_bindir}/qtiplot
%{_datadir}/applications/*
%{_datadir}/qt4/translations/*
%{_datadir}/pixmaps/*
%{_datadir}/%{name}
%changelog
* Sat Oct 20 2007 Frank Büttner <frank-buettner@gmx.net> - 0.9-8
- fix encoding of the source files for debug package
- fix permission of the source files for debug package
- add icon for the menue entry
* Sun Oct 06 2007 Frank Büttner <frank-buettner@gmx.net> - 0.9-7
- enable build for epel
- push the plug-ins to an extra directory
* Sun Oct 06 2007 Frank Büttner <frank-buettner@gmx.net> - 0.9-6
- enable parllel build
- set vendor_id at the desktop file
- remove redundant BuildRequires
- clean build root before call install
- fix permission of the doc files
- fix file encoding of the licence file
- fix spec file(use only tabs as seperator)
- fix patch to link the libfitRational1 correct
- remove unneeded symlinks
- remove unneeded ldconfig
* Sat Oct 06 2007 Frank Büttner <frank-buettner@gmx.net> - 0.9-5
- adapt it to the qwtplot3d package
- fix the path patch for 0.9 final
* Sun Sep 30 2007 Frank Büttner <frank-buettner@gmx.net> - 0.9-4
- update to the final 0.9
- enable Python support
- fix spec file
* Sat Jun 09 2007 Frank Büttner <frank-buettner@gmx.net> - 0.9_rc1-3%{?dist}
- split to doc part to an extra package
* Mon May 21 2007 Frank Büttner <frank-buettner@gmx.net> - 0.9_rc1-2%{?dist}
- split doc package as noarch rpm
* Wed May 16 2007 Frank Büttner <frank-buettner@gmx.net> - 0.9_rc1-1%{?dist}
- start