vtk-vl.spec 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421
  1. %define name vtk
  2. %define major_version 5.0
  3. %define minor_version 4
  4. %define version %{major_version}.%{minor_version}
  5. %define release 1%{?_dist_release}
  6. %define data_version 5.0.4
  7. %define ruby /usr/bin/ruby
  8. %define rlibdir %(%{ruby} -r rbconfig -e 'print Config::CONFIG["rubylibdir"]')
  9. %define rarchdir %(%{ruby} -r rbconfig -e 'print Config::CONFIG["archdir"]')
  10. %define qt_dir %{_libdir}/qt3
  11. %define qt_designer_plugins_dir %{qt_dir}/plugins/designer
  12. %define py_ver %(python -c 'import sys; print sys.version[:3]')
  13. %define py_dir %{_libdir}/python%{py_ver}
  14. Name: %{name}
  15. Version: %{version}
  16. Release: %{release}
  17. Source0: vtk-%{version}.tar.gz
  18. Source1: vtkdata-%{data_version}.tar.gz
  19. Patch0: vtk-5.0-getsockname.patch
  20. Patch1: http://www.gfd-dennou.org/arch/ruby/products/ruby-vtk/vtk-ruby-060915.patch
  21. License: BSD style
  22. URL: http://www.vtk.org/
  23. BuildPrereq: cmake >= 2.0.0
  24. #BuildPrereq: XOrg-devel, XOrg-gl-devel
  25. BuildPrereq: xorg-x11-devel, mesa-libGL-devel
  26. BuildPrereq: expat-devel, zlib-devel
  27. BuildPrereq: netcdf
  28. BuildPrereq: libjpeg-devel, libpng-devel, libtiff-devel, freetype2-devel
  29. BuildPrereq: tcl, tk, python, python-devel, ruby, ruby-devel
  30. BuildPrereq: qt-devel
  31. BuildRoot: %{_tmppath}/%{name}-%{version}-root
  32. Summary: The Visualization Toolkit - A high level 3D visualization library
  33. Summary: The Visualization Toolkit - ハイレベル3D可視化ライブラリ
  34. Group: System Environment/Libraries
  35. Requires: cmake
  36. #Requires: XOrg, XOrg-gl
  37. Requires: xorg-x11-libs, mesa-libGL
  38. Requires: expat, zlib
  39. Requires: netcdf
  40. Requires: libjpeg, libpng, libtiff, freetype2
  41. %description
  42. VTK - the Visualization Toolkit is an object oriented, high
  43. level library that allows one to easily write C++ programs, Tcl,
  44. Python and Java scripts that do 3D visualization. This package
  45. provides the shared libraries needed to run C++ programs that use VTK.
  46. To compile C++ code that uses VTK you have to install vtk-devel.
  47. VTK enables users to concentrate on their work by providing a
  48. large number of excellent and feature packed high level functions that
  49. do visualization. The library needs OpenGL to render the graphics and
  50. for Linux machines Mesa is necessary. The terms/copyright can be read
  51. in %{_docdir}/vtk-%{version}-%{release}/README.html. VTK-Linux-HOWTO has
  52. information about using vtk, getting documentataion or help and
  53. instructions on building VTK. This package is relocatable.
  54. %package devel
  55. Summary: VTK header files for building C++ code.
  56. Group: Development/Libraries
  57. Requires: %{name} = %{version}-%{release}
  58. %description devel
  59. This provides the VTK header files required to compile C++
  60. programs that use VTK to do 3D visualisation.
  61. %package tcl
  62. Summary: Tcl bindings for VTK.
  63. Group: Applications/Engineering
  64. Requires: %{name} = %{version}-%{release}
  65. Requires: tcl
  66. %description tcl
  67. VTK - the Visualization Toolkit is an object oriented, high level
  68. library that allows one to easily write C++ programs, Tcl, Python and Java
  69. scripts that do 3D visualization. This package provides the shared
  70. libraries that enable one to use VTK via Tcl scripts. This version also
  71. provides the vtkTkRenderWindow class. This package does not require the vtk
  72. package to be installed. The library needs OpenGL to render the graphics and
  73. for Linux machines Mesa is necessary.
  74. The terms/copyright can be read in
  75. /usr/share/doc/vtk-tcl-%{version}-%{release}/README.html. VTK-Linux-HOWTO has
  76. information about using vtk, getting documentation or help and instructions on
  77. building VTK. This package is relocatable.
  78. %package python
  79. Summary: Python bindings for VTK.
  80. Group: Applications/Engineering
  81. Requires: %{name} = %{version}-%{release}
  82. Requires: python
  83. %description python
  84. This provides the shared libraries that enable one to use VTK from
  85. python scripts. You will need python and vtk installed to use this.
  86. Remember to set your PYTHONPATH variable properly before running your
  87. scripts.
  88. %package ruby
  89. Summary: Ruby bindings for VTK.
  90. Group: Applications/Engineering
  91. Requires: %{name} = %{version}-%{release}
  92. Requires: ruby
  93. %description ruby
  94. This provides the shared libraries that enable one to use VTK from
  95. ruby scripts. You will need ruby and vtk installed to use this.
  96. %package qt
  97. Summary: QT VTK widget
  98. Group: System Environment/Libraries
  99. Requires: %{name} = %{version}-%{release}
  100. Requires: qt
  101. %description qt
  102. The vtkQt classes combine VTK and Qt(TM) for X11.
  103. %package examples
  104. Summary: C++, Tcl and Python example programs/scripts for VTK.
  105. Group: Development/Libraries
  106. Requires: %{name} = %{version}-%{release}
  107. %description examples
  108. This package contains all the examples from the VTK source.
  109. To compile the C++ examples you will need to install the vtk-devel
  110. package as well. The Python and Tcl examples can be run with the
  111. corresponding packages (vtk-python, vtk-tcl).
  112. %package testing-progs
  113. Summary: Tests programs for VTK.
  114. Group: Development/Libraries
  115. Requires: %{name} = %{version}-%{release}
  116. %description testing-progs
  117. This package contains all testing programs from the VTK
  118. source. The source code of these programs can be found in the
  119. vtk-examples package.
  120. %package data
  121. Summary: Data for VTK.
  122. Group: Development/Libraries
  123. Requires: %{name} = %{version}-%{release}
  124. Prefix: /usr
  125. %description data
  126. This package contains all the data from the VTKData repository.
  127. These data are required to run various examples from the examples package.
  128. %prep
  129. %setup -q -n VTK
  130. %patch0 -p1
  131. %patch1 -p1
  132. cmake . \
  133. -DCMAKE_CXX_COMPILER:STRING=g++ \
  134. -DCMAKE_CXX_FLAGS:STRING="$RPM_OPT_FLAGS -Wno-deprecated" \
  135. -DCMAKE_CXX_FLAGS_DEBUG:STRING=-g \
  136. -DCMAKE_CXX_FLAGS_MINSIZEREL:STRING=-Os \
  137. -DCMAKE_CXX_FLAGS_RELEASE:STRING="-O2 -finline-functions" \
  138. -DCMAKE_CXX_FLAGS_RELWITHDEBINFO:STRING="-O2 -g" \
  139. -DCMAKE_C_COMPILER:STRING=gcc \
  140. -DCMAKE_C_FLAGS:STRING="$RPM_OPT_FLAGS" \
  141. -DCMAKE_C_FLAGS_DEBUG:STRING=-g \
  142. -DCMAKE_C_FLAGS_MINSIZEREL:STRING=-Os \
  143. -DCMAKE_C_FLAGS_RELEASE:STRING="-O2 -finline-functions" \
  144. -DCMAKE_C_FLAGS_RELWITHDEBINFO:STRING="-O2 -g" \
  145. -DCMAKE_BUILD_TYPE:STRING=Release \
  146. -DCMAKE_HP_PTHREADS:BOOL=OFF \
  147. -DCMAKE_USE_PTHREADS:BOOL=ON \
  148. -DCMAKE_USE_SPROC:BOOL=OFF \
  149. -DEXECUTABLE_OUTPUT_PATH:PATH=$RPM_BUILD_DIR/VTK/bin \
  150. -DCMAKE_INSTALL_PREFIX:PATH=%{prefix} \
  151. -DCMAKE_USE_RELATIVE_PATHS:BOOL=OFF \
  152. -DVTK_DATA_ROOT:PATH=%{_datadir}/vtk-data-%{version} \
  153. -DVTK_WRAP_PYTHON:BOOL=ON \
  154. -DVTK_WRAP_RUBY:BOOL=ON \
  155. -DVTK_WRAP_TCL:BOOL=ON \
  156. -DVTK_USE_PARALLEL:BOOL=ON \
  157. -DVTK_USE_HYBRID:BOOL=ON \
  158. -DVTK_USE_RENDERING:BOOL=ON \
  159. -DBUILD_DOCUMENTATION:BOOL=ON \
  160. -DBUILD_EXAMPLES:BOOL=OFF \
  161. -DBUILD_SHARED_LIBS:BOOL=ON \
  162. -DBUILD_TESTING:BOOL=ON \
  163. -DVTK_USE_GUISUPPORT:BOOL=ON \
  164. -DVTK_USE_QVTK:BOOL=ON \
  165. -DQT_INCLUDE_DIR:FILEPATH=%{qt_dir}/include \
  166. -DQT_MOC_EXECUTABLE:FILEPATH=%{_bindir}/moc \
  167. -DQT_QASSISTANTCLIENT_LIBRARY:FILEPATH=%{qt_dir}/lib/libqassistantclient.a \
  168. -DQT_QT_LIBRARY:FILEPATH=%{qt_dir}/lib/libqt-mt.so \
  169. -DQT_UIC_EXECUTABLE:FILEPATH=%{_bindir}/bin/uic \
  170. -DVTK_INSTALL_QT_PLUGIN_DIR:STRING=%{qt_designer_plugins_dir} \
  171. -DVTK_USE_RPATH:BOOL=OFF \
  172. -DVTK_LEGACY_REMOVE:BOOL=ON \
  173. -DVTK_USE_GL2PS:BOOL=ON \
  174. -DVTK_RUBY_LIB_DIR=%{rlibdir} \
  175. -DVTK_RUBY_ARCH_DIR=%{rarchdir} \
  176. -DVTK_RUBY_SETUP_ARGS:STRING=--prefix="$RPM_BUILD_ROOT" \
  177. -DVTK_USE_SYSTEM_EXPAT:BOOL=ON \
  178. -DVTK_USE_SYSTEM_FREETYPE:BOOL=ON \
  179. -DVTK_USE_SYSTEM_JPEG:BOOL=ON \
  180. -DVTK_USE_SYSTEM_PNG:BOOL=ON \
  181. -DVTK_USE_SYSTEM_TIFF:BOOL=ON \
  182. -DVTK_USE_SYSTEM_ZLIB:BOOL=ON \
  183. -DVTK_INSTALL_LIB_DIR:PATH=/%{_lib} \
  184. -DVTK_PYTHON_SETUP_ARGS:STRING="--prefix=$RPM_BUILD_ROOT%{_prefix} --install-lib=$RPM_BUILD_ROOT%{py_dir}/site-packages" \
  185. -DLIBRARY_OUTPUT_PATH:PATH=$RPM_BUILD_DIR/VTK/%{_lib} \
  186. -DPYTHON_INCLUDE_PATH:PATH=%{_includedir}/python%{py_ver} \
  187. -DPYTHON_LIBRARY:FILEPATH=%{py_dir}/config/libpython%{py_ver}.a \
  188. %build
  189. %__make %{?_smp_mflags}
  190. %install
  191. rm -rf $RPM_BUILD_ROOT
  192. export VTKPYTHONPATH=%{py_dir}/site-packages
  193. %makeinstall DESTDIR=$RPM_BUILD_ROOT
  194. rm -f bin/*.so*
  195. install -m 755 bin/* $RPM_BUILD_ROOT%{_bindir}
  196. rm -rf doc
  197. for d in Common Filtering GenericFiltering Graphics Hybrid IO Imaging Parallel Rendering VolumeRendering Widgets
  198. do
  199. install -d -m 755 doc/Testing/$d
  200. cp -a $d/Testing/* doc/Testing/$d
  201. done
  202. cp -a Examples doc
  203. find doc -name "*.o" -exec rm {} \;
  204. find doc -name CMakeCache.txt -exec rm {} \;
  205. find doc -name Makefile -exec rm {} \;
  206. find doc -name DartTestfile.txt -exec rm {} \;
  207. find doc -name .NoDartCoverage -exec rm {} \;
  208. find doc -name "cmake.*" -exec rm {} \;
  209. echo "%defattr (-, root, root)" > testing-progs-list
  210. find ${RPM_BUILD_ROOT}%{_bindir} -type f | \
  211. sed -e "s#^${RPM_BUILD_ROOT}##g" | \
  212. egrep -v '^%{_bindir}/(vtk|pvtk|vtkWrap.*|vtkParseJava|VTKJavaExecutable|vtkpython|pvtkpython)$' \
  213. >> testing-progs-list
  214. tar zxvf %{SOURCE1}
  215. install -d $RPM_BUILD_ROOT%{_datadir}
  216. cp -r VTKData $RPM_BUILD_ROOT%{_datadir}/vtk-data-%{version}
  217. %post -p /sbin/ldconfig
  218. %post tcl -p /sbin/ldconfig
  219. %post python -p /sbin/ldconfig
  220. %post qt -p /sbin/ldconfig
  221. %postun -p /sbin/ldconfig
  222. %postun tcl -p /sbin/ldconfig
  223. %postun python -p /sbin/ldconfig
  224. %clean
  225. rm -rf $RPM_BUILD_ROOT
  226. %files
  227. %defattr(-,root,root)
  228. %doc Copyright.txt README.html TestingLogo.gif vtkLogo.jpg
  229. %{_libdir}/libvtkCommon.so.*
  230. %{_libdir}/libvtkFiltering.so.*
  231. %{_libdir}/libvtkGenericFiltering.so.*
  232. %{_libdir}/libvtkGraphics.so.*
  233. %{_libdir}/libvtkHybrid.so.*
  234. %{_libdir}/libvtkIO.so.*
  235. %{_libdir}/libvtkImaging.so.*
  236. %{_libdir}/libvtkParallel.so.*
  237. %{_libdir}/libvtkRendering.so.*
  238. %{_libdir}/libvtkVolumeRendering.so.*
  239. %{_libdir}/libvtkWidgets.so.*
  240. %{_libdir}/libvtkexoIIc.so.*
  241. %{_libdir}/libvtkftgl.so.*
  242. %{_libdir}/libvtksys.so.*
  243. %{_libdir}/libvtkDICOMParser.so.*
  244. #%{_libdir}/libvtkMPEG2Encode.so.*
  245. %{_libdir}/libvtkNetCDF.so.*
  246. %files devel
  247. %defattr(-,root,root)
  248. %doc Utilities/Upgrading/*
  249. %doc %{_libdir}/vtk-%{major_version}/doxygen/*
  250. %{_includedir}/vtk-%{major_version}/
  251. %{_libdir}/vtk-%{major_version}/CMake/
  252. %{_libdir}/vtk-%{major_version}/*.cmake
  253. %{_libdir}/vtk-%{major_version}/hints
  254. %{_libdir}/libvtkCommon.so
  255. %{_libdir}/libvtkFiltering.so
  256. %{_libdir}/libvtkGenericFiltering.so
  257. %{_libdir}/libvtkGraphics.so
  258. %{_libdir}/libvtkHybrid.so
  259. %{_libdir}/libvtkIO.so
  260. %{_libdir}/libvtkImaging.so
  261. %{_libdir}/libvtkParallel.so
  262. %{_libdir}/libvtkRendering.so
  263. %{_libdir}/libvtkVolumeRendering.so
  264. %{_libdir}/libvtkWidgets.so
  265. %{_libdir}/libvtkexoIIc.so
  266. %{_libdir}/libvtkftgl.so
  267. %{_libdir}/libvtksys.so
  268. %{_libdir}/libvtkDICOMParser.so
  269. #%{_libdir}/libvtkMPEG2Encode.so
  270. %{_libdir}/libvtkNetCDF.so
  271. %{_libdir}/libvtk*TCL.so
  272. %{_libdir}/libvtk*Python*.so
  273. %{_libdir}/libQVTK.so
  274. %{qt_designer_plugins_dir}/libQVTKWidgetPlugin.so
  275. %files tcl
  276. %defattr(-,root,root)
  277. %dir %{_libdir}/vtk-%{major_version}/testing
  278. %{_bindir}/vtk
  279. %{_bindir}/vtkWrapTcl
  280. %{_bindir}/vtkWrapTclInit
  281. %{_libdir}/libvtk*TCL.so.*
  282. %{_libdir}/vtk-%{major_version}/tcl/
  283. %{_libdir}/vtk-%{major_version}/testing/*tcl
  284. %{_libdir}/vtk-%{major_version}/pkgIndex.tcl
  285. %files python
  286. %defattr(-,root,root)
  287. %{_bindir}/vtkpython
  288. %{_bindir}/vtkWrapPython
  289. %{_bindir}/vtkWrapPythonInit
  290. %{_libdir}/libvtk*Python*.so.*
  291. %{_libdir}/python%{py_ver}/site-packages/vtk/
  292. %{_libdir}/python%{py_ver}/site-packages/VTK-%{version}-py%{py_ver}.egg-info
  293. %{_libdir}/vtk-%{major_version}/testing/*py
  294. %files ruby
  295. %defattr(-,root,root)
  296. %{_bindir}/vtkruby
  297. %{_bindir}/vtkWrapRuby
  298. %{_bindir}/vtkWrapRubyInit
  299. %{_libdir}/libvtk*Ruby*.so*
  300. %{rlibdir}/vtk.rb
  301. %{rlibdir}/vtk/
  302. %{rarchdir}/vtk/
  303. %files qt
  304. %defattr(-,root,root)
  305. %{_libdir}/libQVTK.so.*
  306. %files examples
  307. %defattr(-,root,root)
  308. %doc doc/Examples/
  309. %doc doc/Testing/
  310. %files testing-progs -f testing-progs-list
  311. %files data
  312. %defattr(-,root,root)
  313. %{_datadir}/vtk-data-%{version}
  314. %changelog
  315. * Thu Jul 31 2008 Shu KONNO <owa@bg.wakwak.com> 5.0.4-1vl5
  316. - updated vtk to 5.0.4
  317. - updated vtkdata to 5.0.4
  318. - built with xorg-x11-devel, python-2.5
  319. - applied new versioning policy
  320. - spec in utf-8
  321. * Mon Feb 25 2008 AKIYAMA Kazuhito <akiyama@yb3.so-net.ne.jp> 5.0.2-0vl6
  322. - rebuild with expat-2.0.1
  323. - add BuildPrereq: freetype2-devel and drop freetype-devel
  324. - add BuildPrereq: qt-devel
  325. - add Requires: freetype2 and drop freetype
  326. * Sun Feb 17 2008 Shu KONNO <owa@bg.wakwak.com> 5.0.2-0vl5
  327. - rebuild with tcl/tk-8.4.18
  328. * Tue Oct 09 2007 Shu KONNO <owa@bg.wakwak.com> 5.0.2-0vl4
  329. - rebuild with tcl/tk-8.4.16
  330. * Mon Aug 27 2007 Shu KONNO <owa@bg.wakwak.com> 5.0.2-0vl3
  331. - added %%define py_ver, py_dir
  332. - added %%{?_smp_mflags} to make
  333. - change for x86_64
  334. - changed lib to %%{_lib}
  335. - added VTK_INSTALL_LIB_DIR=PATH=/%{_lib} in cmake
  336. - added --install-lib at VTK_PYTHON_SETUP_ARGS in cmake
  337. * Tue May 15 2007 Daisuke SUZUKI <daisuke@linux.or.jp> 5.0.2-0vl2
  338. - rebuild with new environment/toolchain
  339. * Fri Sep 15 2006 Seiya Nishizawa <seiya@kugi.kyoto-u.ac.jp> 5.0.2-0vl1
  340. - new upstream
  341. - add ruby patch
  342. * Sat Jul 29 2006 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 5.0.1-0vl1
  343. - new upstream
  344. - fixed spec file encoding
  345. - changed Group to System Environment/Libraries
  346. * Mon Feb 06 2006 Seiya Nishizawa <seiya@kugi.kyoto-u.ac.jp> 5.0.0-0vl1
  347. - source verion up
  348. * Tue Mar 29 2005 Seiya Nishizawa <seiya@kugi.kyoto-u.ac.jp> 4.4.2-0vl1
  349. - source verion up
  350. * Sun Mar 20 2005 Seiya Nishizawa <seiya@kugi.kyoto-u.ac.jp> 4.2.6-0vl1
  351. - initial build for Vine Linux