From f33a6b5713b7f7131bcea7d4424901149c26c018b417d196b0b5d9f7e40e2735 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ismail=20D=C3=B6nmez?= Date: Sun, 22 Apr 2012 21:23:55 +0000 Subject: [PATCH] Accepting request 114971 from home:adra:branches:science Use more system libraries (gl2ps and hdf5), Updated/Removed some dependencies, Removed build time references, Compile the package out-of-source OBS-URL: https://build.opensuse.org/request/show/114971 OBS-URL: https://build.opensuse.org/package/show/science/vtk?expand=0&rev=31 --- vtk.changes | 14 ++++++++ vtk.spec | 98 ++++++++++++++++++++++++++++++++--------------------- 2 files changed, 74 insertions(+), 38 deletions(-) diff --git a/vtk.changes b/vtk.changes index 50365de..de37507 100644 --- a/vtk.changes +++ b/vtk.changes @@ -1,3 +1,17 @@ +------------------------------------------------------------------- +Sun Apr 22 15:11:53 UTC 2012 - asterios.dramis@gmail.com + +- Use the gl2ps and hdf5 system libraries for building in openSUSE > 12.1. +- Updated Mesa and XOrg dependencies for openSUSE > 12.1. +- Removed the following dependencies which are not needed: + MesaGLw-devel, freeglut-devel, gcc-java, libgcj-devel and sqlite3-devel. +- Removed postgresql-devel dependency (wasn't enabled and fails to compile + anyway - added a note about it). +- Removed build time references so build-compare can do its work. +- Compile the package out-of-source. +- Use the generic "VTK_USE_SYSTEM_LIBRARIES" cmake variable for enabling the + use of system libraries instead of doing it with a per package variable. + ------------------------------------------------------------------- Sun Apr 8 11:22:34 UTC 2012 - idonmez@suse.com diff --git a/vtk.spec b/vtk.spec index d3c559e..0a7af56 100644 --- a/vtk.spec +++ b/vtk.spec @@ -27,34 +27,45 @@ License: BSD-3-Clause Group: Productivity/Scientific/Other Url: http://vtk.org/ Source: http://www.vtk.org/files/release/5.8/%{name}-%{version}.tar.gz -# PATCH-FIX-UPSTREAM vtk-pythondestdir.patch --badshah400@gmail.com Correct installation destination for python libraries +# PATCH-FIX-UPSTREAM vtk-pythondestdir.patch badshah400@gmail.com -- Correct installation destination for python libraries Patch0: vtk-pythondestdir.patch -# PATCH-FIX-UPSTREAM vtk-system.patch --badshah400@gmail.com Use system libraries -# http://public.kitware.com/Bug/view.php?id=11823 +# PATCH-FIX-UPSTREAM vtk-system.patch badshah400@gmail.com -- Use system libraries, http://public.kitware.com/Bug/view.php?id=11823 Patch1: vtk-system.patch -# PATCH-FIX-UPSTREAM vtk-sqldatabaseschema.patch --badshah400@gmail.com Resolve problems with vtkSQLdatabaseschema.cxx, patch came from upstream +# PATCH-FIX-UPSTREAM vtk-sqldatabaseschema.patch badshah400@gmail.com -- Resolve problems with vtkSQLdatabaseschema.cxx, patch came from upstream Patch2: vtk-sqldatabaseschema.patch # patch to fix the soname for libVTKnetcdf_cxx Patch3: vtk-soversion2.patch # PATCH-FIX-UPSTREAM vtk-boost149.patch idoenmez@suse.de -- Fix compilation with boost 1.49 Patch4: vtk-boost149.patch +%if 0%{?suse_version} > 1210 +BuildRequires: Mesa-libGL-devel +%else BuildRequires: Mesa-devel -BuildRequires: MesaGLw-devel +%endif BuildRequires: boost-devel BuildRequires: chrpath BuildRequires: cmake BuildRequires: doxygen BuildRequires: fdupes -BuildRequires: freeglut-devel BuildRequires: freetype2-devel BuildRequires: gcc-c++ -BuildRequires: gcc-java +%if 0%{?suse_version} > 1210 +BuildRequires: gl2ps-devel +%endif BuildRequires: gnuplot BuildRequires: graphviz +%if 0%{?suse_version} > 1210 +BuildRequires: hdf5-devel +%endif BuildRequires: java-devel BuildRequires: libQtWebKit-devel +%if 0%{?suse_version} > 1210 +BuildRequires: libX11-devel +BuildRequires: libXt-devel +%else +BuildRequires: xorg-x11-devel +%endif BuildRequires: libexpat-devel -BuildRequires: libgcj-devel BuildRequires: libiodbc-devel BuildRequires: libjpeg-devel BuildRequires: libmysqlclient-devel @@ -63,14 +74,11 @@ BuildRequires: libqt4-devel BuildRequires: libtheora-devel BuildRequires: libtiff-devel BuildRequires: openmotif-devel -BuildRequires: postgresql-devel BuildRequires: python-devel BuildRequires: python-qt4-devel -BuildRequires: sqlite3-devel BuildRequires: tcl-devel BuildRequires: tk-devel BuildRequires: wget -BuildRequires: xorg-x11-devel BuildRequires: zlib-devel BuildRequires: pkgconfig(libxml-2.0) BuildRoot: %{_tmppath}/%{name}-%{version}-build @@ -87,10 +95,18 @@ volume rendering, LOD control). Summary: VTK header files for building C++ code Group: Development/Libraries/Other Requires: %{name} = %{version} -Requires: %{name}-java = %{version} +Requires: %{name}-java = %{version} Requires: %{name}-qt = %{version} Requires: %{name}-tcl = %{version} +%if 0%{?suse_version} > 1210 +Requires: Mesa-libGL-devel +%else Requires: Mesa-devel +%endif +%if 0%{?suse_version} > 1210 +Requires: gl2ps-devel +Requires: hdf5-devel +%endif Requires: libexpat-devel Requires: libjpeg-devel Requires: libmysqlclient-devel @@ -99,7 +115,6 @@ Requires: libpng-devel Requires: libqt4-devel Requires: libtheora-devel Requires: libtiff-devel -Requires: postgresql-devel Requires: python-%{name} = %{version} Requires: python-%{name}-qt = %{version} @@ -218,7 +233,7 @@ advanced algorithms (e.g., surface reconstruction, implicit modelling, decimation) and rendering techniques (e.g., hardware-accelerated volume rendering, LOD control). -This package provides a few testing programs for VTK +This package provides a few testing programs for VTK. %prep %setup -q -n VTK @@ -228,18 +243,23 @@ This package provides a few testing programs for VTK %patch3 -p1 %patch4 -p1 +# Remove build time references so build-compare can do its work +FAKE_BUILDDATE=$(LC_ALL=C date -u -r %{_sourcedir}/%{name}.changes '+%%b %%e %%Y') +FAKE_BUILDTIME=$(LC_ALL=C date -u -r %{_sourcedir}/%{name}.changes '+%%H:%%M') +sed -i "s/__DATE__/\"$FAKE_BUILDDATE\"/" Utilities/vtknetcdf/libvers.c +sed -i "s/__TIME__/\"$FAKE_BUILDTIME\"/" Utilities/vtknetcdf/libvers.c + # Replace relative path ../../../VTKData with %%{_datadir}/%%{name}data-%%{version} # otherwise it will break on symlinks. grep -rl '\.\./\.\./\.\./\.\./VTKData' . | xargs perl -pi -e's,\.\./\.\./\.\./\.\./VTKData,%{_datadir}/%{name},g' %build -export CC='gcc' -export CXX='g++' -export MAKE='make' export CFLAGS="%{optflags}" export CXXFLAGS="%{optflags}" -cmake . \ +mkdir build +pushd build +cmake .. \ -DBUILD_DOCUMENTATION:BOOL=ON \ -DBUILD_EXAMPLES:BOOL=ON \ -DBUILD_SHARED_LIBS:BOOL=ON \ @@ -248,6 +268,7 @@ cmake . \ -DSIP_INCLUDE_DIR:Path=%{py_incdir} \ -DVTK_INSTALL_LIB_DIR:PATH=/%{_lib}/%{name}\ -DVTK_INSTALL_QT_DIR:STRING=/%{qtdir}/plugins/designer \ + -DVTK_USE_BOOST:BOOL=ON \ -DVTK_USE_GL2PS:BOOL=ON \ -DVTK_USE_GUISUPPORT:BOOL=ON \ -DVTK_USE_MYSQL:BOOL=ON \ @@ -258,27 +279,29 @@ cmake . \ -DVTK_USE_QT:BOOL=ON \ -DVTK_USE_QVTK_QTOPENGL:BOOL=ON \ -DVTK_USE_RENDERING:BOOL=ON \ - -DVTK_USE_SYSTEM_EXPAT:BOOL=ON \ - -DVTK_USE_SYSTEM_FREETYPE:BOOL=ON \ - -DVTK_USE_SYSTEM_OGGTHEORA:BOOL=ON \ - -DVTK_USE_SYSTEM_JPEG:BOOL=ON \ - -DVTK_USE_SYSTEM_LIBXML2:BOOL=ON \ - -DVTK_USE_SYSTEM_PNG:BOOL=ON \ - -DVTK_USE_SYSTEM_TIFF:BOOL=ON \ - -DVTK_USE_SYSTEM_ZLIB:BOOL=ON \ + -DVTK_USE_TEXT_ANALYSIS:BOOL=ON \ + -DVTK_USE_SYSTEM_LIBRARIES:BOOL=ON \ + -DVTK_USE_SYSTEM_LIBPROJ4:BOOL=OFF \ +%if 0%{?suse_version} <= 1210 + -DVTK_USE_SYSTEM_GL2PS:BOOL=OFF \ + -DVTK_USE_SYSTEM_HDF5:BOOL=OFF \ +%endif -DVTK_WRAP_JAVA:BOOL=ON \ -DVTK_WRAP_PYTHON:BOOL=ON \ -DVTK_WRAP_PYTHON_SIP:BOOL=ON \ - -DVTK_WRAP_TCL:BOOL=ON \ - -DVTK_USE_BOOST:BOOL=ON \ - -DVTK_USE_TEXT_ANALYSIS:BOOL=ON + -DVTK_WRAP_TCL:BOOL=ON -make %{?_smp_mflags} +# Package fails to compile with the following option (Note: postgresql-devel and libpqxx-devel are needed as dependencies) +# -DVTK_USE_POSTGRES:BOOL=ON \ + +make %{?_smp_mflags} VERBOSE=1 # Remove executable bits from sources (some of which are generated) find . -name \*.c -or -name \*.cxx -or -name \*.h -or -name \*.hxx -or -name \*.gif | xargs chmod -x +popd %install +pushd build %makeinstall # link the directories to %%{_libdir}. Moving them breaks the cmake macros. @@ -364,6 +387,8 @@ chrpath -d %{buildroot}%{_bindir}/* # Main package contains utils and core libs cat libs.list utils.list > main.list +popd + # Make shared libs and scripts executable chmod a+x %{buildroot}%{_libdir}/%{name}/doxygen/*.pl chmod a+x %{buildroot}%{_libdir}/%{name}/testing/*.{py,tcl} @@ -378,16 +403,13 @@ find Utilities/Upgrading -type f | xargs chmod -x # Verdict places the docs in the false folder rm -rf %{buildroot}%{_libdir}/%{name}/doc -#Move tcl script to %%{_datadir}/tcl/%%{name}/ +# Move tcl script to %%{_datadir}/tcl/%%{name}/ mkdir -p %{buildroot}%{_datadir}/tcl/%{name}/ mv %{buildroot}%{_libdir}/%{name}/tcl/ %{buildroot}%{_datadir}/tcl/%{name}/ mv %{buildroot}%{_libdir}/%{name}/*.tcl %{buildroot}%{_datadir}/tcl/%{name}/ %fdupes -s %{buildroot} -%clean -rm -rf %{buildroot} - %post -p /sbin/ldconfig %postun -p /sbin/ldconfig @@ -406,12 +428,12 @@ rm -rf %{buildroot} %post tcl -p /sbin/ldconfig %postun tcl -p /sbin/ldconfig -%files -f main.list +%files -f build/main.list %defattr(-,root,root,-) %doc Copyright.txt README.html %{name}Logo.jpg %{name}Banner.gif Wrapping/*/README* %dir %{_libdir}/%{name}/ -%files devel -f devel.list +%files devel -f build/devel.list %defattr(-,root,root,-) %doc Utilities/Upgrading %{_libdir}/%{name}/*.cmake @@ -465,10 +487,10 @@ rm -rf %{buildroot} %{_libdir}/lib%{name}*TCL.so.* %{_libdir}/%{name}/lib%{name}*TCL.so.* -%files examples -f examples.list +%files examples -f build/examples.list %defattr(-,root,root,-) -%files testing -f testing.list +%files testing -f build/testing.list %defattr(-,root,root,-) %{_libdir}/%{name}/testing/