Blob Blame Raw
%{!?build_mpi:%define build_mpi 1}
%define pv_maj 3
%define pv_min 6
%define pv_patch 2
%define pv_majmin %{pv_maj}.%{pv_min}

Name:           paraview
Version:        %{pv_majmin}.%{pv_patch}
Release:        1%{?dist}
Summary:        Parallel visualization application

Group:          Applications/Engineering
License:        BSD
URL:            http://www.paraview.org/
Source0:        http://www.paraview.org/files/v%{pv_majmin}/paraview-%{version}.tar.gz
Source1:        paraview_22x22.png
Source2:        paraview.xml
#Don't try to copy Qt libraries into paraview directory
Patch2:         paraview-3.6.0-install.patch
#Move pqClient.adp into %{_datadir}/paraview
Patch3:         paraview-3.6.1-doc.patch
#Reported upstream: http://public.kitware.com/Bug/view.php?id=9458
#Look for assistant_adp instead of assistant
Patch4:         paraview-3.6.0-assistant-qt4.patch
#Reported upstream: http://public.kitware.com/Bug/view.php?id=7022
#Installs PointSpriteDemo into incorrect location, remove install for now
#Reported upstream: http://public.kitware.com/mantis/view.php?id=9292
Patch5:         paraview-3.6.1-demo.patch
#Install plugins into %{_libdir}/paraview/plugins instead of %{_bindir}/plugins
#Reported upstream: http://public.kitware.com/mantis/view.php?id=9293
Patch6:         paraview-3.6.1-plugins.patch
#Reported upstream: http://public.kitware.com/mantis/view.php?id=7023
Patch7:         paraview-3.2.2-hdf5.patch
Patch8:         paraview-3.4.0-hdf5-1.8.2.patch

BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)

BuildRequires:  cmake
%if %{build_mpi}
BuildRequires:  openmpi-devel
%endif
BuildRequires:  qt4-devel, mesa-libOSMesa-devel
BuildRequires:  python-devel, tk-devel, hdf5-devel
BuildRequires:  freetype-devel, libtiff-devel, zlib-devel
BuildRequires:  expat-devel
BuildRequires:  /usr/bin/desktop-file-install
BuildRequires:  doxygen, graphviz
BuildRequires:  readline-devel
BuildRequires:  openssl-devel
BuildRequires:  gnuplot
BuildRequires:  wget
BuildRequires:  boost-devel
Requires:       %{name}-data = %{version}-%{release}
Requires:       %{name}-doc = %{version}-%{release}
Requires:       qt4-assistant
Requires(post):   /usr/bin/update-desktop-database
Requires(postun): /usr/bin/update-desktop-database
Obsoletes:      paraview-demos < %{version}-%{release}
Provides:       paraview-demos = %{version}-%{release}

#VTK_USE_RPATH=OFF needed to build everything
# This is still an alpha feature and does not install properly -
#  libOverViewCora.so is not installed
#	-DPARAVIEW_BUILD_OverView:BOOL=ON 
# These require OverView
#	-DPARAVIEW_BUILD_PLUGIN_ClientGeoView:BOOL=ON
#	-DPARAVIEW_BUILD_PLUGIN_ClientGeoView2D:BOOL=ON
#	-DPARAVIEW_BUILD_PLUGIN_ClientGraphView:BOOL=ON \\\
#	-DPARAVIEW_BUILD_PLUGIN_ClientHierarchyView:BOOL=ON \\\
#	-DPARAVIEW_BUILD_PLUGIN_ClientRecordView:BOOL=ON \\\
#	-DPARAVIEW_BUILD_PLUGIN_ClientTableView:BOOL=ON \\\
#	-DPARAVIEW_BUILD_PLUGIN_ClientTreeView:BOOL=ON \\\
#	-DPARAVIEW_BUILD_PLUGIN_ClientGraphViewFrame:BOOL=ON
#	-DPARAVIEW_BUILD_PLUGIN_CommonToolbar:BOOL=ON \\\
#	-DPARAVIEW_BUILD_PLUGIN_GraphLayoutFilterPanel:BOOL=ON \\\
#	-DPARAVIEW_BUILD_PLUGIN_StatisticsToolbar:BOOL=ON
#	-DPARAVIEW_BUILD_PLUGIN_SQLDatabaseGraphSourcePanel:BOOL=ON \\\
#	-DPARAVIEW_BUILD_PLUGIN_SQLDatabaseTableSourcePanel:BOOL=ON \\\
#	-DPARAVIEW_BUILD_PLUGIN_SplitTableFieldPanel:BOOL=ON \\\
#	-DPARAVIEW_BUILD_PLUGIN_TableToGraphPanel:BOOL=ON \\\
#	-DPARAVIEW_BUILD_PLUGIN_TableToSparseArrayPanel:BOOL=ON \\\
#	-DPARAVIEW_BUILD_PLUGIN_ThresholdTablePanel:BOOL=ON
%define paraview_cmake_options \\\
        -DCMAKE_CXX_COMPILER:FILEPATH=$CXX \\\
        -DCMAKE_C_COMPILER:FILEPATH=$CC \\\
        -DTCL_LIBRARY:PATH=tcl \\\
        -DTK_LIBRARY:PATH=tk \\\
	-DPARAVIEW_BUILD_StreamingParaView:BOOL=ON \\\
	-DPARAVIEW_BUILD_PLUGIN_Streaming:BOOL=ON \\\
	-DPARAVIEW_BUILD_PLUGIN_Array:BOOL=ON \\\
	-DPARAVIEW_BUILD_PLUGIN_CosmoFilters:BOOL=ON \\\
	-DPARAVIEW_BUILD_PLUGIN_Infovis:BOOL=ON \\\
	-DPARAVIEW_BUILD_PLUGIN_netCDFReaders:BOOL=ON \\\
	-DPARAVIEW_BUILD_PLUGIN_pvblot:BOOL=ON \\\
	-DPARAVIEW_BUILD_PLUGIN_SLACTools:BOOL=ON \\\
	-DPARAVIEW_BUILD_PLUGIN_VisItReaderPlugin:BOOL=OFF \\\
        -DPARAVIEW_ENABLE_PYTHON:BOOL=ON \\\
        -DPARAVIEW_USE_SYSTEM_HDF5:BOOL=ON \\\
        -DVTK_OPENGL_HAS_OSMESA:BOOL=ON \\\
        -DVTK_USE_BOOST:BOOL=ON \\\
        -DVTK_USE_INFOVIS:BOOL=OFF \\\
        -DVTK_USE_N_WAY_ARRAYS:BOOL=ON \\\
        -DVTK_USE_RPATH:BOOL=OFF \\\
        -DVTK_USE_SYSTEM_EXPAT:BOOL=ON \\\
        -DVTK_USE_SYSTEM_FREETYPE:BOOL=ON \\\
        -DVTK_USE_SYSTEM_JPEG:BOOL=ON \\\
        -DVTK_USE_SYSTEM_PNG:BOOL=ON \\\
        -DVTK_USE_SYSTEM_TIFF:BOOL=ON \\\
        -DVTK_USE_SYSTEM_ZLIB:BOOL=ON \\\
        -DBUILD_DOCUMENTATION:BOOL=ON \\\
        -DBUILD_EXAMPLES:BOOL=ON

%description
ParaView is an application designed with the need to visualize large data
sets in mind. The goals of the ParaView project include the following:

    * Develop an open-source, multi-platform visualization application.
    * Support distributed computation models to process large data sets.
    * Create an open, flexible, and intuitive user interface.
    * Develop an extensible architecture based on open standards.

ParaView runs on distributed and shared memory parallel as well as single
processor systems and has been successfully tested on Windows, Linux and
various Unix workstations and clusters. Under the hood, ParaView uses the
Visualization Toolkit as the data processing and rendering engine and has a
user interface written using a unique blend of Tcl/Tk and C++.

NOTE: The version in this package has NOT been compiled with MPI support.
Install the paraview-mpi package to get MPI support.


%if %{build_mpi}
%package        mpi
Summary:        Parallel visualization application
Group:          Applications/Engineering
Requires:       %{name}-data = %{version}-%{release}
Requires:       openmpi
Requires(post):   /usr/bin/update-desktop-database
Requires(postun): /usr/bin/update-desktop-database

%description    mpi
This package contains copies of the ParaView server binaries compiled with
OpenMPI.  These are named pvserver-mpi, pvbatch-mpi, etc.
%endif

%package        data
Summary:        Data files for ParaView
Group:          Applications/Engineering
Requires:       %{name} = %{version}-%{release}
Requires(post):   /usr/bin/update-mime-database
Requires(postun): /usr/bin/update-mime-database
BuildArch:      noarch

%description    data
%{summary}.


%package        devel
Summary:        Development files for ParaView
Group:          Applications/Engineering
Requires:       %{name} = %{version}-%{release}
Obsoletes:      %{name}-mpi-devel < %{version}-%{release}
Provides:       %{name}-mpi-devel = %{version}-%{release}

%description    devel
%{summary}.


%package        doc
Summary:        Documentation files for ParaView
Group:          Applications/Engineering
Requires:       %{name} = %{version}-%{release}
Requires(post):   /usr/bin/update-mime-database
Requires(postun): /usr/bin/update-mime-database
BuildArch:      noarch

%description    doc
%{summary}.


%prep
%setup -q -n ParaView3
%patch2 -p1 -b .install
%patch3 -p1 -b .doc
%patch4 -p1 -b .assistant-qt4
%patch5 -p1 -b .demo
%patch6 -p1 -b .plugins
%patch7 -p1 -b .hdf5
%patch8 -p1 -b .hdf5-1.8.2
#Remove included hdf5 just to be sure
rm -r Utilities/hdf5


%build
rm -rf fedora fedora-mpi
mkdir fedora
pushd fedora
export CC='gcc'
export CXX='g++'
export MAKE='make'
export CFLAGS="$RPM_OPT_FLAGS -DH5_USE_16_API"
export CXXFLAGS="$RPM_OPT_FLAGS -DH5_USE_16_API"
%cmake .. \
        -DPV_INSTALL_LIB_DIR:PATH=%{_lib}/paraview \
	%{paraview_cmake_options}
##Need to run cmake twice to get MPI headers into VTK/Parallel build config
cmake ..
make VERBOSE=1 %{?_smp_mflags}
popd
%if %{build_mpi}
mkdir fedora-mpi
pushd fedora-mpi
export CC='gcc'
export CXX='g++'
export MAKE='make'
export CFLAGS="$RPM_OPT_FLAGS -DH5_USE_16_API"
export CXXFLAGS="$RPM_OPT_FLAGS -DH5_USE_16_API"
%cmake .. \
        -DPV_INSTALL_LIB_DIR:PATH=%{_lib}/paraview-mpi \
        -DPARAVIEW_USE_MPI:BOOL=ON \
        -DICET_BUILD_TESTING:BOOL=ON \
	-DMPI_COMPILER:FILEPATH=%{_libdir}/openmpi/bin/mpicxx \
	%{paraview_cmake_options}
#Need to run cmake twice to get MPI headers into VTK/Parallel build config
cmake ..
make VERBOSE=1 %{?_smp_mflags}
popd
%endif

%install
rm -rf $RPM_BUILD_ROOT

#Fix permissions
find . \( -name \*.txt -o -name \*.xml -o -name '*.[ch]' -o -name '*.[ch][px][px]' \) -print0 | xargs -0 chmod -x

# Create some needed directories
install -d $RPM_BUILD_ROOT%{_datadir}/applications
install -d $RPM_BUILD_ROOT%{_datadir}/paraview
install -d $RPM_BUILD_ROOT%{_datadir}/pixmaps
install -m644 %SOURCE1 $RPM_BUILD_ROOT%{_datadir}/pixmaps
install -d $RPM_BUILD_ROOT%{_datadir}/mime/packages
install -m644 %SOURCE2 $RPM_BUILD_ROOT%{_datadir}/mime/packages

%if %{build_mpi}
# Install mpi version
pushd fedora-mpi
make install DESTDIR=$RPM_BUILD_ROOT

#Don't ship copy of Qt assisstant
rm $RPM_BUILD_ROOT%{_bindir}/assistant \
   $RPM_BUILD_ROOT%{_libdir}/paraview-mpi/assistant-real
#Cleanup %{_bindir}
pushd $RPM_BUILD_ROOT/%{_bindir}
#Don't need mpi versions of these
rm lproj paraview pvblot pvpython pvTestDriver vtkSMExtractDocumentation
#Move the remaining mpi binaries out of the way
for f in *
do
   mv $f ${f}-mpi
done
popd

#Remove mpi copy of includes, man pages, and documentation
rm -rf $RPM_BUILD_ROOT/%{_includedir}/paraview-%{pv_majmin}
rm -rf $RPM_BUILD_ROOT%{_mandir}
#rm -r $RPM_BUILD_ROOT%{_libdir}/paraview-mpi/{doc,Documentation,pqClient.adp}
popd
%endif

#Install the normal version
pushd fedora
make install DESTDIR=$RPM_BUILD_ROOT

#Create desktop file
cat > paraview.desktop <<EOF
[Desktop Entry]
Encoding=UTF-8
Name=ParaView Viewer
GenericName=Data Viewer
Comment=ParaView allows viewing of large data sets
Type=Application
Terminal=false
Icon=paraview_22x22
MimeType=application/x-paraview;
Categories=Application;Graphics;
Exec=paraview
EOF

desktop-file-install --vendor=fedora \
       --add-category=X-Fedora \
       --dir %{buildroot}%{_datadir}/applications/ \
       paraview.desktop

popd

#Don't ship the VTK Qt Designer plugin
rm -r $RPM_BUILD_ROOT/usr/plugins

#Don't ship copy of Qt assisstant
rm $RPM_BUILD_ROOT%{_bindir}/assistant \
   $RPM_BUILD_ROOT%{_libdir}/paraview/assistant-real
#Don't ship lproj - provided by vtk
rm $RPM_BUILD_ROOT%{_bindir}/lproj

#Move the documentation
#mv $RPM_BUILD_ROOT%{_libdir}/paraview/{Documentation,pqClient.adp} \
#   $RPM_BUILD_ROOT%{_datadir}/paraview/


%clean
rm -rf $RPM_BUILD_ROOT


%post
/sbin/ldconfig
update-desktop-database &> /dev/null ||:


%postun
/sbin/ldconfig
update-desktop-database &> /dev/null ||:


%post   data
update-mime-database %{_datadir}/mime &> /dev/null || :

%postun data
update-mime-database %{_datadir}/mime &> /dev/null || :


%files
%defattr(-,root,root,-)
%doc License_v1.2.txt
%{_bindir}/paraview
%{_bindir}/pvbatch
%{_bindir}/pvblot
%{_bindir}/pvdataserver
%{_bindir}/pvpython
%{_bindir}/pvrenderserver
%{_bindir}/pvserver
%{_bindir}/pvTestDriver
%{_bindir}/vtkSMExtractDocumentation
%{_libdir}/paraview/
%exclude %{_libdir}/paraview/doc/
%dir %{_datadir}/paraview
%doc %{_datadir}/paraview/about.html

%if %{build_mpi}
%files mpi
%defattr(-,root,root,-)
%doc License_v1.2.txt
%{_bindir}/pvbatch-mpi
%{_bindir}/pvdataserver-mpi
%{_bindir}/pvrenderserver-mpi
%{_bindir}/pvserver-mpi
%{_libdir}/paraview-mpi/
%endif


%files data
%defattr(-,root,root,-)
%{_datadir}/applications/fedora-paraview.desktop
%{_datadir}/pixmaps/paraview_22x22.png
%{_datadir}/mime/packages/paraview.xml


%files devel
%defattr(-,root,root,-)
%{_includedir}/paraview-%{pv_majmin}/
%doc %{_libdir}/paraview/doc/


%files doc
%defattr(-,root,root,-)
%doc %{_datadir}/paraview/pqClient.adp
%doc %{_datadir}/paraview/pqClientDocFinder.txt
%doc %{_datadir}/paraview/Documentation/


%changelog
* Mon Jan 4 2010 Orion Poplawski <orion@cora.nwra.com> - 3.6.2-1
- Update to 3.6.2

* Thu Nov 19 2009 Orion Poplawski <orion@cora.nwra.com> - 3.6.1-7
- New location for openmpi (fixes FTBFS bug #539179)

* Mon Aug 31 2009 Orion Poplawski <orion@cora.nwra.com> - 3.6.1-6
- Don't ship lproj, conflicts with vtk

* Thu Aug 27 2009 Orion Poplawski <orion@cora.nwra.com> - 3.6.1-5
- Specify PV_INSTALL_LIB_DIR as relative path, drop install prefix patch
- Update assitant patch to use assistant_adp, don't ship assistant-real

* Wed Aug 26 2009 Orion Poplawski <orion@cora.nwra.com> - 3.6.1-4
- Disable building various plugins that need OverView

* Tue Aug 25 2009 Orion Poplawski <orion@cora.nwra.com> - 3.6.1-3
- Disable building OverView - not ready yet

* Fri Aug 21 2009 Tomas Mraz <tmraz@redhat.com> - 3.6.1-2
- rebuilt with new openssl

* Wed Jul 22 2009 Orion Poplawski <orion@cora.nwra.com> - 3.6.1-1
- Update to 3.6.1

* Thu May 7 2009 Orion Poplawski <orion@cora.nwra.com> - 3.4.0-5
- Update doc patch to look for help file in the right place (bug #499273)

* Tue Feb 24 2009 Orion Poplawski <orion@cora.nwra.com> - 3.4.0-4
- Rebuild with hdf5 1.8.2, gcc 4.4.0
- Update hdf5-1.8 patch to work with hdf5 1.8.2
- Add patch to allow build with Qt 4.5
- Move documentation into noarch sub-package

* Sat Jan 17 2009 Tomas Mraz <tmraz@redhat.com> - 3.4.0-3
- rebuild with new openssl

* Sun Nov 30 2008 Ignacio Vazquez-Abrams <ivazqueznet+rpm@gmail.com> - 3.4.0-2
- Rebuild for Python 2.6

* Fri Oct 17 2008 Orion Poplawski <orion@cora.nwra.com> - 3.4.0-1
- Update to 3.4.0 final

* Thu Oct 2 2008 Orion Poplawski <orion@cora.nwra.com> - 3.4.0-0.20081002.1
- Update 3.4.0 CVS snapshot
- Update gcc43 patch
- Drop qt patch, upstream now allows compiling against Qt 4.4.*

* Mon Aug 11 2008 Orion Poplawski <orion@cora.nwra.com> - 3.3.1-0.20080811.1
- Update 3.3.1 CVS snapshot
- Update hdf5 patch to drop upstreamed changes
- Fix mpi build (bug #450598)
- Use rpath instead of ls.so conf files so mpi and non-mpi can be installed at
  the same time
- mpi package now just ships mpi versions of the server components
- Drop useless mpi-devel subpackage
- Update hdf5 patch to fix H5pubconf.h -> H5public.h usage

* Wed May 20 2008 - Orion Poplawski <orion@cora.nwra.com> - 3.3.0-0.20080520.1
- Update to 3.3.0 CVS snapshot
- Update qt and gcc43 patches, drop unneeded patches
- Add openssl-devel, gnuplot, and wget BRs
- Update license text filename
- Set VTK_USE_RPATH to off, needed with development versions
- Run ctest in %%check - still need to exclude more tests

* Wed Mar 5 2008 - Orion Poplawski <orion@cora.nwra.com> - 3.2.1-5
- Rebuild for hdf5 1.8.0 using compatability API define and new patch

* Mon Feb 18 2008 - Orion Poplawski <orion@cora.nwra.com> - 3.2.1-4
- Add patch to compile with gcc 4.3

* Fri Jan 18 2008 - Orion Poplawski <orion@cora.nwra.com> - 3.2.1-3
- Add patch to fix parallel make
- Obsolete demos package (bug #428528)

* Tue Dec 18 2007 - Orion Poplawski <orion@cora.nwra.com> - 3.2.1-2
- Name ld.so.conf.d file with .conf extension
- Drop parallel make for now

* Mon Dec 03 2007 - Orion Poplawski <orion@cora.nwra.com> - 3.2.1-1
- Update to 3.2.1
- Use macros for version numbers
- Add patches to fix documentation install location and use assistant-qt4,
  not install copies of Qt libraries, and not use rpath.
- Install ld.so.conf.d file
- Fixup desktop files

* Thu Aug 23 2007 - Orion Poplawski <orion@cora.nwra.com> - 3.0.2-2
- Update license tag to BSD
- Fix make %%{_smp_mflags}
- Rebuild for ppc32

* Wed Jul 11 2007 - Orion Poplawski <orion@cora.nwra.com> - 3.0.2-1
- Update to 3.0.2
- Turn mpi build back on
- Add devel packages
- Remove demo package no longer in upstream
- Use cmake macros

* Thu Mar 08 2007 - Orion Poplawski <orion@cora.nwra.com> - 2.4.4-6
- Don't build mpi version until upstream fixes the build system

* Fri Dec 22 2006 - Orion Poplawski <orion@cora.nwra.com> - 2.4.4-5
- Fix .so permissions
- Patch for const issue
- Patch for new cmake
- Build with openmpi

* Thu Dec 14 2006 - Jef Spaleta <jspaleta@gmail.com> - 2.4.4-4
- Bump and build for python 2.5

* Fri Oct  6 2006 - Orion Poplawski <orion@cora.nwra.com> - 2.4.4-3
- Install needed python libraries to get around make install bug

* Wed Oct  4 2006 - Orion Poplawski <orion@cora.nwra.com> - 2.4.4-2
- Re-enable OSMESA support for FC6
- Enable python wrapping

* Fri Sep 15 2006 - Orion Poplawski <orion@cora.nwra.com> - 2.4.4-1
- Update to 2.4.4

* Thu Jun 29 2006 - Orion Poplawski <orion@cora.nwra.com> - 2.4.3-8
- No OSMesa support in FC5
- Make data sub-package pull in main package (bug #193837)
- A patch from CVS to fix vtkXOpenRenderWindow.cxx
- Need lam-devel for FC6

* Fri Apr 21 2006 - Orion Poplawski <orion@cora.nwra.com> - 2.4.3-7
- Re-enable ppc

* Mon Apr 17 2006 - Orion Poplawski <orion@cora.nwra.com> - 2.4.3-6
- Exclude ppc due to gcc bug #189160

* Wed Apr 12 2006 - Orion Poplawski <orion@cora.nwra.com> - 2.4.3-5
- Cleanup permissions

* Mon Apr 10 2006 - Orion Poplawski <orion@cora.nwra.com> - 2.4.3-4
- Add icon and cleanup desktop file

* Mon Apr 10 2006 - Orion Poplawski <orion@cora.nwra.com> - 2.4.3-3
- Add VTK_USE_MANGLE_MESA for off screen rendering
- Cleanup source permisions
- Add an initial .desktop file
- Make requirement on -data specific to version
- Don't package Ice-T man pages and cmake files

* Thu Apr  6 2006 - Orion Poplawski <orion@cora.nwra.com> - 2.4.3-2
- Add mpi version

* Tue Apr  4 2006 - Orion Poplawski <orion@cora.nwra.com> - 2.4.3-1
- Initial Fedora Extras version