vtk-vl.spec 11 KB

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