source: projects/specs/trunk/v/vtk/vtk-vl.spec @ 9305

Revision 9305, 16.9 KB checked in by inagaki, 9 years ago (diff)

2015-01-28 Ryoichi INAGAKI <ryo1@…>

  • gl2ps, jsoncpp: new package
  • vtk: updated


Line 
1# Disable OSMesa builds for now - see Bug 744434
2%bcond_with OSMesa
3# Make Java conditional
4%bcond_without java
5
6%{!?tcl_version: %global tcl_version %(echo 'puts $tcl_version' | tclsh)}
7%{!?tcl_sitelib: %global tcl_sitelib %{_datadir}/tcl%{tcl_version}}
8
9%define _hdf5_version 1.8.14
10
11Summary: The Visualization Toolkit - A high level 3D visualization library
12Summary(ja): The Visualization Toolkit - ハイレベル3D可視化ライブラリ
13Name: vtk
14Version: 6.1.0
15Release: 1%{?_dist_release}
16
17# This is a variant BSD license, a cross between BSD and ZLIB.
18# For all intents, it has the same rights and restrictions as BSD.
19# http://fedoraproject.org/wiki/Licensing/BSD#VTKBSDVariant
20License: BSD style
21Group: System Environment/Libraries
22URL: http://www.vtk.org/
23
24Source0: http://www.vtk.org/files/release/6.1/VTK-%{version}.tar.gz
25Source1: http://www.vtk.org/files/release/6.1/VTKData-%{version}.tar.gz
26
27# Use system libraries
28# http://public.kitware.com/Bug/view.php?id=11823
29Patch0: vtk-6.1.0-system.patch
30# Install some more needed cmake files to try to support paraview build
31# http://www.vtk.org/Bug/view.php?id=14157
32Patch1: vtk-install.patch
33# Patch to vtk to use system netcdf library
34Patch2: vtk-6.1.0-netcdf.patch
35# Fix compilation with mesa 10.4
36# https://bugzilla.redhat.com/show_bug.cgi?id=1138466
37Patch3: vtk-glext.patch
38# Fix types for std::min/man
39# http://www.vtk.org/Bug/view.php?id=15249
40Patch4: vtk-type.patch
41
42BuildRoot: %{_tmppath}/%{name}-%{version}-root
43BuildRequires: cmake >= 2.0.0
44BuildRequires: gcc-c++
45%{?with_java:BuildRequires: java-devel}
46BuildRequires: libX11-devel, libXt-devel, libXext-devel
47BuildRequires: libICE-devel, libGL-devel
48%{?with_OSMesa:BuildRequires: mesa-libOSMesa-devel}
49BuildRequires: tk-devel, tcl-devel
50BuildRequires: python-devel
51BuildRequires: expat-devel, freetype2-devel, libjpeg-turbo-devel, libpng-devel
52BuildRequires: gl2ps-devel
53BuildRequires: libtiff-devel, zlib-devel
54BuildRequires: libxml2-devel
55BuildRequires: qt4-devel qt4-designer
56#BuildRequires: qtwebkit-devel
57BuildRequires: chrpath
58BuildRequires: doxygen, graphviz
59BuildRequires: gnuplot
60BuildRequires: libboost-devel
61BuildRequires: hdf5-devel
62BuildRequires: jsoncpp-devel
63BuildRequires: libtheora-devel
64#BuildRequires: mysql-devel
65BuildRequires: mariadb-devel
66BuildRequires: netcdf-cxx-devel
67#BuildRequires: postgresql-devel
68BuildRequires: libpq-devel
69BuildRequires: R-devel
70BuildRequires: PyQt4-devel
71BuildRequires: sip-devel
72BuildRequires: sqlite3-devel
73BuildRequires: wget
74#BuildRequires: %{_includedir}/Xm
75BuildRequires: openMotif-devel
76BuildRequires: blas-devel
77BuildRequires: lapack-devel
78%{!?with_java:Conflicts: vtk-java}
79Requires: hdf5 = %{_hdf5_version}
80
81Distribution: Project Vine
82Vendor: Vine Linux
83Packager: owa
84
85# Do not check .so files in the python_sitearch directory
86%global __provides_exclude_from ^%{python_sitearch}/.*\\.so$
87
88%description
89VTK is an open-source software system for image processing, 3D
90graphics, volume rendering and visualization. VTK includes many
91advanced algorithms (e.g., surface reconstruction, implicit modeling,
92decimation) and rendering techniques (e.g., hardware-accelerated
93volume rendering, LOD control).
94
95%package devel
96Summary: VTK header files for building C++ code.
97Summary(ja): C++ プログラムをビルドするための VTK ヘッダファイル集
98Group: Development/Libraries
99Requires: %{name} = %{version}-%{release}
100%{?with_OSMesa:Requires: mesa-libOSMesa-devel}
101Requires: cmake
102Requires: blas-devel
103Requires: gl2ps-devel
104Requires: expat-devel
105Requires: freetype2-devel
106Requires: hdf5-devel
107Requires: lapack-devel
108Requires: libjpeg-turbo-devel
109Requires: libpng-devel
110Requires: libogg-devel
111Requires: libtheora-devel
112Requires: libtiff-devel
113Requires: libxml2-devel
114Requires: libpq-devel
115Requires: libmysqlclient-devel
116Requires: qt4-devel
117#Requires: qtwebkit-devel%{?_isa}
118#Requires: jsoncpp-devel%{?_isa}
119# bz #1183210 + #1183530
120Requires: python-devel
121
122%description devel
123This provides the VTK header files required to compile C++
124programs that use VTK to do 3D visualisation.
125
126
127%package tcl
128Summary: Tcl bindings for VTK
129Summary(ja): VTK の tcl バインディング
130Group: System Environment/Libraries
131Requires: %{name} = %{version}-%{release}
132Requires: tcl
133
134%description tcl
135tcl bindings for VTK
136
137%description tcl -l ja
138VTK の tcl バインディングです。
139
140
141%package python
142Summary: Python bindings for VTK.
143Summary(ja): VTK の python バインディング
144Group: System Environment/Libraries
145Requires: %{name} = %{version}-%{release}
146Requires: python
147
148%description python
149python bindings for VTK
150
151%description python -l ja
152VTK の python バインディングです。
153
154%if %{with java}
155%package java
156Summary: Java bindings for VTK
157Summary(ja): VTK の Java バインディング
158Group: System Environment/Libraries
159Requires: %{name} = %{version}-%{release}
160Requires: java
161
162%description java
163Java bindings for VTK
164
165%description java -l ja
166VTK の Java バインディングです。
167%endif
168
169
170%package qt
171Summary: Qt bindings for VTK
172Summary(ja): VTK の Qt バインディング
173Group: System Environment/Libraries
174Requires: %{name} = %{version}-%{release}
175
176%description qt
177Qt bindings for VTK
178
179%description qt -l ja
180VTK の Qt バインディングです。
181
182
183%package qt-python
184Summary: Qt Python bindings for VTK
185Summary(ja): VTK の Qt Python バインディング
186Group: System Environment/Libraries
187Requires: %{name} = %{version}-%{release}
188
189%description qt-python
190Qt Python bindings for VTK
191
192%description qt-python -l ja
193VTK の Qt Python バインディングです。
194
195%package qt-tcl
196Summary: Qt TCL bindings for VTK
197Summary(ja): VTK の Qt TCL バインディング
198Group: System Environment/Libraries
199Requires: %{name} = %{version}-%{release}
200
201%description qt-tcl
202Qt TCL bindings for VTK
203
204%description qt-tcl -l ja
205VTK の Qt TCL バインディングです。
206
207
208%package testing-progs
209Summary: Tests programs for VTK.
210Summary(ja): VTK のテスト用プログラム
211Group: Development/Libraries
212Requires: %{name} = %{version}-%{release}
213
214%description testing-progs
215Testing programs for VTK
216
217%description testing-progs -l ja
218VTK のテスト用プログラムです。
219
220
221%package examples
222Summary: Examples for VTK
223Summary(ja): VTK のサンプル集
224Group: Applications/Engineering
225Requires: %{name} = %{version}-%{release}
226Requires: vtk-data = %{version}
227
228%description examples
229This package contains all the examples from the VTK source.
230To compile the C++ examples you will need to install the vtk-devel
231package as well. The Python and Tcl examples can be run with the
232corresponding packages (vtk-python, vtk-tcl).
233
234%package data
235Summary: Example data file for VTK
236Summary(ja): VTK のサンプルデータファイル
237Group: Development/Libraries
238BuildArch: noarch
239
240%description data
241This package contains all the data from the VTKData repository.
242These data are required to run various examples from the examples package.
243
244%prep
245%setup -q -n VTK-%{version}
246%patch0 -p1 -b .system
247%patch1 -p1 -b .install
248%patch2 -p1 -b .netcdf
249%patch3 -p1 -b .glext
250%patch4 -p1 -b .type
251# Remove included thirdparty sources just to be sure
252# TODO - vtksqlite
253for x in autobahn vtkexpat vtkfreetype vtkgl2ps vtkhdf5 vtkjpeg vtklibxml2 vtknetcdf vtkoggtheora vtkpng vtktiff twisted vtkzlib zope
254do
255  rm -r ThirdParty/*/${x}
256done
257
258# Replace relative path ../../../VTKData with %{_datadir}/vtkdata-%{version}
259# otherwise it will break on symlinks.
260grep -rl '\.\./\.\./\.\./\.\./VTKData' . | xargs \
261  perl -pi -e's,\.\./\.\./\.\./\.\./VTKData,%{_datadir}/vtkdata-%{version},g'
262
263# Save an unbuilt copy of the Example's sources for %doc
264mkdir vtk-examples
265cp -a Examples vtk-examples
266# Don't ship Win32 examples
267rm -r vtk-examples/Examples/GUI/Win32
268find vtk-examples -type f | xargs chmod -R a-x
269
270%build
271export CFLAGS="%{optflags} -D_UNICODE"
272export CXXFLAGS="%{optflags} -D_UNICODE"
273%if %{with java}
274export JAVA_HOME=/usr/lib/jvm/java
275# Arm/Aarch64 builders have less ram
276# https://bugzilla.redhat.com/show_bug.cgi?id=1115920
277%ifnarch s390
278export JAVA_TOOL_OPTIONS=-Xmx2048m
279%endif
280%endif
281
282mkdir build
283pushd build
284%cmake \
285       -DBUILD_DOCUMENTATION:BOOL=ON \
286       -DBUILD_EXAMPLES:BOOL=ON \
287       -DBUILD_TESTING:BOOL=OFF \
288       -DVTK_CUSTOM_LIBRARY_SUFFIX="" \
289       -DVTK_INSTALL_ARCHIVE_DIR:PATH=%{_lib}/vtk \
290       -DVTK_INSTALL_DATA_DIR=share/vtk \
291       -DVTK_INSTALL_INCLUDE_DIR:PATH=include/vtk \
292       -DVTK_INSTALL_LIBRARY_DIR:PATH=%{_lib}/vtk \
293       -DVTK_INSTALL_PACKAGE_DIR:PATH=%{_lib}/cmake/vtk \
294       -DVTK_INSTALL_PYTHON_MODULE_DIR:PATH=%{_lib}/python%{python_version}/site-packages \
295       -DVTK_INSTALL_QT_DIR:PATH=%{_lib}/qt4/plugins/designer \
296       -DVTK_INSTALL_TCL_DIR:PATH=share/tcl%{tcl_version}/vtk \
297       -DTK_INTERNAL_PATH:PATH=/usr/include/tk-private/generic \
298%if %{with OSMesa}
299       -DVTK_OPENGL_HAS_OSMESA:BOOL=ON \
300%endif
301%if %{with java}
302       -DVTK_WRAP_JAVA:BOOL=ON \
303       -DJAVA_INCLUDE_PATH:PATH=$JAVA_HOME/include \
304       -DJAVA_INCLUDE_PATH2:PATH=$JAVA_HOME/include/linux \
305       -DJAVA_AWT_INCLUDE_PATH:PATH=$JAVA_HOME/include \
306%else
307       -DVTK_WRAP_JAVA:BOOL=OFF \
308%endif
309       -DVTK_WRAP_PYTHON:BOOL=ON \
310       -DVTK_WRAP_PYTHON_SIP:BOOL=ON \
311       -DSIP_INCLUDE_DIR:PATH=/usr/include/python%{python_version} \
312       -DVTK_WRAP_TCL:BOOL=ON \
313       -DVTK_Group_Imaging:BOOL=ON \
314       -DVTK_Group_Qt:BOOL=ON \
315       -DVTK_Group_Rendering:BOOL=ON \
316       -DVTK_Group_StandAlone:BOOL=ON \
317       -DVTK_Group_Tk:BOOL=ON \
318       -DVTK_Group_Views:BOOL=ON \
319       -DModule_vtkFiltersStatisticsGnuR:BOOL=ON \
320       -DModule_vtkTestingCore:BOOL=ON \
321       -DModule_vtkTestingRendering:BOOL=ON \
322       -DVTK_USE_OGGTHEORA_ENCODER=ON \
323       -DVTK_USE_SYSTEM_LIBRARIES=ON \
324       -DVTK_USE_SYSTEM_HDF5:BOOL=ON \
325       -DVTK_USE_SYSTEM_LIBPROJ4:BOOL=OFF \
326       -DVTK_USE_SYSTEM_NETCDF:BOOL=ON \
327       -DTCL_LIBRARY:FILEPATH=%{_libdir}/libtcl%{tcl_version}.so \
328       -DTK_LIBRARY:FILEPATH=%{_libdir}/libtk%{tcl_version}.so \
329       ..
330       
331# TODO - MPI
332#-DVTK_Group_MPI:BOOL=ON \
333# Needed for some tests.  Fails to compile at the moment.  We don't run test though.
334#  -DVTK_DATA_ROOT:PATH=%{_datadir}/vtkdata-%{version} \
335# Not working, see http://public.kitware.com/Bug/view.php?id=11978
336# -DVTK_USE_ODBC=ON \
337# Commented old flags in case we'd like to reactive some of them
338# -DVTK_USE_DISPLAY:BOOL=OFF \ # This prevents building of graphics tests
339# -DVTK_USE_MPI:BOOL=ON \
340
341# Got intermittent build error with -j
342make %{?_smp_mflags}
343
344# Remove executable bits from sources (some of which are generated)
345find . -name \*.c -or -name \*.cxx -or -name \*.h -or -name \*.hxx -or \
346       -name \*.gif | xargs chmod -x
347
348
349%install
350rm -rf $RPM_BUILD_ROOT
351pushd build
352make install DESTDIR=$RPM_BUILD_ROOT
353
354# ld config
355mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/ld.so.conf.d
356echo %{_libdir}/vtk > $RPM_BUILD_ROOT%{_sysconfdir}/ld.so.conf.d/vtk-%{_arch}.conf
357
358# Gather list of non-python/tcl libraries
359ls $RPM_BUILD_ROOT%{_libdir}/vtk/*.so.* \
360  | grep -Ev '(Java|Qt|Python27D|TCL)' | sed -e's,^%{buildroot},,' > libs.list
361
362# List of executable utilities
363cat > utils.list << EOF
364vtkEncodeString
365EOF
366
367# List of executable examples
368cat > examples.list << EOF
369HierarchicalBoxPipeline
370MultiBlock
371Arrays
372Cube
373RGrid
374SGrid
375Medical1
376Medical2
377Medical3
378finance
379AmbientSpheres
380Cylinder
381DiffuseSpheres
382SpecularSpheres
383Cone
384Cone2
385Cone3
386Cone4
387Cone5
388Cone6
389EOF
390
391# Install examples too
392for filelist in examples.list; do
393    for file in `cat $filelist`; do
394        install -p bin/$file $RPM_BUILD_ROOT%{_bindir}
395    done
396done
397
398# Fix up filelist paths
399for filelist in utils.list examples.list; do
400  perl -pi -e's,^,%{_bindir}/,' $filelist
401done
402
403# Remove any remnants of rpaths on files we install
404# Seems to be some kind of java path
405for file in `cat examples.list`; do
406  chrpath -d $RPM_BUILD_ROOT$file
407done
408chrpath -d  $RPM_BUILD_ROOT%{_qt4_plugindir}/designer/libQVTKWidgetPlugin.so
409
410# Main package contains utils and core libs
411cat libs.list utils.list > main.list
412popd
413
414# Make scripts executable
415#chmod a+x %{buildroot}%{_libdir}/vtk/doxygen/*.pl
416#chmod a+x %{buildroot}%{_libdir}/vtk/testing/*.{py,tcl}
417
418# Remove exec bit from non-scripts and %%doc
419for file in `find %{buildroot} -type f -perm 0755 \
420  | xargs -r file | grep ASCII | awk -F: '{print $1}'`; do
421    head -1 $file | grep '^#!' > /dev/null && continue
422    chmod 0644 $file
423done
424find Utilities/Upgrading -type f | xargs chmod -x
425
426# install VTKdata
427mkdir -p $RPM_BUILD_ROOT%{_datadir}
428pushd $RPM_BUILD_ROOT%{_datadir}
429tar -zpxf %{SOURCE1}
430mv VTK-%{version} %{name}-%{version}
431
432# (Verbosely) fix 0555 permissions
433find . -type f -perm 0555 | xargs -r echo chmod 0755 | sh -x
434# Remove execute bits from not-scripts
435for file in `find . -type f -perm 0755`; do
436  head -1 $file | grep '^#!' > /dev/null && continue
437  chmod 0644 $file
438done
439popd
440
441# Setup Wrapping docs tree
442rm -rf _docs
443mkdir -p _docs
444cp -pr --parents Wrapping/*/README* _docs/
445
446%clean
447rm -rf $RPM_BUILD_ROOT
448
449%post -p /sbin/ldconfig
450
451%postun -p /sbin/ldconfig
452
453%post tcl -p /sbin/ldconfig
454
455%postun tcl -p /sbin/ldconfig
456
457%post python -p /sbin/ldconfig
458
459%postun python -p /sbin/ldconfig
460
461%if %{with java}
462%post java -p /sbin/ldconfig
463
464%postun java -p /sbin/ldconfig
465%endif
466
467%post qt -p /sbin/ldconfig
468
469%postun qt -p /sbin/ldconfig
470
471%post qt-tcl -p /sbin/ldconfig
472
473%postun qt-tcl -p /sbin/ldconfig
474
475%post qt-python -p /sbin/ldconfig
476
477%postun qt-python -p /sbin/ldconfig
478
479
480%files -f build/main.list
481%defattr(-,root,root)
482%doc Copyright.txt README.html vtkLogo.jpg vtkBanner.gif _docs/Wrapping
483%config(noreplace) %{_sysconfdir}/ld.so.conf.d/vtk-%{_arch}.conf
484%{_datadir}/vtk
485%dir %{_libdir}/vtk
486
487%files devel
488%defattr(-,root,root)
489%doc Utilities/Upgrading
490%{_bindir}/vtkHashSource
491%{_bindir}/vtkWrapHierarchy
492%{_includedir}/vtk
493%{_libdir}/vtk/*.so
494%{_libdir}/vtk/libvtkWrappingTools.a
495%{_libdir}/cmake/vtk/
496%{_bindir}/vtkParseOGLExt
497%{_docdir}/vtk-6.1/
498%{tcl_sitelib}/vtk/vtktcl.c
499
500%files tcl
501%defattr(-,root,root)
502%{_libdir}/vtk/*TCL.so.*
503%exclude %{_libdir}/vtk/*QtTCL.so.*
504%{_bindir}/vtk
505%{_bindir}/vtkWrapTcl
506%{_bindir}/vtkWrapTclInit
507%{tcl_sitelib}/vtk/
508%exclude %{tcl_sitelib}/vtk/vtktcl.c
509
510%files python
511%defattr(-,root,root)
512%{_bindir}/vtkpython
513%{_bindir}/vtkWrapPython
514%{_bindir}/vtkWrapPythonInit
515%{_libdir}/vtk/*Python27D.so.*
516%{python_sitearch}/*
517%exclude %{_libdir}/vtk/*QtPython27D.so.*
518
519%if %{with java}
520%files java
521%defattr(-,root,root)
522%{_libdir}/vtk/*Java.so.*
523%{_libdir}/vtk/vtk.jar
524%{_bindir}/vtkParseJava
525%{_bindir}/vtkWrapJava
526%endif
527
528%files qt
529%defattr(-,root,root)
530%{_libdir}/vtk/lib*Qt*.so.*
531%exclude %{_libdir}/vtk/*TCL.so.*
532%exclude %{_libdir}/vtk/*Python27D.so.*
533%{_qt4_plugindir}/designer/libQVTKWidgetPlugin.so
534
535%files qt-python
536%defattr(-,root,root)
537%{_libdir}/vtk/*Python27D.so.*
538
539%files qt-tcl
540%defattr(-,root,root)
541%{_libdir}/vtk/*TCL.so.*
542
543%files testing-progs
544#-f testing-progs-list
545
546%files examples -f build/examples.list
547%defattr(-,root,root)
548%doc vtk-examples/Examples
549
550%files data
551%defattr(-,root,root)
552%{_datadir}/%{name}-%{version}
553
554
555%changelog
556* Wed Jan 28 2015 Ryoichi INAGAKI <ryo1@toki.waseda.jp> 6.1.0-1
557- updated to 6.1.0
558- built with tcl/tk 8.5.15, libpng 1.6.12 and hdf5 1.8.14
559- added java, qt-tcl and qt-python subpackage
560
561* Mon May 09 2011 Shu KONNO <owa@bg.wakwak.com> 5.4.2-3
562- s/qt-devel/qt4-devel/ at BR:
563- add BR: libxml2-devel
564
565* Sun May 08 2011 Shu KONNO <owa@bg.wakwak.com> 5.4.2-2
566- remove _smp_mflags
567- added tcl_ver macro
568- added TCL_LIBRARY, TK_LIBRARY to cmake
569
570* Tue May 04 2010 Shu KONNO <owa@bg.wakwak.com> 5.4.2-1
571- updated vtk to 5.4.2
572- updated vtkdata to 5.4.2
573- added Obsoletes: %%{name}-ruby < 5.4.2
574- added Patch2: vtk-5.2.1-boost-1.42.patch (from Mandriva)
575- dropt Patch0: vtk-5.0-getsockname.patch
576- dropt Patch1: vtk-ruby-060915.patch
577
578* Thu Jul 31 2008 Shu KONNO <owa@bg.wakwak.com> 5.0.4-1vl5
579- updated vtk to 5.0.4
580- updated vtkdata to 5.0.4
581- built with xorg-x11-devel, python-2.5
582- applied new versioning policy
583- spec in utf-8
584
585* Mon Feb 25 2008 AKIYAMA Kazuhito <akiyama@yb3.so-net.ne.jp> 5.0.2-0vl6
586- rebuild with expat-2.0.1
587- add BuildPrereq: freetype2-devel and drop freetype-devel
588- add BuildPrereq: qt-devel
589- add Requires: freetype2 and drop freetype
590
591* Sun Feb 17 2008 Shu KONNO <owa@bg.wakwak.com> 5.0.2-0vl5
592- rebuild with tcl/tk-8.4.18
593
594* Tue Oct 09 2007 Shu KONNO <owa@bg.wakwak.com> 5.0.2-0vl4
595- rebuild with tcl/tk-8.4.16
596
597* Mon Aug 27 2007 Shu KONNO <owa@bg.wakwak.com> 5.0.2-0vl3
598- added %%define py_ver, py_dir
599- added %%{?_smp_mflags} to make
600- change for x86_64
601        - changed lib to %%{_lib}
602        - added VTK_INSTALL_LIB_DIR=PATH=/%{_lib} in cmake
603        - added --install-lib at VTK_PYTHON_SETUP_ARGS in cmake
604
605* Tue May 15 2007 Daisuke SUZUKI <daisuke@linux.or.jp> 5.0.2-0vl2
606- rebuild with new environment/toolchain
607
608* Fri Sep 15 2006 Seiya Nishizawa <seiya@kugi.kyoto-u.ac.jp> 5.0.2-0vl1
609- new upstream
610- add ruby patch
611
612* Sat Jul 29 2006 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 5.0.1-0vl1
613- new upstream
614- fixed spec file encoding
615- changed Group to System Environment/Libraries
616
617* Mon Feb 06 2006 Seiya Nishizawa <seiya@kugi.kyoto-u.ac.jp> 5.0.0-0vl1
618- source verion up
619
620* Tue Mar 29 2005 Seiya Nishizawa <seiya@kugi.kyoto-u.ac.jp> 4.4.2-0vl1
621- source verion up
622
623* Sun Mar 20 2005 Seiya Nishizawa <seiya@kugi.kyoto-u.ac.jp> 4.2.6-0vl1
624- initial build for Vine Linux
Note: See TracBrowser for help on using the repository browser.