Blob Blame History Raw
Name:		qtiplot
Summary:	Data Analysis and Scientific Plotting
Version:	0.9.7.11
Release:	5%{?dist}
BuildRequires:	qt4-devel
BuildRequires:	liborigin2-devel
BuildRequires:	QTeXEngine-devel
BuildRequires:	muParser-devel
BuildRequires:	gsl-devel
BuildRequires:	boost-devel
#use local copy till upstream catches up
#BuildRequires:	qwt-devel
#BuildRequires:	qwtplot3d-qt4-devel
#BuildRequires:	libxls-devel
BuildRequires:	quazip-devel
BuildRequires:	libpng-devel
#python-devel comes with sip-devel
#BuildRequires:	python-devel
BuildRequires:	PyQt4-devel 
#sip-devel comes with PyQt4-devel
#BuildRequires:	sip-devel
BuildRequires:	docbook-utils
BuildRequires:	docbook-style-xsl
BuildRequires:	dblatex
BuildRequires:	desktop-file-utils
BuildRequires:	dos2unix

URL:		http://soft.proindependent.com/qtiplot.html
License:	GPLv2+
Group:		Applications/Publishing
Source0:	http://download.berlios.de/qtiplot/%{name}-%{version}.tar.bz2
Source1:	http://soft.proindependent.com/misc/colormaps.tgz
Source2:	%{name}.desktop
Source3:	%{name}.xml
#fix build.conf to use system-wide libs and enable CustomInstall
Patch0:		0-build.conf.patch
#fix manual building
Patch1:		1-manual.patch
#fix build warning of Note.cpp
Patch2:		2-nonvoid-return.patch
#fix installation paths of fitPlugins
Patch3:		3-fitPlugins.patch
#fix installation paths and enable building of translation files
Patch4:		4-install-path.patch
#fix origin.pri to use system-wide liborigin2
Patch5:		5-liborigin2.patch
#fix qtiplot.pro to use system-wide QTeXEngine
Patch6:		6-QTeXEngine.patch
Buildroot:	%{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
Requires(post):		shared-mime-info
Requires(post):		desktop-file-utils 
Requires(postun):	shared-mime-info
Requires(postun):	desktop-file-utils

%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.

%package doc

Summary:		Documentation for %{name}
Group:			Documentation
Requires:		%{name} = %{version}-%{release}
BuildArch:		noarch 

%description doc
The %{name}-doc package contains documentation for the %{name}.

%prep
%setup -q -n %{name}-%{version}
%patch0 -p1
%patch1 -p1
%patch2 -p1
%patch3 -p1
%patch4 -p1
%patch5 -p1
%patch6 -p1

#use system-wide libs of liborigin2 and QTeXEngine
rm -rf 3rdparty/liborigin 3rdparty/QTeXEngine
#fix docbook to adapt different versions of fedora
sed -i "s/VER-REL/`rpm -q docbook-dtds|sed "s/^[^0-9]*//;s/\.noarch//;\
s/\./\\\./g"`/" manual/docbook-en/index.docbook 
#fix default path for fitPlugins
sed -i "s\/usr/lib/qtiplot/plugins\%{_libdir}/%{name}/plugins\g" \
	qtiplot/src/core/ApplicationWindow.cpp
#fix source files for debug package
find %{_builddir}/%{name}-%{version} -name '*.h' -exec dos2unix {} \;
find %{_builddir}/%{name}-%{version} -name '*.hh' -exec dos2unix {} \;
find %{_builddir}/%{name}-%{version} -name '*.hpp' -exec dos2unix {} \;
find %{_builddir}/%{name}-%{version} -name '*.c' -exec dos2unix {} \;
find %{_builddir}/%{name}-%{version} -name '*.cc' -exec dos2unix {} \;
find %{_builddir}/%{name}-%{version} -name '*.cpp' -exec dos2unix {} \;
find %{_builddir}/%{name}-%{version} -type d -exec chmod 0755 {} \;
find %{_builddir}/%{name}-%{version} -type f -exec chmod 0644 {} \;

%build
cp -p build.conf.example build.conf
export PATH=%{_qt4_bindir}:$PATH
%_qt4_qmake LIB=%{_libdir} QTIDOCDIR=%{_docdir}/%{name}-%{version}
#do not build in parallel - there are race conditions in 
#qmake-generated makefiles
make
#fix file encoding files 
#dos2unix gpl_licence.txt
sed -i 's/\r//' gpl_licence.txt
dos2unix qtiplot/qti_wordlist.txt
dos2unix qtiplot/qtiplotrc.py
dos2unix qtiplot/qtiUtil.py
dos2unix manual/html/qtiplot*

%install
rm -rf %{buildroot}
make INSTALL="install -p" INSTALL_ROOT=%{buildroot} install
#remove local copy qwt
rm -rf %{buildroot}%{_prefix}/local
desktop-file-install --vendor="fedora" \
			--dir=%{buildroot}%{_datadir}/applications %{SOURCE2}
mkdir -p %{buildroot}%{_datadir}/%{name}
tar -xf %{SOURCE1} -C %{buildroot}%{_datadir}/%{name}

#remove symlinks
find %{buildroot}%{_libdir}/%{name} -type l -exec rm {} \;

#for the icon
mkdir -p %{buildroot}%{_datadir}/pixmaps
install -m 0644 -p qtiplot_logo.png %{buildroot}%{_datadir}/pixmaps/qtiplot.png

#add mime-info
mkdir -p %{buildroot}%{_datadir}/mime/packages
install -m 0644 -p %{SOURCE3} %{buildroot}%{_datadir}/mime/packages/%{name}.xml

%post
umask 022
update-mime-database %{_datadir}/mime &> /dev/null || :
update-desktop-database &> /dev/null ||:
/sbin/ldconfig

%postun
umask 022
update-mime-database %{_datadir}/mime &> /dev/null || :
update-desktop-database &> /dev/null ||:
/sbin/ldconfig

%clean
rm -rf %{buildroot}

%files
%defattr(-,root,root,-)
%dir %{_datadir}/%{name}
%dir %{_libdir}/%{name}
%dir %{_docdir}/%{name}-%{version}
%{_libdir}/%{name}/*
%{_datadir}/%{name}/*
%{_docdir}/%{name}-%{version}/README.html
%{_docdir}/%{name}-%{version}/gpl_licence.txt
%{_bindir}/%{name}
%{_datadir}/applications/*
%{_datadir}/pixmaps/*
%{_datadir}/mime/packages/*
%{_mandir}/man1/%{name}.1*

%files doc
%defattr(-,root,root,-)
%dir %{_docdir}/%{name}-%{version}/manual
%{_docdir}/%{name}-%{version}/manual/*


%changelog
* Sat Feb 06 2010 Frank Büttner <frank-buettner@gmx.net> - 0.9.7.11-4
 - add mising file to mock

* Wed Feb  3 2010 Chen Lei <supercyper@163.com> - 0.9.7.11-4
 - enable importing of ODF spreadsheet files

* Fri Jan 29 2010 Chen Lei <supercyper@163.com> - 0.9.7.11-3
 - fixed desktop mime field

* Fri Jan 29 2010 Chen Lei <supercyper@163.com> - 0.9.7.11-2
 - add mime-info

* Sat Jan 23 2010 Chen Lei <supercyper@163.com> - 0.9.7.11-1
 - upstream to 0.9.7.11

* Sat Jan 10 2009 Frank Büttner <frank-buettner@gmx.net> - 0.9.7.4-8
 - fix dos2unix