]> git.pld-linux.org Git - packages/vtk.git/blob - vtk.spec
- Source1 in tar.gz; md5sum added
[packages/vtk.git] / vtk.spec
1 #
2 # ToDo:
3 # - make it all work 
4 #
5 # Conditional build
6 %bcond_with     java    # build with Java support (not yet done)
7 #
8
9 Summary:        Toolkit for 3D computer graphics, image processing, and visualization
10 Summary(pl):    Zestaw narzêdzi do trójwymiarowej grafiki, przetwarzania obrazu i wizualizacji
11 Name:           vtk
12 Version:        4.2.2
13 Release:        0.1
14 License:        BSD
15 Group:          Graphics
16 Source0:        %{name}42Src.tar.bz2
17 Source1:        http://dl.sourceforge.net/vtk/VTKData-4.2.tar.gz
18 # Source1-md5:  2bbd1a62884906eac4f279441cbb9cfa
19 Patch0:         %{name}-cmakefiles.patch
20 URL:            http://public.kitware.com/VTK/
21 BuildRequires:  cmake 
22 BuildRequires:  python-devel 
23 BuildRequires:  tcl 
24 BuildRequires:  XFree86-devel 
25 BuildRequires:  doxygen
26 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
27
28 %description
29 The Visualization ToolKit (VTK) is an object oriented software system
30 for 3D computer graphics, image processing, and visualization. VTK
31 includes a textbook, a C++ class library, and several interpreted
32 interface layers including Tcl/Tk, Java, and Python. VTK supports a
33 wide variety of visualization algorithms including scalar, vector,
34 tensor, texture, and volumetric methods. It also supports advanced
35 modeling techniques like implicit modeling, polygon reduction, mesh
36 smoothing, cutting, contouring, and Delaunay triangulation.  Moreover,
37 dozens of imaging algorithms have been integrated into the system.
38 This allows mixing 2D imaging / 3D graphics algorithms and data.
39
40 NOTE: The java wrapper is not included by default.  You may rebuild
41       the srpm using "--with java" with JDK installed.
42
43 NOTE: All patented routines which are part of the package have been
44       removed in this version.
45
46 %package devel
47 Summary:        VTK header files for building C++ code
48 Summary(pl):    Pliki nag³ówkowe VTK dla C++
49 Group:          Development/C++
50 Requires:       vtk
51
52 %description devel 
53 This provides the VTK header files required to compile C++
54 programs that use VTK to do 3D visualisation.
55
56 %package tcl
57 Summary:        Tcl bindings for VTK
58 Summary(pl):    Dowi±zania Tcl do VTK
59 Group:          System/Libraries
60 Requires:       vtk
61
62 %description tcl
63 The Visualization ToolKit (VTK) is an object oriented software system
64 for 3D computer graphics, image processing, and visualization. VTK
65 includes a textbook, a C++ class library, and several interpreted
66 interface layers including Tcl/Tk, Java, and Python. VTK supports a
67 wide variety of visualization algorithms including scalar, vector,
68 tensor, texture, and volumetric methods. It also supports advanced
69 modeling techniques like implicit modeling, polygon reduction, mesh
70 smoothing, cutting, contouring, and Delaunay triangulation.  Moreover,
71 dozens of imaging algorithms have been integrated into the system.
72 This allows mixing 2D imaging / 3D graphics algorithms and data.
73
74 This package contains tcl bindings for VTK.
75
76 %package python
77 Summary:        Python bindings for VTK
78 Summary(pl):    Dowi±zania Pythona do VTK
79 Requires:       vtk
80 Provides:       vtk
81 Group:          System/Libraries
82
83 %description python 
84 The Visualization ToolKit (VTK) is an object oriented software system
85 for 3D computer graphics, image processing, and visualization. VTK
86 includes a textbook, a C++ class library, and several interpreted
87 interface layers including Tcl/Tk, Java, and Python. VTK supports a
88 wide variety of visualization algorithms including scalar, vector,
89 tensor, texture, and volumetric methods. It also supports advanced
90 modeling techniques like implicit modeling, polygon reduction, mesh
91 smoothing, cutting, contouring, and Delaunay triangulation.  Moreover,
92 dozens of imaging algorithms have been integrated into the system.
93 This allows mixing 2D imaging / 3D graphics algorithms and data.
94
95 This package contains python bindings for VTK.
96
97 %package java
98 Summary:        Java bindings for VTK
99 Summary(pl):    Dowi±zania Javy do VTK
100 Group:          Development/Java
101 Requires:       vtk
102
103 %description java
104 The Visualization ToolKit (VTK) is an object oriented software system
105 for 3D computer graphics, image processing, and visualization. VTK
106 includes a textbook, a C++ class library, and several interpreted
107 interface layers including Tcl/Tk, Java, and Python. VTK supports a
108 wide variety of visualization algorithms including scalar, vector,
109 tensor, texture, and volumetric methods. It also supports advanced
110 modeling techniques like implicit modeling, polygon reduction, mesh
111 smoothing, cutting, contouring, and Delaunay triangulation.  Moreover,
112 dozens of imaging algorithms have been integrated into the system.
113 This allows mixing 2D imaging / 3D graphics algorithms and data.
114
115 This package contains java bindings for VTK.
116
117 %package examples
118 Summary:        C++, Tcl and Python example programs/scripts for VTK
119 Summary(pl):    Przyk³adowe programy/skrypty w C++, Tcl-u i Pythonie dla VTK
120 Group:          Development/Other
121 Requires:       vtk
122 Requires:       vtk-data
123
124 %description examples
125 This package contains all the examples from the VTK source.
126 To compile the C++ examples you will need to install the vtk-devel
127 package as well. The Python and Tcl examples can be run with the
128 corresponding packages (vtk-python, vtk-tcl).
129
130 %package test-suite
131 Summary:        Test programs for VTK
132 Summary(pl):    Programy testowe dla VTK
133 Group:          Development/Other
134 Requires:       vtk
135 Requires:       vtk-data
136
137 %description test-suite
138 This package contains all testing programs from the VTK source. The
139 source code of these programs can be found in the vtk-examples
140 package.
141
142 %package data
143 Summary:        Data files for VTK
144 Summary(pl):    Pliki danych dla VTK
145 Group:          Development/Libraries
146
147 %description data 
148 This package contains all the data from the VTKData repository. These
149 data are required to run various examples from the examples package.
150
151 %prep
152 %setup -q -a 1 -n VTK-%version
153 cd Hybrid
154 %patch0 -p1
155
156 %build
157 #%if %build_java
158 #cmake  -DCMAKE_INSTALL_PREFIX:PATH=/usr \
159 #       -DLIBRARY_OUTPUT_PATH:PATH=$RPM_BUILD_DIR/VTK-%version/lib \
160 #       -DEXECUTABLE_OUTPUT_PATH:PATH=$RPM_BUILD_DIR/VTK-%version/bin \
161 #       -DCMAKE_INSTALL_PREFIX:PATH=/usr \
162 #       -DCMAKE_SKIP_RPATH:BOOL=ON \
163 #       -DCMAKE_CXX_FLAGS:STRING="$RPM_OPT_FLAGS" \
164 #       -DCMAKE_C_FLAGS:STRING="$RPM_OPT_FLAGS" \
165 #       -DJAVA_INCLUDE_PATH:PATH=$JAVA_HOME/include
166 #       -DJAVA_INCLUDE_PATH2:PATH=$JAVA_HOME/include/linux \
167 #       -DJAVE_AWT_INCLUDE_PATH:PATH=$JAVA_HOME/include \
168 #       -DPYTHON_INCLUDE_PATH:PATH=$(python -c"import os,sys; print os.path.join(sys.exec_prefix, 'include', 'python' + sys.version[:3])") \
169 #       -DPYTHON_LIBRARY:FILEPATH=$(python -c"import os,sys; print os.path.join(sys.exec_prefix, 'lib', 'python' + sys.version[:3], 'config/libpython' + sys.version[:3] + '.a')") \
170 #       -DVTK_DATA_ROOT:PATH=%{_docdir}/vtk-data-%{version} \
171 #       -DVTK_WRAP_PYTHON:BOOL=ON \
172 #       -DVTK_WRAP_JAVA:BOOL=ON \
173 #       -DVTK_WRAP_TCL:BOOL=ON \
174 #       -DVTK_USE_HYBRID:BOOL=ON \
175 #       -DVTK_USE_PARALLEL:BOOL=ON \
176 #       -DVTK_USE_RENDERING:BOOL=ON \
177 #       -DVTK_USE_X:BOOL=ON \
178 #       -DBUILD_DOCUMENTATION:BOOL=ON \
179 #       -DBUILD_EXAMPLES:BOOL=ON \
180 #       -DBUILD_SHARED_LIBS:BOOL=ON \
181 #       -DBUILD_TESTING:BOOL=ON \
182 #       -DOPENGL_INCLUDE_PATH:FILEPATH=/usr/X11R6/include/GL
183 ##      -DOPENGL_LIBRARY:FILEPATH=/usr/X11R6/lib/libGL.so.1.0
184 #
185 #%else
186 #cmake  -DCMAKE_INSTALL_PREFIX:PATH=/usr \
187 #       -DLIBRARY_OUTPUT_PATH:PATH=$RPM_BUILD_DIR/VTK-%version/lib \
188 #       -DEXECUTABLE_OUTPUT_PATH:PATH=$RPM_BUILD_DIR/VTK-%version/bin \
189 #       -DCMAKE_INSTALL_PREFIX:PATH=/usr \
190 #       -DCMAKE_SKIP_RPATH:BOOL=ON \
191 #       -DCMAKE_CXX_FLAGS:STRING="$RPM_OPT_FLAGS" \
192 #       -DCMAKE_C_FLAGS:STRING="$RPM_OPT_FLAGS" \
193 #       -DPYTHON_INCLUDE_PATH:PATH=$(python -c"import os,sys; print os.path.join(sys.exec_prefix, 'include', 'python' + sys.version[:3])") \
194 #       -DPYTHON_LIBRARY:FILEPATH=$(python -c"import os,sys; print os.path.join(sys.exec_prefix, 'lib', 'python' + sys.version[:3], 'config/libpython' + sys.version[:3] + '.a')") \
195 #       -DVTK_DATA_ROOT:PATH=%{_datadir}/vtk-data-%{version} \
196 #       -DVTK_WRAP_PYTHON:BOOL=ON \
197 #       -DVTK_WRAP_JAVA:BOOL=off \
198 #       -DVTK_WRAP_TCL:BOOL=ON \
199 #       -DVTK_USE_HYBRID:BOOL=ON \
200 #       -DVTK_USE_PARALLEL:BOOL=ON \
201 #       -DVTK_USE_RENDERING:BOOL=ON \
202 #       -DVTK_USE_X:BOOL=ON \
203 #       -DBUILD_DOCUMENTATION:BOOL=ON \
204 #       -DBUILD_EXAMPLES:BOOL=ON \
205 #       -DBUILD_SHARED_LIBS:BOOL=ON \
206 #       -DBUILD_TESTING:BOOL=ON \
207 #       -DOPENGL_INCLUDE_PATH:FILEPATH=/usr/X11R6/include/GL
208 ##      -DOPENGL_LIBRARY:FILEPATH=/usr/X11R6/lib/libGL.so.1.0
209 #
210 #%endif
211 cmake \
212         -DCMAKE_INSTALL_PREFIX:PATH=%{_prefix} \
213         -DLIBRARY_OUTPUT_PATH:PATH=$RPM_BUILD_DIR/VTK-%version/lib \
214         -DEXECUTABLE_OUTPUT_PATH:PATH=$RPM_BUILD_DIR/VTK-%version/bin  \
215         -DCMAKE_SKIP_RPATH:BOOL=ON \
216         -DBUILD_EXAMPLES:BOOL=ON \
217         -DBUILD_SHARED_LIBS:BOOL=ON \
218         -DBUILD_DOCUMENTATION:BOOL=ON \
219         -DBUILD_TESTING:BOOL=ON \
220         -DCMAKE_BACKWARDS_COMPATIBILITY=1.8 \
221         -DOPENGL_INCLUDE_PATH:PATH=/usr/X11R6/include/GL \
222         -DPYTHON_INCLUDE_PATH:PATH=%{_includedir}/python2.3 \
223         -DPYTHON_LIBRARY:FILEPATH=$(python -c"import os,sys; print os.path.join(sys.exec_prefix, 'lib', 'python' + sys.version        [:3], 'config/libpython' + sys.version[:3] + '.a')") \
224         -DPYTHON_UTIL_LIBRARY:PATH=/usr/lib/libutil.so \
225         -DTCL_INCLUDE_PATH:PATH=%{_includedir} \
226         -DTCL_LIBRARY:PATH=%{_libdir}/libtcl.so \
227         -DTK_INCLUDE_PATH:PATH=%{_includedir} \
228         -DTK_LIBRARY:PATH=%{_libdir}/libtk.so \
229         -DVTK_DATA_ROOT:PATH=%{_datadir}/vtk \
230         -DVTK_USE_HYBRID:BOOL=ON \
231         -DVTK_USE_PARALLEL:BOOL=ON \
232         -DVTK_USE_PATENTED:BOOL=off \
233         -DVTK_USE_RENDERING:BOOL=ON \
234         -DVTK_WRAP_JAVA:BOOL=OFF \
235         -DVTK_WRAP_PYTHON:BOOL=ON \
236         -DVTK_WRAP_TCL:BOOL=ON \
237         -DBUILD_SHARED_LIBS:BOOL=ON \
238         -DCMAKE_CXX_COMPILER:PATH="%{__cxx}" \
239         -DCMAKE_C_COMPILER:PATH="%{__cc}" \
240         -DCMAKE_LINKER_FLAGS:STRING="%{rpmldflags}" \
241         -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON \
242
243
244 %{__make}
245
246 %install
247 rm -rf $RPM_BUILD_ROOT
248
249 #setup python
250 export VTKPYTHONPATH=%(python -c"import os,sys; print os.path.join(sys.exec_prefix, 'lib', 'python' + sys.version[:3],'site-packages')")
251
252 #install directories
253 install -d -m 755 $RPM_BUILD_ROOT%{_bindir}
254 install -d -m 755 $RPM_BUILD_ROOT%{_libdir}/vtk/python/vtk
255 install -d -m 755 $RPM_BUILD_ROOT%{_libdir}/vtk/python/vtk/gtk
256 install -d -m 755 $RPM_BUILD_ROOT%{_libdir}/vtk/python/vtk/qt
257 install -d -m 755 $RPM_BUILD_ROOT%{_libdir}/vtk/python/vtk/testing
258 install -d -m 755 $RPM_BUILD_ROOT%{_libdir}/vtk/python/vtk/tk
259 install -d -m 755 $RPM_BUILD_ROOT%{_libdir}/vtk/python/vtk/util
260 install -d -m 755 $RPM_BUILD_ROOT%{_libdir}/vtk/python/vtk/wx
261 install -d -m 755 $RPM_BUILD_ROOT/$VTKPYTHONPATH
262 install -d -m 755 $RPM_BUILD_ROOT/usr/include/vtk
263
264 #install libs and tcl
265 #%makeinstall_std
266 %{__make} install \
267         DESTDIR=$RPM_BUILD_ROOT
268
269 chmod 755 $RPM_BUILD_ROOT%{_libdir}/vtk/*.so
270 for f in $RPM_BUILD_ROOT%{_libdir}/vtk/libvtk*Python*.so
271 do
272   ln -s ../`basename $f` $RPM_BUILD_ROOT%{_libdir}/vtk/python/
273 done
274
275 #install binaries
276 install  -m 755 bin/* $RPM_BUILD_ROOT%{_bindir}
277
278 #install python
279 install  -m 644 Wrapping/Python/*.py $RPM_BUILD_ROOT%{_libdir}/vtk/python
280 install  -m 644 Wrapping/Python/vtk/*.py $RPM_BUILD_ROOT%{_libdir}/vtk/python/vtk
281 install  -m 644 Wrapping/Python/vtk/gtk/*.py $RPM_BUILD_ROOT/usr/lib/vtk/python/vtk/gtk
282 install  -m 644 Wrapping/Python/vtk/qt/*.py $RPM_BUILD_ROOT/usr/lib/vtk/python/vtk/qt
283 install  -m 644 Wrapping/Python/vtk/tk/*.py $RPM_BUILD_ROOT/usr/lib/vtk/python/vtk/tk
284 install  -m 644 Wrapping/Python/vtk/util/*.py $RPM_BUILD_ROOT/usr/lib/vtk/python/vtk/util
285 install  -m 644 Wrapping/Python/vtk/wx/*.py $RPM_BUILD_ROOT/usr/lib/vtk/python/vtk/wx
286 cat > $RPM_BUILD_ROOT/$VTKPYTHONPATH/vtkpython.pth <<_EOF
287 %{_libdir}/vtk/python
288 _EOF
289
290 %if %build_java
291 #install java
292 install -d -m 755 $RPM_BUILD_ROOT%{_libdir}/vtk/java
293 install  -m 644 lib/vtk.jar     $RPM_BUILD_ROOT/usr/lib/vtk/java
294 install  -m 644 java/vtk/*.java $RPM_BUILD_ROOT%{_libdir}/vtk/java
295 %endif
296
297 #install data
298 mkdir -p $RPM_BUILD_ROOT/%_datadir/%name-data
299 cp -r VTKData-release-4-2/* $RPM_BUILD_ROOT/%_datadir/%name-data
300 rm -fr $RPM_BUILD_ROOT/%_datadir/%name-data/CVS
301
302 #install test-suite and examples
303 for d in Common Filtering Graphics Hybrid IO Imaging Parallel Patented Rendering
304 do
305         mkdir -p $RPM_BUILD_ROOT/%_datadir/vtk-examples/Testing/$d
306         cp -a $d/Testing/* $RPM_BUILD_ROOT/%_datadir/vtk-examples/Testing/$d
307 done
308 cp -a Examples $RPM_BUILD_ROOT/%_datadir/vtk-examples
309
310 # get rid of unwanted files
311 find $RPM_BUILD_ROOT/%_datadir/vtk-examples -name "*.o" -exec rm {} \;
312 find $RPM_BUILD_ROOT/%_datadir/vtk-examples -name CMakeCache.txt -exec rm {} \;
313 find $RPM_BUILD_ROOT/%_datadir/vtk-examples -name Makefile -exec rm {} \;
314 find $RPM_BUILD_ROOT/%_datadir/vtk-examples -name DartTestfile.txt -exec rm {} \;
315 find $RPM_BUILD_ROOT/%_datadir/vtk-examples -name .NoDartCoverage -exec rm {} \;
316 find $RPM_BUILD_ROOT/%_datadir/vtk-examples -name "CMake*" -exec rm {} \;
317 find $RPM_BUILD_ROOT/%_datadir/vtk-examples -name "cmake.*" -exec rm {} \;
318
319 # Generate the package testing-progs lists and store them in file-lists
320 echo "%defattr (-, root, root)" > testing-progs-list
321 %if %build_java
322 find ${RPM_BUILD_ROOT}/usr/bin -type f | \
323         sed -e "s#^${RPM_BUILD_ROOT}##g" | \
324         egrep -v '^/usr/bin/(vtk|pvtk|vtkWrap.*|vtkParse.*|VTKJavaExecutable|vtkpython|pvtkpython)$' \
325         >> testing-progs-list
326 %else
327 find ${RPM_BUILD_ROOT}/usr/bin -type f | \
328         sed -e "s#^${RPM_BUILD_ROOT}##g" | \
329         egrep -v '^/usr/bin/(vtk|pvtk|vtkWrap.*|vtkParse.*|vtkpython|pvtkpython)$' \
330         >> testing-progs-list
331 %endif
332
333 %post -p /sbin/ldconfig
334 %post tcl -p /sbin/ldconfig
335 %post python -p /sbin/ldconfig
336 %if %build_java
337 %post java -p /sbin/ldconfig
338 %endif
339
340 %postun -p /sbin/ldconfig
341 %postun tcl -p /sbin/ldconfig
342 %postun python -p /sbin/ldconfig 
343 %if %build_java
344 %postun java -p /sbin/ldconfig
345 %endif
346
347 %files
348 %defattr(-,root,root)
349 %doc README.html vtkLogo.jpg
350 %dir %{_libdir}/vtk
351 %{_libdir}/vtk/libvtkCommon.so 
352 %{_libdir}/vtk/libvtkFiltering.so 
353 %{_libdir}/vtk/libvtkGraphics.so
354 %{_libdir}/vtk/libvtkHybrid.so
355 %{_libdir}/vtk/libvtkImaging.so
356 %{_libdir}/vtk/libvtkIO.so
357 %{_libdir}/vtk/libvtkParallel.so
358 %{_libdir}/vtk/libvtkRendering.so
359 %{_libdir}/vtk/libvtkjpeg.so 
360 %{_libdir}/vtk/libvtkpng.so 
361 %{_libdir}/vtk/libvtkzlib.so
362 %{_libdir}/vtk/libvtkexpat.so
363 %{_libdir}/vtk/libvtkfreetype.so
364 %{_libdir}/vtk/libvtkftgl.so
365 %{_libdir}/vtk/libvtktiff.so
366
367 %files devel
368 %defattr(-,root,root)
369 %doc %{_libdir}/vtk/doxygen
370 %{_includedir}/vtk
371 %{_libdir}/vtk/CMake
372 %{_libdir}/vtk/*.cmake
373 %doc Utilities/Upgrading/*
374
375 %files test-suite -f testing-progs-list
376
377 %files tcl
378 %defattr(-,root,root)
379 %{_bindir}/vtkWrapTcl
380 %{_libdir}/vtk/libvtk*TCL.so 
381 %{_bindir}/vtk
382 %{_libdir}/vtk/tcl
383 %dir %{_libdir}/vtk/testing
384 %{_libdir}/vtk/testing/*.tcl
385 %doc README.html 
386 %doc vtkLogo.jpg
387
388 %files python
389 %defattr(-,root,root)
390 %_bindir/vtkWrapPython
391 %_bindir/vtkpython
392 %_libdir/vtk/libvtk*Python*.so 
393 %_libdir/vtk/python
394 %dir %_libdir/vtk/testing
395 %_libdir/vtk/testing/*.py
396 %(python -c"import os,sys; print os.path.join(sys.exec_prefix, 'lib', 'python' + sys.version[:3],'site-packages', 'vtkpython.pth')")
397
398 %if %build_java
399 %files java
400 %defattr(-,root,root)
401 %{_bindir}/vtkParseJava
402 %{_bindir}/vtkWrapJava
403 %{_bindir}/VTKJavaExecutable
404 %{_libdir}/vtk/libvtk*Java.so 
405 %{_libdir}/vtk/java
406 %endif
407
408 %files examples
409 %defattr(-,root,root)
410 %dir %_datadir/vtk-examples
411 %_datadir/vtk-examples/Examples
412 %_datadir/vtk-examples/Testing
413
414 %files data
415 %defattr(-,root,root)
416 %dir %_datadir/vtk-data
417 %_datadir/vtk-data/Baseline
418 %_datadir/vtk-data/Data
419 %_datadir/vtk-data/VTKData.readme
420
421 %clean 
422 rm -rf $RPM_BUILD_ROOT
This page took 0.120372 seconds and 4 git commands to generate.