Name: qtiplot
Summary: Data Analysis and Scientific Plotting
Version: 0.9.7.4
Release: 9%{?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
%if 0%{?rhel} > 4
%define withPython 0
%define epel5mode 1
%else
%define withPython 1
%define epel5mode 0
%endif
%if %{withPython}
#python-devel comes with sip-devel
#BuildRequires: python-devel
BuildRequires: PyQt4-devel
#sip-devel comes with PyQt4-devel
#BuildRequires: sip-devel
%endif
URL: http://soft.proindependent.com/qtiplot.html
License: GPLv2+
Group: Applications/Publishing
Source0: http://soft.proindependent.com/src/%{name}-%{version}.tar.bz2
#Source0: http://soft.proindependent.com/src/%{name}-0.9.7.4.tar.bz2
Source1: http://soft.proindependent.com/misc/colormaps.tgz
Source2: %{name}.desktop
Patch0: qtiplot-path.patch
#Patch1: qtiplot-includes.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
%if %{withPython}
echo "Build with Python"
%else
echo "Build without Python"
sed -i "s/SCRIPTING_LANGS\ =+\ Python/#/1" qtiplot/qtiplot.pro
%endif
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/core/ApplicationWindow.cpp
#fix source files for debug package
dos2unix qtiplot/src/analysis/*.h
dos2unix qtiplot/src/analysis/dialogs/*.h
dos2unix qtiplot/src/core/*.h
dos2unix qtiplot/src/matrix/*
dos2unix qtiplot/src/origin/*.h
dos2unix qtiplot/src/plot2D/*.h
dos2unix qtiplot/src/plot2D/dialogs/*.h
dos2unix qtiplot/src/plot3D/*.h
dos2unix qtiplot/src/scripting/*.h
dos2unix qtiplot/src/table/*.h
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
* Wed Feb 25 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.9.7.4-9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild
* Sat Jan 10 2009 Frank Büttner <frank-buettner@gmx.net> - 0.9.7.4-8
- fix dos2unix
* Sat Jan 10 2009 Frank Büttner <frank-buettner@gmx.net> - 0.9.7.4-7
- fix dos2unix
* Sat Jan 10 2009 Frank Büttner <frank-buettner@gmx.net> - 0.9.7.4-6
- fix dos2unix
* Sat Jan 10 2009 Frank Büttner <frank-buettner@gmx.net> - 0.9.7.4-5
- fix dos2unix
* Sat Jan 10 2009 Frank Büttner <frank-buettner@gmx.net> - 0.9.7.4-4
- fix sed
* Sat Jan 10 2009 Frank Büttner <frank-buettner@gmx.net> - 0.9.7.4-3
- fix the patch files
* Sat Jan 10 2009 Frank Büttner <frank-buettner@gmx.net> - 0.9.7.4-2
- dummy for koji
* Sat Jan 10 2009 Frank Büttner <frank-buettner@gmx.net> - 0.9.7.4-1
- update to 0.9.7.4
* Thu Jan 23 2008 Frank Büttner <frank-buettner@gmx.net> - 0.9.3rc2-1
- update to 0.9.3rc2
* Sat Nov 17 2007 Frank Büttner <frank-buettner@gmx.net> - 0.9.1-1
- update to 0.9.1
- disable Python support on EPEL because Qt Python support is broken
* 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