vtk-vl.spec 11 KB

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