vtk/vtk.spec

419 lines
12 KiB
RPMSpec

%define qtdir %{_libdir}/qt4
Name: vtk
Summary: The Visualization Toolkit - A high level 3D visualization library
Version: 5.4.2
Release: 1
License: BSD
Group: System/Libraries
URL: http://www.vtk.org
Source0: vtk-%{version}.tar.gz
Patch0: vtk-5.4.2-pythondestdir.patch
Patch1: vtk-5.4.2-string-len.patch
%if 0%{?suse_version} >= 1130
Patch2: vtk-libpng-1.4.0.patch
%endif
Buildroot: %{_tmppath}/%{name}-%{version}-%{release}-root
BuildRequires: cmake tcl-devel tk-devel libqt4-devel python-devel
BuildRequires: libexpat-devel libjpeg-devel libpng-devel freetype2-devel
BuildRequires: libtiff-devel zlib-devel fdupes doxygen graphviz gnuplot
# tar-1.14.90+ uses --strip-components option
BuildRequires: tar > 1.14.90
BuildRequires: chrpath
%if 0%{?suse_version} >= 1110
BuildRequires: freeglut-devel
%endif
BuildRequires: java-devel
%description
VTK is an open-source software system for image processing, 3D
graphics, volume rendering and visualization. VTK includes many
advanced algorithms (e.g., surface reconstruction, implicit modelling,
decimation) and rendering techniques (e.g., hardware-accelerated
volume rendering, LOD control)
%package devel
Summary: VTK header files for building C++ code
Requires: vtk = %{version}
Requires: python-vtk
Requires: vtk-qt
Requires: vtk-tcl
Group: Development/Libraries
%description devel
This provides the VTK header files required to compile C++ programs that
use VTK to do 3D visualisation
%package tcl
Summary: Tcl bindings for VTK
Requires: vtk = %{version}
Group: System/Libraries
%description tcl
tcl bindings for VTK
%package -n python-vtk
Summary: Python bindings for VTK
Requires: vtk = %{version}
Group: System/Libraries
Provides: vtk-python
%description -n python-vtk
python bindings for VTK
%package java
Summary: Java VTK bindings
Requires: vtk = %{version}
Group: Development/Libraries/Java
%description java
The Java-bindings for VTK
%package qt
Summary: QT VTK widget
Requires: vtk = %{version}
# do not neeeded to call it, rpm take care of it
#Requires: libqt4
Group: Development/Libraries/C and C++
%description qt
Qt VTK widget
%package examples
Summary: Examples for VTK
Requires: vtk = %{version}
Group: Productivity/Scientific/Other
%description examples
This package contains many well-commented examples showing how to use
VTK. Examples are available in the C++, Tcl, Python and Java
programming languages
%package testing-progs
Summary: Testing programs for VTK
Requires: %{name} = %{version}, vtkdata = %{version}
Group: Productivity/Scientific/Other
%description testing-progs
Testing programs for VTK
%debug_package
%prep
%setup -n VTK -q
%patch0 -p1
%patch1 -p1
%if 0%{?suse_version} >= 1130
%patch2 -p1
%endif
# Replace relative path ../../../VTKData with %{_datadir}/vtkdata
# otherwise it will break on symlinks.
grep -rl '\.\./\.\./\.\./\.\./VTKData' . | xargs \
perl -pi -e's,\.\./\.\./\.\./\.\./VTKData,%{_datadir}/%{name}data,g'
%build
export CFLAGS="$RPM_OPT_FLAGS"
export CXXFLAGS="$RPM_OPT_FLAGS"
cmake . \
-DDESIRED_QT_VERSION=4 \
-DCMAKE_C_FLAGS:STRING="$RPM_OPT_FLAGS" \
-DCMAKE_CXX_FLAGS:STRING="$RPM_OPT_FLAGS" \
-DCMAKE_INSTALL_PREFIX:PATH=$RPM_BUILD_ROOT \
-DVTK_INSTALL_BIN_DIR:PATH=%{_bindir} \
-DVTK_INSTALL_INCLUDE_DIR:PATH=%{_includedir}/%{name} \
-DVTK_INSTALL_LIB_DIR:PATH=%{_libdir} \
-DVTK_DATA_ROOT:PATH=%{_datadir}/%{name}-data \
-DVTK_WRAP_PYTHON:BOOL=ON \
-DVTK_WRAP_TCL:BOOL=ON \
-DVTK_WRAP_JAVA:BOOL=ON \
-DVTK_USE_PARALLEL:BOOL=ON \
-DVTK_USE_RENDERING:BOOL=ON \
-DBUILD_DOCUMENTATION:BOOL=OFF \
-DBUILD_EXAMPLES:BOOL=ON \
-DBUILD_SHARED_LIBS:BOOL=ON \
-DBUILD_TESTING:BOOL=ON \
-DVTK_USE_GUISUPPORT:BOOL=ON \
-DVTK_USE_QVTK:BOOL=ON \
-DVTK_INSTALL_QT_DIR:STRING=%{qtdir}/plugins/designer \
-DVTK_LEGACY_REMOVE:BOOL=OFF \
-DVTK_USE_GL2PS:BOOL=ON \
-DVTK_USE_SYSTEM_EXPAT: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 \
-DVTK_USE_SYSTEM_EXPAT:BOOL=ON \
-DVTK_USE_SYSTEM_FREETYPE:BOOL=ON \
-DVTK_HAVE_GETSOCKNAME_WITH_SOCKLEN_T:INTERNAL=1
%__make %{?jobs:-j%{jobs}}
%install
make install
# python stuff is installed in the wrong directory /usr/local
# http://www.vtk.org/Bug/view.php?id=4010
mkdir -p %buildroot/%python_sitelib
mv $RPM_BUILD_ROOT%{_prefix}/local/lib/python%{py_ver}/site-packages/* $RPM_BUILD_ROOT/%python_sitelib/
# install testing-progs and examples
find bin -type f | egrep -v '\.' > bin-progs-list
install -d $RPM_BUILD_ROOT%{_bindir}
install -m 755 `cat bin-progs-list` $RPM_BUILD_ROOT%{_bindir}
# generate the package testing-progs lists and store them in file-lists
echo "%defattr (-, root, root)" > testing-progs-list
find $RPM_BUILD_ROOT%{_bindir} -type f | \
sed -e "s#^$RPM_BUILD_ROOT##" | \
egrep -v '^%{_bindir}/(qt.*|vtk|pvtk|vtkWrap.*|vtkpython|pvtkpython)$'\
>> testing-progs-list
# examples and testing files
for d in Common Filtering GenericFiltering Graphics Hybrid IO \
Imaging Parallel Rendering VolumeRendering Widgets
do
install -d $RPM_BUILD_ROOT%{_datadir}/%{name}-examples/Testing/$d
cp -a $d/Testing/* \
$RPM_BUILD_ROOT%{_datadir}/%{name}-examples/Testing/$d
done
cp -a Examples $RPM_BUILD_ROOT%{_datadir}/%{name}-examples
# get rid of unwanted files
find $RPM_BUILD_ROOT%{_datadir}/%{name}-examples \
-name "*.o" -exec rm {} ';' -o \
-name CMakeCache.txt -exec rm {} ';' -o \
-name Makefile -exec rm {} ';' -o \
-name DartTestfile.txt -exec rm {} ';' -o \
-name .NoDartCoverage -exec rm {} ';' -o \
-name "cmake.*" -exec rm {} ';' -o \
-name "cmake_install.*" -exec rm {} ';' -o \
-name "*.pyc" -exec rm {} ';' -o \
-name "*.pyo" -exec rm {} ';'
find $RPM_BUILD_ROOT%{_datadir}/%{name}-examples \
-type d -name CVS | xargs rm -rf
find $RPM_BUILD_ROOT%{_datadir}/%{name}-examples \
-name "CMake*" | xargs rm -rf
# cmake
install -d $RPM_BUILD_ROOT/%{_libdir}/vtk-%{version}
mv $RPM_BUILD_ROOT/%{_libdir}/*.cmake $RPM_BUILD_ROOT/%{_libdir}/vtk-%{version}
mv $RPM_BUILD_ROOT/%{_libdir}/CMake $RPM_BUILD_ROOT/%{_libdir}/vtk-%{version}
mv $RPM_BUILD_ROOT/%{_libdir}/hints $RPM_BUILD_ROOT/%{_libdir}/vtk-%{version}
# make scripts executable
chmod a+x $RPM_BUILD_ROOT%{_libdir}/testing/*.{py,tcl}
# fix tcl stuff
install -d $RPM_BUILD_ROOT/usr/share/tcl/vtk-%{version}/testing
mv $RPM_BUILD_ROOT/%{_libdir}/pkgIndex.tcl $RPM_BUILD_ROOT/usr/share/tcl/vtk-%{version}
mv $RPM_BUILD_ROOT/%{_libdir}/tcl/* $RPM_BUILD_ROOT/usr/share/tcl/vtk-%{version}
mv $RPM_BUILD_ROOT/%{_libdir}/testing/*.tcl $RPM_BUILD_ROOT/usr/share/tcl/vtk-%{version}/testing
#python testing files --> remove them
rm -rf $RPM_BUILD_ROOT/%{_libdir}/testing
# remove doxygen scripts and verdict docs
rm -rf $RPM_BUILD_ROOT/%{_libdir}/doxygen
rm -rf $RPM_BUILD_ROOT/%{_libdir}/doc
# Remove exec bit from not-scripts
chmod 0644 Utilities/Upgrading/*.pdf
chmod 0644 Utilities/Upgrading/*.txt
for file in `find $RPM_BUILD_ROOT -type f -perm 0755 | xargs -r file | grep ASCII | awk -F: '{print $1}'`; do
head -1 $file | grep '^#!' > /dev/null && continue
chmod 0644 $file
done
# drop empty files
find $RPM_BUILD_ROOT -size 0 | xargs rm -f
# Remove any remnants of rpaths
chrpath -d $RPM_BUILD_ROOT%{_bindir}/*
# make doc-dirs
for dir in vtk vtk-devel vtk-tcl vtk-testing-progs vtk-python; do
install -d $RPM_BUILD_ROOT/%{_docdir}/"$dir"
done
`for i in $(find %{buildroot}%{_datadir}/vtk-examples/ -name '*.py'); do chmod +x $i; done`
#chmod -x %buildroot/%{_libdir}/vtk-%{version}/*.cmake
#symlink duplicate files, made rpm smaller and rpmlint happyer
%fdupes -s %buildroot
%clean
rm -rf $RPM_BUILD_ROOT
%post -p /sbin/ldconfig
%post tcl -p /sbin/ldconfig
%post -n python-vtk -p /sbin/ldconfig
%post qt -p /sbin/ldconfig
%post java -p /sbin/ldconfig
%postun -p /sbin/ldconfig
%postun tcl -p /sbin/ldconfig
%postun -n python-vtk -p /sbin/ldconfig
%postun qt -p /sbin/ldconfig
%postun java -p /sbin/ldconfig
%files
%defattr(-,root,root)
%{_libdir}/libvtkCommon.so.*
%{_libdir}/libvtkFiltering.so.*
%{_libdir}/libvtkGenericFiltering.so.*
%{_libdir}/libvtkGraphics.so.*
%{_libdir}/libvtkHybrid.so.*
%{_libdir}/libvtkImaging.so.*
%{_libdir}/libvtkIO.so.*
%{_libdir}/libvtkParallel.so.*
%{_libdir}/libvtkRendering.so.*
%{_libdir}/libvtkftgl.so.*
%{_libdir}/libvtkDICOMParser.so.*
%{_libdir}/libvtkVolumeRendering.so.*
%{_libdir}/libvtksys.so.*
%{_libdir}/libvtkWidgets.so.*
%{_libdir}/libvtkNetCDF.so.*
%{_libdir}/libvtkexoIIc.so.*
%{_libdir}/libvtkInfovis.so.*
%{_libdir}/libvtkViews.so.*
%{_libdir}/libvtklibxml2.so.*
%{_libdir}/libvtkmetaio.so.*
%{_libdir}/libvtksqlite.so.*
%{_libdir}/libvtkverdict.so.*
%{_libdir}/libvtkGeovis.so.*
%{_libdir}/libvtkalglib.so.*
%{_libdir}/libvtkproj4.so.*
%doc README.html
%doc vtkLogo.jpg
%doc Copyright.txt
%files devel
%defattr(-,root,root,-)
%dir %{_libdir}/vtk-%{version}
%{_includedir}/*
%{_libdir}/vtk-%{version}/CMake
%{_libdir}/vtk-%{version}/*.cmake
%{_libdir}/vtk-%{version}/hints
%{_libdir}/libvtkCommon.so
%{_libdir}/libvtkFiltering.so
%{_libdir}/libvtkGenericFiltering.so
%{_libdir}/libvtkGraphics.so
%{_libdir}/libvtkHybrid.so
%{_libdir}/libvtkImaging.so
%{_libdir}/libvtkIO.so
%{_libdir}/libvtkParallel.so
%{_libdir}/libvtkRendering.so
%{_libdir}/libvtkftgl.so
%{_libdir}/libvtkDICOMParser.so
%{_libdir}/libvtkVolumeRendering.so
%{_libdir}/libvtksys.so
%{_libdir}/libvtkWidgets.so
%{_libdir}/libvtkNetCDF.so
%{_libdir}/libvtkexoIIc.so
%{_libdir}/libvtk*TCL.so
%{_libdir}/libvtk*Python*.so
%{_libdir}/libvtk*Java*.so
%{_libdir}/libQVTK.so
%{_libdir}/libvtkInfovis.so
%{_libdir}/libvtkViews.so
%{_libdir}/libvtklibxml2.so
%{_libdir}/libvtkmetaio.so
%{_libdir}/libvtksqlite.so
%{_libdir}/libvtkverdict.so
%{_libdir}/libvtkGeovis.so
%{_libdir}/libvtkalglib.so
%{_libdir}/libvtkproj4.so
%doc README.html
%doc vtkLogo.jpg
%defattr(0644,root,root,-)
%doc Utilities/Upgrading/*.txt
%doc Utilities/Upgrading/*.pdf
%doc Utilities/Upgrading/*.cmake
%files testing-progs -f testing-progs-list
%defattr(-,root,root,-)
%doc README.html
%doc vtkLogo.jpg
%files tcl
%defattr(-,root,root,-)
%{_bindir}/vtkWrapTcl
%{_bindir}/vtkWrapTclInit
%{_bindir}/vtk
%{_libdir}/libvtk*TCL.so.*
%{_datadir}/tcl
%doc README.html
%doc vtkLogo.jpg
%files -n python-vtk
%defattr(-,root,root,-)
%{_bindir}/vtkWrapPython
%{_bindir}/vtkWrapPythonInit
%{_bindir}/vtkpython
%{_libdir}/libvtk*Python*.so.*
%if %suse_version <= 1110
%{py_sitedir}/*
%else
%{python_sitelib}/*
%endif
%doc README.html
%doc vtkLogo.jpg
%files qt
%defattr(-,root,root,-)
%{_libdir}/libQVTK.so.*
%{_libdir}/libvtkQtChart.so*
%{_bindir}/qtevents
%{_bindir}/qtimageviewer
%{_bindir}/qtsimpleview
%dir %{qtdir}/plugins/designer
%{qtdir}/plugins/designer/libQVTKWidgetPlugin.so
%files java
%defattr(-,root,root,-)
%dir %{_libdir}/java/vtk
%{_libdir}/java/vtk/vtk.jar
%{_libdir}/libvtk*Java.so.*
%{_bindir}/vtkWrapJava
%files examples
%defattr(-,root,root,-)
%{_datadir}/%{name}-examples
%changelog
* Sat May 08 2010 Werner Hoch <werner.ho@gmx.de> - 5.4.2
- applied patches provided by Marcel Witte <wittemar@googlemail.com>
- enable java bindings
- patch to fix png-support for factory
* Mon Jun 08 2009 Andrea Florio <andrea@opensuse.org> - 5.4.2
- made rpmlint happy (using fdupes)
- fixed rpm Group using real ones, please check here: http://en.opensuse.org/SUSE_Package_Conventions/RPM_Groups
- added libraries introduced in version 5.4.2 to file lists
- use qt4 instead of qt3
- replaced %{lib_version} with %{version}
- set VTK_LEGACY_REMOVE to OFF for compatibility with applications that uses the legacy functions
* Sat Jan 03 2009 Werner Hoch <werner.ho@gmx.de> - 5.2.1
- removed vtk-data
- removed vtk-doc (doxygen)
- new version 5.2.1
- build fixes for openSUSE 11.1
* Sat Aug 09 2008 Werner Hoch <werner.ho@gmx.de> - 5.0.4
- switched to the specfile from Jaroslaw Zachwieja
http://www2.warwick.ac.uk/fac/sci/csc/people/computingstaff/jaroslaw_zachwieja/vtk/
- use qt3 instead of qt4
* Thu Jul 18 2008 Werner Hoch <werner.ho@gmx.de> - 5.0.4
- specfile taken from fedora core 9 and adapted to opensuse