vtk-vl.spec 11 KB

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