%define fftw_major_ver 3
%define fftw_ver %{fftw_major_ver}.0.1
%def_disable static
Name: gromacs
Version: 4.0.3
Release: alt1
Summary: Molecular dynamics package (non-mpi version)
License: GPL
Group: Sciences/Chemistry
Url: http://www.gromacs.org
Source: ftp://ftp.gromacs.org/pub/gromacs/%name-%version.tar.gz
Packager: Michael Shigorin <mike@altlinux.org>
Requires: lib%name = %version-%release
BuildRequires: libfftw%fftw_major_ver-devel >= %fftw_ver
BuildRequires: gcc-fortran lesstif-devel
BuildRequires: xorg-devel libX11-devel libgsl-devel openmpi-devel
BuildRequires: libatlas-devel liblapack-devel
BuildRequires: build-environment mpi-selector
%description
GROMACS is a versatile and extremely well optimized package
to perform molecular dynamics computer simulations and
subsequent trajectory analysis. It is developed for
biomolecules like proteins, but the extremely high
performance means it is used also in several other field
like polymer chemistry and solid state physics. This
version has the dynamic libs and executables; to hack new
utility programs you also need the headers and static
libs in gromacs-devel*. Linux kernel 2.4 or later is STRONGLY
recommended on Pentium III and later processors since
GROMACS then can use assembly loops with SSE instructions.
You can also perform parallel simulations if you install
gromacs-lammpi.
%package -n lib%name
Summary: Shared libraries for GROMACS
Group: Sciences/Chemistry
#Requires: libfftw%fftw_major_ver >= %fftw_ver
%description -n lib%name
This package contains shared libraries for GROMACS.
%package -n lib%name-devel
Summary: Header files and development part of libraries for GROMACS
Group: Development/C++
Requires: lib%name = %version-%release
%description -n lib%name-devel
This package contains header files, development part of
libraries, and a program example for the GROMACS molecular
dynamics software. You need it if you want to write your
own analysis programs.
%package -n lib%name-devel-static
Summary: Header files and static libraries for GROMACS
Group: Development/C++
Requires: %name-devel = %version-%release
%description -n lib%name-devel-static
This package contains static libraries for the GROMACS molecular
dynamics software. You need it if you want to build your
programs statically against GROMACS (which you probably don't).
%package doc
Summary: Documentation for GROMACS
Group: Development/Documentation
Requires: %name = %version-%release
%description doc
This package contains documentation for GROMACS.
%package tutorial
Summary: Tutorial for GROMACS
Group: Development/Documentation
Requires: %name = %version-%release
%description tutorial
This package contains tutorial for GROMACS.
%prep
%setup -q
%build
PATH=$PATH:/usr/lib/openmpi/bin
export PATH
ROWNUM="`egrep -n LDADD src/tools/Makefile.am |awk -F : '{print $1}'`"
LINKS="-L/usr/lib/openmpi/lib/openmpi -L..\/gmxlib\/.libs -lgmx@LIBSUFFIX@"
LINKS="$LINKS -L..\/mdlib\/.libs -lmd@LIBSUFFIX@"
export CFLAGS='-pipe -Wall -O2 -march=pentium4 -Wa,--noexecstack -fPIC'
export LIBS="-lblas -llapack"
sed -i \
-e "${ROWNUM}a\\CFLAGS = @CFLAGS@ $LIBS $LINKS" \
-e "${ROWNUM},$(($ROWNUM + 1))d" \
src/tools/Makefile.am
%autoreconf
sed -i \
-e 's/^\(editconf_LDADD\ \=\ .*\)/\1 .libs\/gmx_editconf.o/' \
-e 's/^\(eneconv_LDADD\ \=\ .*\)/\1 .libs\/gmx_eneconv.o/' \
-e 's/^\(genbox_LDADD\ \=\ .*\)/\1 .libs\/addconf.o .libs\/gmx_genbox.o/' \
-e 's/^\(genrestr_LDADD\ \=\ .*\)/\1 .libs\/gmx_genpr.o/' \
-e 's/^\(genconf_LDADD\ \=\ .*\)/\1 .libs\/gmx_genconf.o/' \
-e 's/^\(g_nmtraj_LDADD\ \=\ .*\)/\1 .libs\/eigio.o .libs\/gmx_nmtraj.o/' \
-e 's/^\(trjcat_LDADD\ \=\ .*\)/\1 .libs\/gmx_trjcat.o/' \
-e 's/^\(trjconv_LDADD\ \=\ .*\)/\1 .libs\/gmx_trjconv.o/' \
-e 's/^\(trjorder_LDADD\ \=\ .*\)/\1 .libs\/gmx_trjorder.o/' \
-e 's/^\(wheel_LDADD\ \=\ .*\)/\1 .libs\/gmx_wheel.o/' \
-e 's/^\(xpm2ps_LDADD\ \=\ .*\)/\1 .libs\/gmx_xpm2ps.o/' \
-e 's/^\(genion_LDADD\ \=\ .*\)/\1 .libs\/calcpot.o .libs\/gmx_genion.o/' \
-e 's/^\(anadock_LDADD\ \=\ .*\)/\1 .libs\/lsq.o/' \
-e 's/^\(make_edi_LDADD\ \=\ .*\)/\1 .libs\/eigio.o/' \
-e 's/^\(g_analyze_LDADD\ \=\ .*\)/\1 .libs\/levenmar.o .libs\/expfit.o .libs\/correl.o .libs\/polynomials.o .libs\/autocorr.o .libs\/gmx_hbond.o .libs\/gmx_analyze.o/' \
-e 's/^\(g_anaeig_LDADD\ \=\ .*\)/\1 .libs\/eigio.o .libs\/gmx_anaeig.o/' \
-e 's/^\(g_angle_LDADD\ \=\ .*\)/\1 .libs\/levenmar.o .libs\/expfit.o .libs\/correl.o .libs\/polynomials.o .libs\/autocorr.o .libs\/dlist.o .libs\/anadih.o .libs\/gmx_angle.o/' \
-e 's/^\(g_bond_LDADD\ \=\ .*\)/\1 .libs\/lsq.o .libs\/gmx_bond.o/' \
-e 's/^\(g_bundle_LDADD\ \=\ .*\)/\1 .libs\/gmx_bundle.o/' \
-e 's/^\(g_cluster_LDADD\ \=\ .*\)/\1 .libs\/eigensolver.o .libs\/cmat.o .libs\/gmx_cluster.o/' \
-e 's/^\(g_chi_LDADD\ \=\ .*\)/\1 .libs\/pp2shift.o .libs\/levenmar.o .libs\/polynomials.o .libs\/expfit.o .libs\/correl.o .libs\/autocorr.o .libs\/dlist.o .libs\/anadih.o .libs\/gmx_chi.o/' \
-e 's/^\(g_confrms_LDADD\ \=\ .*\)/\1 .libs\/gmx_confrms.o/' \
-e 's/^\(g_covar_LDADD\ \=\ .*\)/\1 .libs\/eigensolver.o .libs\/eigio.o .libs\/gmx_covar.o/' \
-e 's/^\(g_current_LDADD\ \=\ .*\)/\1 .libs\/gmx_current.o/' \
-e 's/^\(g_densmap_LDADD\ \=\ .*\)/\1 .libs\/gmx_densmap.o/' \
-e 's/^\(g_density_LDADD\ \=\ .*\)/\1 .libs\/gmx_density.o/' \
-e 's/^\(g_dih_LDADD\ \=\ .*\)/\1 .libs\/gmx_dih.o/' \
-e 's/^\(g_dielectric_LDADD\ \=\ .*\)/\1 .libs\/levenmar.o .libs\/polynomials.o .libs\/expfit.o .libs\/correl.o .libs\/autocorr.o .libs\/gmx_dielectric.o/' \
-e 's/^\(g_helixorient_LDADD\ \=\ .*\)/\1 .libs\/gmx_helixorient.o/' \
-e 's/^\(g_principal_LDADD\ \=\ .*\)/\1 .libs\/gmx_principal.o/' \
-e 's/^\(g_dipoles_LDADD\ \=\ .*\)/\1 .libs\/lsq.o .libs\/levenmar.o .libs\/polynomials.o .libs\/expfit.o .libs\/correl.o .libs\/autocorr.o .libs\/gmx_dipoles.o/' \
-e 's/^\(g_disre_LDADD\ \=\ .*\)/\1 .libs\/gmx_disre.o/' \
-e 's/^\(g_dyndom_LDADD\ \=\ .*\)/\1 .libs\/gmx_dyndom.o/' \
-e 's/^\(g_dist_LDADD\ \=\ .*\)/\1 .libs\/gmx_dist.o/' \
-e 's/^\(g_enemat_LDADD\ \=\ .*\)/\1 .libs\/gmx_enemat.o/' \
-e 's/^\(g_energy_LDADD\ \=\ .*\)/\1 .libs\/levenmar.o .libs\/polynomials.o .libs\/expfit.o .libs\/correl.o .libs\/autocorr.o .libs\/gmx_energy.o/' \
-e 's/^\(g_lie_LDADD\ \=\ .*\)/\1 .libs\/gmx_lie.o/' \
-e 's/^\(g_filter_LDADD\ \=\ .*\)/\1 .libs\/gmx_filter.o/' \
-e 's/^\(g_gyrate_LDADD\ \=\ .*\)/\1 .libs\/levenmar.o .libs\/polynomials.o .libs\/expfit.o .libs\/correl.o .libs\/autocorr.o .libs\/gmx_gyrate.o/' \
-e 's/^\(g_h2order_LDADD\ \=\ .*\)/\1 .libs\/gmx_h2order.o/' \
-e 's/^\(g_hbond_LDADD\ \=\ .*\)/\1 .libs\/levenmar.o .libs\/expfit.o .libs\/correl.o .libs\/polynomials.o .libs\/autocorr.o .libs\/gmx_hbond.o/' \
-e 's/^\(g_helix_LDADD\ \=\ .*\)/\1 .libs\/hxprops.o .libs\/fitahx.o .libs\/gmx_helix.o/' \
-e 's/^\(g_mindist_LDADD\ \=\ .*\)/\1 .libs\/gmx_mindist.o/' \
-e 's/^\(g_msd_LDADD\ \=\ .*\)/\1 .libs\/lsq.o .libs\/gmx_msd.o/' \
-e 's/^\(g_morph_LDADD\ \=\ .*\)/\1 .libs\/gmx_morph.o/' \
-e 's/^\(g_nmeig_LDADD\ \=\ .*\)/\1 .libs\/eigensolver.o .libs\/eigio.o .libs\/gmx_nmeig.o/' \
-e 's/^\(g_nmens_LDADD\ \=\ .*\)/\1 .libs\/eigensolver.o .libs\/eigio.o .libs\/gmx_nmens.o/' \
-e 's/^\(g_polystat_LDADD\ \=\ .*\)/\1 .libs\/gmx_polystat.o/' \
-e 's/^\(g_order_LDADD\ \=\ .*\)/\1 .libs\/gmx_order.o/' \
-e 's/^\(g_potential_LDADD\ \=\ .*\)/\1 .libs\/gmx_potential.o/' \
-e 's/^\(g_rama_LDADD\ \=\ .*\)/\1 .libs\/gmx_rama.o/' \
-e 's/^\(g_rms_LDADD\ \=\ .*\)/\1 .libs\/cmat.o .libs\/gmx_rms.o/' \
-e 's/^\(g_rdf_LDADD\ \=\ .*\)/\1 .libs\/levenmar.o .libs\/expfit.o .libs\/correl.o .libs\/polynomials.o .libs\/autocorr.o .libs\/gmx_rdf.o/' \
-e 's/^\(g_rmsdist_LDADD\ \=\ .*\)/\1 .libs\/gmx_rmsdist.o/' \
-e 's/^\(g_rmsf_LDADD\ \=\ .*\)/\1 .libs\/eigensolver.o .libs\/gmx_rmsf.o/' \
-e 's/^\(g_rotacf_LDADD\ \=\ .*\)/\1 .libs\/levenmar.o .libs\/expfit.o .libs\/correl.o .libs\/polynomials.o .libs\/autocorr.o .libs\/gmx_rotacf.o/' \
-e 's/^\(g_saltbr_LDADD\ \=\ .*\)/\1 .libs\/gmx_saltbr.o/' \
-e 's/^\(g_sas_LDADD\ \=\ .*\)/\1 .libs\/nsc.o .libs\/gmx_sas.o/' \
-e 's/^\(g_sgangle_LDADD\ \=\ .*\)/\1 .libs\/gmx_sgangle.o/' \
-e 's/^\(g_sham_LDADD\ \=\ .*\)/\1 .libs\/gmx_sham.o/' \
-e 's/^\(g_sorient_LDADD\ \=\ .*\)/\1 .libs\/gmx_sorient.o/' \
-e 's/^\(g_spol_LDADD\ \=\ .*\)/\1 .libs\/gmx_spol.o/' \
-e 's/^\(g_sdf_LDADD\ \=\ .*\)/\1 .libs\/gmx_sdf.o/' \
-e 's/^\(g_spatial_LDADD\ \=\ .*\)/\1 .libs\/gmx_spatial.o/' \
-e 's/^\(g_tcaf_LDADD\ \=\ .*\)/\1 .libs\/levenmar.o .libs\/expfit.o .libs\/correl.o .libs\/polynomials.o .libs\/autocorr.o .libs\/gmx_tcaf.o/' \
-e 's/^\(g_traj_LDADD\ \=\ .*\)/\1 .libs\/gmx_traj.o/' \
-e 's/^\(g_vanhove_LDADD\ \=\ .*\)/\1 .libs\/gmx_vanhove.o/' \
-e 's/^\(g_velacc_LDADD\ \=\ .*\)/\1 .libs\/levenmar.o .libs\/expfit.o .libs\/correl.o .libs\/polynomials.o .libs\/autocorr.o .libs\/gmx_velacc.o/' \
-e 's/^\(g_clustsize_LDADD\ \=\ .*\)/\1 .libs\/gmx_clustsize.o/' \
-e 's/^\(g_mdmat_LDADD\ \=\ .*\)/\1 .libs\/gmx_mdmat.o/' \
-e 's/^\(g_wham_LDADD\ \=\ .*\)/\1 .libs\/gmx_wham.o/' \
-e 's/^\(g_kinetics_LDADD\ \=\ .*\)/\1 .libs\/gmx_kinetics.o/' \
src/tools/Makefile.in
%configure \
--disable-rpath \
--enable-static=no \
--enable-shared \
--enable-double \
--enable-fortran \
--enable-mpi \
--enable-prefetch-forces \
--with-gnu-ld \
--with-fft=fftw%fftw_major_ver \
--with-x \
--with-gsl
sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' libtool
sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool
%make_build
%install
PATH=$PATH:/usr/lib/openmpi/bin
export PATH
%make_install DESTDIR=%buildroot install
%files
%doc AUTHORS COPYING README INSTALL
%_bindir/*
%_man1dir/*
%_datadir/%name
%exclude %_datadir/%name/tutor
%exclude %_datadir/%name/html
%files -n lib%name
%_libdir/*.so.*
%files -n lib%name-devel
%_includedir/%name
%_libdir/*.so
%if_enabled static
%files -n lib%name-devel-static
%_libdir/*.la
%endif
%files doc
%_datadir/%name/html
%files tutorial
%_datadir/%name/tutor
# TODO:
# - build mpi-enabled version from the same spec?
# (see gromacs-mpi.spec in admin/)
# - (maybe) build motif UI from the same spec
%changelog
* Thu Jan 29 2009 Eugeny A. Rostovtsev (REAL) <real@altlinux.org> 4.0.3-alt1
- 4.0.3
* Thu Jan 04 2007 Michael Shigorin <mike@altlinux.org> 3.3.1-alt1
- built for ALT Linux (based on Mandriva contrib spec
by Lenny Cartier <lenny/mandriva.com> and original
one by Erik Lindahl <lindahl/gromacs.org>)
- disable GUI build by default
* Tue Apr 11 2006 Lenny Cartier <lenny@mandriva.com> 3.3.1-1mdk
- 3.3.1
* Mon Nov 07 2005 Nicolas Lйcureuil <neoclust@mandriva.org> 3.3-2mdk
- Fix BuildRequires
* Thu Oct 20 2005 Lenny Cartier <lenny@mandriva.com> 3.3-1mdk
- 3.3
* Fri Jun 04 2004 Lenny Cartier <lenny@mandrakesoft.com> 3.2.1-1mdk
- 3.2.1
* Wed Apr 30 2003 Lenny Cartier <lenny@mandrakesoft.com> 3.1.4-3mdk
- buildrequires
* Sun Feb 02 2003 Lenny Cartier <lenny@mandrakesoft.com> 3.1.4-2mdk
- rebuild
* Tue Dec 05 2002 Lenny Cartier <lenny@mandrakesoft.com> 3.1.4-1mdk
- from Austin Acton <aacton@yorkul.ca> :
- initial package for Mandrake 9.0+