# SPEC file for building VMD on fedora ######################################## #configuration # name and version of distribution %if %{?fedora} %define distver fc%{fedora} %else %define distver fc6 %endif # build with cuda? %define havecuda 1 %if %{havecuda} %define cuda_home /home/akohlmey/cuda %endif # XXX: this is needed b/c intersurf is provided as binary ######################################## # maintainer settings %define name vmd %define snapshot 20090518 %define version 1.8.7beta3 %define pkgrel 1ak %define tachyonver 0.98.5 %define actcver 1.1 ######################################## # derived flags %define release %{pkgrel}.%{distver} %define buildver none %if %{_target_os} == linux %ifarch i386 i486 i586 i686 %define buildver LINUX %endif %ifarch x86_64 ia32e em64t %define buildver LINUXAMD64 %endif %endif %if %{buildver} == none unsupported os and architecture combination exit 1 %endif # pick the right python/tk/tcl/... version %define pyversion 2.4 %define tclversion 8.4 %define fltkversion 1.1 %define glversion 6.4 %define babelver babel %define rlwrap %{nil} %define netcdf netcdf %define netcdflib -Ldummy %if %{distver} == fc6 %define pyversion 2.4 %define tclversion 8.4 %define fltkversion 1.1.8 %define glversion 6.4 %define babelver babel %define rlwrap %{nil} %define netcdf netcdf-3 %define netcdflib -L%{_libdir}/%{netcdf} %endif %if %{distver} == fc10 %define pyversion 2.5 %define pynextver 2.6 %define tclversion 8.5 %define tclnextver 8.6 %define fltkversion 1.1.9 %define glversion 7.2 %define babelver openbabel %define rlwrap rlwrap %endif %if %{distver} == fc11 %define pyversion 2.6 %define pynextver 2.7 %define tclversion 8.5 %define tclnextver 8.6 %define fltkversion 1.1.9 %define glversion 7.5 %define babelver openbabel %define rlwrap rlwrap %endif %define archsuffix %{buildver} Summary: The VMD Molecular Visualization and Analysis Package Vendor: The Theoretical and Computational Biophysics Group (TCBG), University of Illinois at Urbana-Champaign Name: %{name} Version: %{version} Release: %{release} URL: http://www.ks.uiuc.edu/Research/vmd/ License: Free to use but Restricted Group: Education #XXX #Source0: %{name}-%{version}.src.tar.gz Source0: %{name}-plugins-%{snapshot}.tar.gz Source9: %{name}-src-%{snapshot}.tar.gz Source1: vmd.desktop Source2: vmd.xpm Source3: vmd_16x16.png Source4: vmd_22x22.png Source5: vmd_32x32.png Source6: vmd_48x48.png Source10: tachyon-%{tachyonver}.tar.gz Source30: stride-mod.tar.gz Source40: surf.zip Source50: actc-%{actcver}.tar.gz #Patch01: vmd-internal-babel.patch Patch02: vmd-rename-swig.patch Patch03: vmd-python-module.diff Patch07: vmd-logfile-vmdcon.diff Patch09: vmd-plugins-addons.diff #Patch31: stride-hbond-hack.diff #Patch32: stride-update.diff Patch41: surf-gccdep.diff Patch42: surf-gcc43.diff Patch51: actc-gcc43-compat.diff BuildRoot: %{_tmppath}/%{name}-buildroot Autoreqprov: no Provides: /usr/bin/vmd /usr/bin/catdcd /usr/bin/cionize BuildRequires: python-devel >= %{pyversion} fltk-devel >= %{fltkversion} swig >= 1.3.24 libjpeg-devel libpng-devel tk-devel >= %{tclversion} gcc gcc-c++ libX11-devel >= 1.0.0 libXext-devel >= 1.0.0 mesa-libGL-devel >= %{glversion} libXft-devel >= 2.1.8.2 netcdf-devel expat-devel latex2html ghostscript python-numeric tkinter Requires: /bin/sh /usr/bin/env glibc mesa-libGL mesa-libGLU libX11 libXext fltk >= %{fltkversion} libgcc libjpeg libpng libstdc++ tcl >= %{tclversion} tk >= %{tclversion} python >= %{pyversion} libXft netpbm-progs ImageMagick %{babelver} python-numeric tkinter %{rlwrap} %description VMD is designed for the visualization and analysis of biological systems such as proteins, nucleic acids, lipid bilayer assemblies, etc. It may be used to view more general molecules, as VMD can read standard Protein Data Bank (PDB) files and display the contained structure. VMD provides a wide variety of methods for rendering and coloring molecule. VMD can be used to animate and analyze the trajectory of molecular dynamics (MD) simulations, and can interactively manipulate molecules being simulated on remote computers (Interactive MD). VMD has many features, which include: o No limit on the number of molecules, atoms, residues or number of animation frames, except available memory. o Many molecular and volumetric rendering and coloring methods. o Extensive atom selection language with boolean and algebraic operators, regular expressions, distance based selections, and more. o Extensive graphical and text interfaces to Tcl, Tk, and Python to provide powerful scripting and analysis capabilities. o Stereoscopic display with shutter glasses, autostereoscopic flat panels, anaglyph stereo glasses, and side-by-side stereo viewing. o High-quality on-screen rendering using OpenGL programmable shading on advanced graphics accelerators. o 3-D interactive control through the use of joysticks, Spaceballs, haptic devices and other advanced input devices, with support for Virtual Reality Peripheral Network (VRPN). o An extensible plugin-based file loading system with support for popular formats such as AMBER, CHARMM, Gromacs, NAMD, PDB, X-PLOR, and many others, as well as automatic conversion through Babel. o Export displayed scene to extenal rendering formats including POV-Ray, Raster3D, Renderman, Tachyon, Wavefront, as well as STL or VRML2 files for 3-D printing. o Perform interactive molecular dynamics (IMD) simulations using NAMD, Protomol, or other programs as simulation back-ends. o Integration with the program NAMD, a fast, parallel, and scalable molecular dynamics program developed in conjunction with VMD. See the NAMD page for details: http://www.ks.uiuc.edu/Research/namd o Integration with the BioCoRE collaborative research environment. VMD can "publish" molecular graphics scripts to BioCoRE, so that collaborators can work together over the internet. See the BioCoRE page for details: http://www.ks.uiuc.edu/Research/biocore %prep rm -rf $RPM_BUILD_ROOT %setup -c -a 9 -a 10 # a) fix up configure for our setup cd ${RPM_BUILD_DIR}/%{name}-%{version}/%{name} mv configure configure.old sed -e "s,^\( *\$install_bin_dir\).*,\1=\"${RPM_BUILD_ROOT}%{_usr}/bin\";," \ -e "s,^\( *\$install_library_dir\).*,\1=\"${RPM_BUILD_ROOT}%{_libdir}/%{name}\";," \ -e "s,^\( *\$def_babel_bin\).*,\1=\"%{_bindir}/babel\";," \ -e "s,^\( *\$install_name\).*,\1=\"vmd\";," \ -e "s,tcl8.5,tcl%{tclversion},g" -e "s,tk8.5,tk%{tclversion},g" \ -e "s,^\( *\$progversion\).*,\1=\"%{version}-rpm\";," \ -e "s,^\( *\$arch_nvcc\).*,\1=\"%{cuda_home}/bin/nvcc\";," \ -e "s,^\( *\$cuda_include\).*,\1=\"-I%{cuda_home}/include\";," \ -e "s,^\( *\$cuda_library\).*,\1=\"-L%{cuda_home}/lib\";," \ -e "s,^\( *\$cuda_libs\).*,\1=\"-Wl\\,-rpath\\,%{_libdir}/%{name} -lcudart\";," \ -e "s,^\( *\$python_dir\).*,\1=\"%{_usr}\";," \ -e "s,^\( *\$python_include\).*,\1=\"-I\$python_dir/include/python%{pyversion} -I\%{_libdir}/python%{pyversion}/site-packages/numpy/core/include\";," \ -e "s,^\( *\$python_library\).*,\1=\"-L%{_libdir}\";," \ -e "s,^\( *\$python_libs\).*,\1=\"-lpython%{pyversion} -lpthread\";," \ -e "s,^\( *\$mesa_libs\).*,\1=\"-lGL -lGLU -lXext -lX11\";," \ < configure.old > configure cat >> data/.vmdrc < src/config.h.new mv src/config.h.new src/config.h # fix up sources for debuginfo sed -e 's,lex.yy.c,AtomLexer.C,' < src/AtomLexer.C > src/AtomLexer.C.new mv src/AtomLexer.C.new src/AtomLexer.C make -C src vmdpy_python.C make -C src depend make -C src VMDEXTRALIBS="%{netcdflib} -lnetcdf -lexpat -ljpeg -lpng -lz" cp %{archsuffix}/vmd.so . cp src/vmdpy.py . rm -rvf %{archsuffix} %if %{havecuda} perl ./configure %{archsuffix} OPENGL FLTK TK ACTC CUDA IMD XINPUT LIBTACHYON NETCDF TCL PYTHON PTHREADS NUMPY RPM TKCON SWIG %else perl ./configure %{archsuffix} OPENGL FLTK TK ACTC IMD XINPUT LIBTACHYON NETCDF TCL PYTHON PTHREADS NUMPY RPM TKCON SWIG %endif # remove traces of rpm build system in configuration sed -e 's,DEF_VMDENVVAR.*,DEF_VMDENVVAR "%{_libdir}/%{namd}",' < src/config.h > src/config.h.new mv src/config.h.new src/config.h # fix up sources for debuginfo sed -e 's,lex.yy.c,AtomLexer.C,' < src/AtomLexer.C > src/AtomLexer.C.new mv src/AtomLexer.C.new src/AtomLexer.C make -C src depend make -C src VMDEXTRALIBS="%{netcdflib} -lnetcdf -lexpat -ljpeg -lpng -lz" # for doc section mv proteins ../ cp LICENSE README Announcement ../ cp ChangeLog ../ChangeLog.vmd || touch ../ChangeLog.vmd test -f doc/ig.pdf || make -C doc ps ps2pdf %install rm -rf ${RPM_BUILD_ROOT} mkdir -p ${RPM_BUILD_ROOT}%{_usr}/bin mkdir -p ${RPM_BUILD_ROOT}%{_usr}/share/applications mkdir -p ${RPM_BUILD_ROOT}%{_usr}/share/pixmaps make -C ${RPM_BUILD_DIR}/%{name}-%{version}/%{name}/src install mkdir -p ${RPM_BUILD_ROOT}%{_libdir}/%{name}/scripts/init.d # remove traces from installation to temporary location sed -e "s,${RPM_BUILD_ROOT},,g" ${RPM_BUILD_ROOT}%{_usr}/bin/vmd \ > ${RPM_BUILD_ROOT}%{_usr}/bin/vmd.new mv ${RPM_BUILD_ROOT}%{_usr}/bin/vmd.new ${RPM_BUILD_ROOT}%{_usr}/bin/vmd # support for desktop environments cp %{SOURCE1} ${RPM_BUILD_ROOT}%{_usr}/share/applications/ cp %{SOURCE2} ${RPM_BUILD_ROOT}%{_usr}/share/pixmaps/ cp %{SOURCE3} ${RPM_BUILD_ROOT}%{_usr}/share/pixmaps/ cp %{SOURCE4} ${RPM_BUILD_ROOT}%{_usr}/share/pixmaps/ cp %{SOURCE5} ${RPM_BUILD_ROOT}%{_usr}/share/pixmaps/ cp %{SOURCE6} ${RPM_BUILD_ROOT}%{_usr}/share/pixmaps/ # add external utility programs # tachyon cp ${RPM_BUILD_DIR}/%{name}-%{version}/tachyon/lib_%{archsuffix}/tachyon \ ${RPM_BUILD_ROOT}%{_libdir}/%{name}/tachyon_%{archsuffix} # surf cp ${RPM_BUILD_DIR}/%{name}-%{version}/%{name}/lib/surf/surf_%{archsuffix} \ ${RPM_BUILD_ROOT}%{_libdir}/%{name}/surf_%{archsuffix} # stride cp ${RPM_BUILD_DIR}/%{name}-%{version}/%{name}/lib/stride/stride_%{archsuffix} \ ${RPM_BUILD_ROOT}%{_libdir}/%{name}/stride_%{archsuffix} %if %{havecuda} cp %{cuda_home}/lib/libcudart.so.? ${RPM_BUILD_ROOT}%{_libdir}/%{name}/ %endif # add vmd python module cp ${RPM_BUILD_DIR}/%{name}-%{version}/vmd/vmd.so ${RPM_BUILD_ROOT}%{_libdir}/%{name}/vmd.so # and the swig generated version cp ${RPM_BUILD_DIR}/%{name}-%{version}/vmd/vmdpy.py ${RPM_BUILD_ROOT}%{_libdir}/%{name}/vmdpy.py ln -s vmd.so ${RPM_BUILD_ROOT}%{_libdir}/%{name}/_vmdpy.so # add script wrappers for catdcd and cionize cat > ${RPM_BUILD_ROOT}%{_usr}/bin/catdcd < ${RPM_BUILD_ROOT}%{_usr}/bin/cionize < - 1.8.7-%{pkgrel}.%{distver} - massive rewrite to handle vmd-1.8.7 cvs snapshots and newer fedora distributions * Mon Aug 21 2006 Axel Kohlmeyer - 1.8.5-1fc5 - include wrapper for catdcd and default to internal babel. * Fri Aug 19 2006 Axel Kohlmeyer - 1.8.5-1fc5 - include compilation of netcdf * Fri Aug 18 2006 Axel Kohlmeyer - 1.8.5-1fc5 - more complete version to be bundled with VMD 1.8.5 for building on FC5 * Wed Apr 12 2006 Axel Kohlmeyer - 1.8.4-1fc4 - first version of spec file for compiling from source on FC4/x86.