[vtkusers] VTK rpms - new .spec file

David Gobbi dgobbi at irus.rri.on.ca
Thu Nov 23 14:11:15 EST 2000


Hi,

I'm not sure who is currently maintaining the VTK rpms, so I'm just
sending this out to the list.  I've tested the attached .spec file
thoroughly to ensure that it works (at least with the CVS version of VTK).

I've attached a new .spec file for the VTK RPMS that clears up a
couple issues with them:

- /sbin/ldconfig is now run after installation of vtk-tcl, vtk-python
  or vtk-java (previously it was only run after the installation of
  the main RPM, and the user would have to run it manually after 
  installing the other components)

- a .pth file is put into /usr/lib/pythonX.X/site-packages so that python
  can find the vtkpython.so module.

These changes follow the philosophy that everything should 'just work'
after an RPM is installed, and that the user shouldn't be required to
run ldconfig, set environment variables, etc.

 - David

--
  David Gobbi, MSc                    dgobbi at irus.rri.on.ca
  Advanced Imaging Research Group
  Robarts Research Institute, University of Western Ontario
-------------- next part --------------
Summary: The Visualization Toolkit - A high level 3D visualization library
Name: vtk
Version: 3.1
Release: 695N
Copyright: Distributable
Group: Development/Libraries
Source: ftp://vtk.scorec.rpi.edu/pub/vtk.tar.gz
URL: http://www.kitware.com/vtk.html
Patch: vtk-linux.patch
#BuildPrereq: jdk, tk, python, python-devel, tcl
BuildPrereq: tk, python, python-devel, tcl

Buildroot: /usr/src/local/BUILD/vtk-root
Prefix: /usr/local

%description 
	VTK - the Visualization Toolkit is an object oriented, high
level library that allows one to easily write C++ programs, Tcl,
Python and Java scripts that do 3D visualization.  This package
provides the shared libraries needed to run C++ programs that use VTK.
The patented and contributed classes are also compiled. To compile
C++ code that uses VTK you have to install vtk-devel.

	VTK enables users to concentrate on their work by providing a
large number of excellent and feature packed high level functions that
do visualization.  The library needs OpenGL to render the graphics and
for Linux machines Mesa is necessary. The terms/copyright can be read
in /usr/doc/vtk-%{version}-%{release}/README.html. VTK-Linux-HOWTO has
information about using vtk, getting documentataion or help and
instructions on building VTK. The patented classes (few in number) are
not to be used commercially. Please read the files README.patented-dir
and README.patented-classes. This package is relocatable.

%changelog
* Thu Nov 23 2000 David Gobbi <dgobbi at irus.rri.on.ca>
- put vtkpython.pth in /usr/lib/pythonX.X/site-packages
- changed prefix to /usr/local, set INSTALL_ROOT to RPM_BUILD_ROOT
- added /sbin/ldconfig to %post/%postun for each of tcl, python, java
* Wed Jul 12 2000 Daniel Blezek <blezek at crd.ge.com>: Removing the need for a patch by changing user.make
* Wed Dec 8 1999 Daniel Blezek <blezek at crd.ge.com>: adapted Aleksey's spec file to nightly releases
* Wed Oct 20 1999 Aleksey Nogin <ayn2 at cornell.edu>
[vtk-2.4-1]
- Upgraded to vtk-2.4
- Made the SRPM a little more portable by removing Prabhu's "hardwired" paths
- Added tk sources to SRPM so that we do have access to tk header files.

* Fri Mar 26 1999 Prabhu Ramachandran <prabhu at aero.iitm.ernet.in>
- I am the current maintainer



# vtk-devel

%package devel
Summary: VTK header files for building C++ code.
Requires: vtk
Group: Development/Libraries
Prefix: /usr/local

%description devel 
	This provides the VTK header files required to compile C++
programs that use VTK to do 3D visualisation.

# vtk-tcl

%package tcl
Summary: Tcl bindings for VTK.
Group: X11/Libraries
Prefix: /usr/local
# Requires: tk = %{tk_version}

%description tcl
	VTK - the Visualization Toolkit is an object oriented, high level
library that allows one to easily write C++ programs, Tcl, Python and Java
scripts that do 3D visualization.  This package provides the shared
libraries that enable one to use VTK via Tcl scripts.  This version also
provides the vtkTkRenderWindow class. The patented and contributed classes
are also compiled. This package does not require the vtk package to be
installed.  The library needs OpenGL to render the graphics and for Linux
machines Mesa is necessary. 

	The terms/copyright can be read in usr/doc/vtk-tcl-%{version}-%{release}/README.html. VTK-Linux-HOWTO has information about using vtk, getting
documentataion or help and instructions on building VTK. The patented
classes (few in number) are not to be used commercially. Please read the
files README.patented-dir and README.patented-classes. This package is
relocatable.

# vtk-python

%package python
Summary: Python bindings for VTK.
Requires: vtk
Group: X11/Libraries
Prefix: /usr/local

%description python 
	This provides the shared libraries that enable one to use VTK from
python scripts.  You will need python and vtk installed to use this.
Remember to set your PYTHONPATH variable properly before running your
scripts.

# vtk-java
 
%package java
Summary: Java bindings for VTK.
Group: X11/Libraries
Prefix: /usr/local

%description java
	VTK - the Visualization Toolkit is an object oriented, high level
library that allows one to easily write C++ programs, Tcl, Python and Java
scripts that do 3D visualization.  This package provides the shared
libraries that enable one to use VTK with java scripts.  The patented and
contributed classes are also compiled.  This package does not require the
vtk package to be installed.  The library needs OpenGL to render the
graphics and for Linux machines Mesa is necessary.  You will need jdk..
jdk-1.2pre-2 was used to compile this. Remember to set your CLASSPATH to the
directory that has the java classes.  

	The terms/copyright can be read in usr/doc/vtk-java-%{version}-%{release}/README and
README.html. VTK-Linux-HOWTO has information about using vtk, getting
documentataion or help and instructions on building VTK. The patented
classes (few in number) are not to be used commercially. Please read the
files README.patented-dir and README.patented-classes. This package is
relocatable.

# vtk-examples

%package examples
Summary: C++, Tcl and Python example programs/scripts for VTK.
Group: Development/Libraries
Prefix: /usr/local

%description examples
	This package contains all the examples from the VTK source.
To compile the C++ examples you will need to install the vtk-devel
package as well. The Python and Tcl examples can be run with the
corresponding packages (vtk-python, vtk-tcl).


%prep

%setup -n vtk -q
%patch -p1


%build

export CLASSPATH=.:/usr/local/jdk1.2.2:`pwd`/java/classes:`pwd`/java:`pwd`/java/vtk
export PATH=/usr/local/jdk1.2.2/bin:$PATH
export LD_LIBRARY_PATH=`pwd`/common:`pwd`/graphics:`pwd`/patented:`pwd`/imaging:`pwd`/contrib:`pwd`/java 

# Can't build with Mesa, Threads and Java, so dropping Java
# ./configure --with-mesa --with-shared --with-tcl --with-tkwidget --with-python --with-java --with-contrib --with-patented --prefix=/usr/local

export CC=cc
export CXX=g++

./configure --with-java --with-shared --with-tcl --with-tkwidget --with-python --with-contrib --with-patented --prefix=/usr/local

# Setup dir for java compiled classes
mkdir -p `pwd`/java/classes

export VTK_HOMEDIR=`pwd`
# export MAKE='make -j 2'
make -j 2
# make


%install

# chmod 644 README
cp ./patented/README ./README.patented-dir
echo -e "A list of the patented classes.\n\n" > README.patented-classes
ls ./patented/*.h >> README.patented-classes

rm -rf $RPM_BUILD_ROOT

#creating all the directories
install -d $RPM_BUILD_ROOT/usr/local/bin
install -d $RPM_BUILD_ROOT/usr/local/lib/vtk/{contrib/examplesTcl,examplesTcl/frog}
install -d $RPM_BUILD_ROOT/usr/local/lib/vtk/graphics/examples{Cxx,Tcl/RenderMan/Shaders,Python}
install -d $RPM_BUILD_ROOT/usr/local/lib/vtk/imaging/examples{,Cxx,Tcl}
install -d $RPM_BUILD_ROOT/usr/local/lib/vtk/patented/examplesTcl
install -d $RPM_BUILD_ROOT/usr/local/lib/vtk/java/vtk
install -d $RPM_BUILD_ROOT/usr/local/include/vtk

# this installs the libs and the vtk tcl interpretor

make INSTALL_ROOT=$RPM_BUILD_ROOT install
# make prefix=/usr/local install

#stripping all the shared libraries and the vtk interpreter
strip $RPM_BUILD_ROOT/usr/local/bin/vtk
strip $RPM_BUILD_ROOT/usr/local/lib/lib*

# this installs all the header files.
install -m 644 ./common/*.h $RPM_BUILD_ROOT/usr/local/include/vtk
install -m 644 ./contrib/*.h $RPM_BUILD_ROOT/usr/local/include/vtk
install -m 644 ./wrap/*.h $RPM_BUILD_ROOT/usr/local/include/vtk
install -m 644 ./graphics/*.h $RPM_BUILD_ROOT/usr/local/include/vtk
install -m 644 ./imaging/*.h $RPM_BUILD_ROOT/usr/local/include/vtk
install -m 644 ./patented/*.h $RPM_BUILD_ROOT/usr/local/include/vtk

#installing all the examples...

install  -m 644 ./contrib/examplesTcl/*.tcl $RPM_BUILD_ROOT/usr/local/lib/vtk/contrib/examplesTcl/

install  -m 644 ./examplesTcl/*.tcl $RPM_BUILD_ROOT/usr/local/lib/vtk/examplesTcl/

install  -m 644 ./examplesTcl/frog/*.tcl $RPM_BUILD_ROOT/usr/local/lib/vtk/examplesTcl/frog

install  -m 644 ./graphics/examplesCxx/*.cxx $RPM_BUILD_ROOT/usr/local/lib/vtk/graphics/examplesCxx/
install  -m 644 ./graphics/examplesCxx/Makefile* $RPM_BUILD_ROOT/usr/local/lib/vtk/graphics/examplesCxx/
install  -m 644 ./graphics/examplesPython/*.py $RPM_BUILD_ROOT/usr/local/lib/vtk/graphics/examplesPython/
install  -m 644 ./graphics/examplesTcl/{*.tcl,*.ppm} $RPM_BUILD_ROOT/usr/local/lib/vtk/graphics/examplesTcl/
install  -m 644 ./graphics/examplesTcl/RenderMan/{*.so,*.tcl} $RPM_BUILD_ROOT/usr/local/lib/vtk/graphics/examplesTcl/RenderMan/
install  -m 644 ./graphics/examplesTcl/RenderMan/Shaders/*.sl $RPM_BUILD_ROOT/usr/local/lib/vtk/graphics/examplesTcl/RenderMan/Shaders

# install  -m 644 ./imaging/examples/* $RPM_BUILD_ROOT/usr/local/lib/vtk/imaging/examples/
install  -m 644 ./imaging/examplesTcl/*.tcl $RPM_BUILD_ROOT/usr/local/lib/vtk/imaging/examplesTcl/
install  -m 644 ./imaging/examplesCxx/*.cxx $RPM_BUILD_ROOT/usr/local/lib/vtk/imaging/examplesCxx/

install  -m 644 ./patented/examplesTcl/*.tcl $RPM_BUILD_ROOT/usr/local/lib/vtk/patented/examplesTcl/

# installing java classes

install  -m 644 ./java/vtk.jar $RPM_BUILD_ROOT/usr/local/lib/vtk/


%post
# Check for /usr/local/lib in /etc/ld.so.conf...
if grep "/usr/local/lib" /etc/ld.so.conf > /dev/null
then
	true
else
	echo "/usr/local/lib" >> /etc/ld.so.conf
fi
/sbin/ldconfig

%post tcl
/sbin/ldconfig

%post python
/sbin/ldconfig

%post java
/sbin/ldconfig


%postun
/sbin/ldconfig

%postun tcl
/sbin/ldconfig

%postun python
/sbin/ldconfig

%postun java
/sbin/ldconfig



%files
%attr(755, root, root) /usr/local/lib/libVTKCommon.so 
%attr(755, root, root) /usr/local/lib/libVTKContrib.so
%attr(755, root, root) /usr/local/lib/libVTKGraphics.so 
%attr(755, root, root) /usr/local/lib/libVTKImaging.so
%attr(755, root, root) /usr/local/lib/libVTKPatented.so

%attr(-, root, root) %doc README.html VTK-Linux-HOWTO README.patented-dir 
# %attr(644, root, root) %doc README.patented-classes README vtkLogo.jpg
%attr(644, root, root) %doc README.patented-classes vtkLogo.jpg

%files devel
%attr(644, root, root) /usr/local/include/vtk/

%files tcl
%attr(755, root, root) /usr/local/lib/libVTKCommonTcl.so 
%attr(755, root, root) /usr/local/lib/libVTKContribTcl.so
%attr(755, root, root) /usr/local/lib/libVTKGraphicsTcl.so 
%attr(755, root, root) /usr/local/lib/libVTKImagingTcl.so
%attr(755, root, root) /usr/local/lib/libVTKPatentedTcl.so
%attr(755, root, root) /usr/local/bin/vtk

%attr(-, root, root) %doc README.html VTK-Linux-HOWTO README.patented-dir 
# %attr(644, root, root) %doc README.patented-classes README vtkLogo.jpg
%attr(644, root, root) %doc README.patented-classes vtkLogo.jpg


%files python
%attr(755, root, root) /usr/local/lib/libVTKCommonPython.so 
%attr(755, root, root) /usr/local/lib/libVTKContribPython.so
%attr(755, root, root) /usr/local/lib/libVTKGraphicsPython.so 
%attr(755, root, root) /usr/local/lib/libVTKImagingPython.so
%attr(755, root, root) /usr/local/lib/libVTKPatentedPython.so
%attr(755, root, root) /usr/local/lib/vtkTkRenderWidget
%attr(755, root, root) /usr/local/lib/vtkTkImageWindowWidget
%attr(755, root, root) /usr/local/lib/vtkTkImageViewerWidget
%attr(-, root, root)   /usr/local/lib/vtk/python/
%attr(644, root, root) %(python -c "import sys, os; print os.path.join(sys.prefix,'lib','python'+sys.version[0:3],'site-packages','vtkpython.pth')")


%files java
%attr(755, root, root) /usr/local/lib/libVTKCommonJava.so 
%attr(755, root, root) /usr/local/lib/libVTKContribJava.so
%attr(755, root, root) /usr/local/lib/libVTKGraphicsJava.so 
%attr(755, root, root) /usr/local/lib/libVTKImagingJava.so
%attr(755, root, root) /usr/local/lib/libVTKPatentedJava.so
%attr(755, root, root) /usr/local/lib/libvtkJava.so
%attr(-, root, root) /usr/local/lib/vtk.jar

# 
# %attr(-, root, root) %doc README.html VTK-Linux-HOWTO README.patented-dir 
# %attr(644, root, root) %doc README.patented-classes README vtkLogo.jpg


%files examples
%attr(-, root, root) /usr/local/lib/vtk/contrib
%attr(-, root, root) /usr/local/lib/vtk/examplesTcl
%attr(-, root, root) /usr/local/lib/vtk/graphics
%attr(-, root, root) /usr/local/lib/vtk/imaging
%attr(-, root, root) /usr/local/lib/vtk/patented


%clean 
rm -rf $RPM_BUILD_ROOT



More information about the vtkusers mailing list