f322e3
Name:		gromacs
32e947
Version:	4.0.5
32e947
Release:	1%{?dist}
32e947
Summary:	Fast, Free and Flexible Molecular Dynamics
f322e3
Group:		Applications/Engineering
f322e3
License:	GPLv2+
f322e3
URL:		http://www.gromacs.org
32e947
BuildRoot:	%{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
f322e3
Source0:	ftp://ftp.gromacs.org/pub/gromacs/gromacs-%{version}.tar.gz
32e947
Source1:	ftp://ftp.gromacs.org/pub/manual/manual-4.0.pdf
f322e3
Source2:	gromacs-template-makefile-single
f322e3
Source3:	gromacs-template-makefile-double
f322e3
Source4:	gromacs-template-makefile-mpi-single
f322e3
Source5:	gromacs-template-makefile-mpi-double
f322e3
Source6:	gromacs-README.fedora
f322e3
f322e3
# Add shebangs to scripts
f322e3
Patch0:		gromacs-GMXRC.patch
32e947
# Patch gmxdemo for new filenames
32e947
Patch1:		gromacs-gmxdemo.patch
32e947
# Patch configure for the library suffix
32e947
Patch2:		gromacs-configure.patch
f322e3
32e947
Requires:	gromacs-common = %{version}-%{release}
f322e3
f322e3
BuildRequires:	fftw-devel
f322e3
BuildRequires:	gsl-devel
f322e3
BuildRequires:	libxml2-devel
f322e3
BuildRequires:	openmpi-devel
f322e3
f322e3
%if 0%{?rhel} == 4
f322e3
BuildRequires:	blas
f322e3
BuildRequires:	lapack
f322e3
BuildRequires:	xorg-x11-devel
f322e3
%else
f322e3
BuildRequires:	blas-devel
f322e3
BuildRequires:	lapack-devel
f322e3
BuildRequires:	libX11-devel
f322e3
%endif
f322e3
f322e3
# Check for mpi-selector or environment-modules
f322e3
32e947
%global selector 0
32e947
%global modules 0
f322e3
f322e3
%if 0%{?fedora} > 9
32e947
%global modules 1
f322e3
%endif
f322e3
f322e3
%if 0%{?rhel} == 4
32e947
%global selector 1
f322e3
%endif
f322e3
f322e3
%if 0%{?rhel} == 5
32e947
%global selector 1
f322e3
%endif
f322e3
f322e3
%if %modules == 1
f322e3
BuildRequires:	environment-modules
f322e3
%endif
f322e3
f322e3
%if %selector == 1
f322e3
BuildRequires:	mpi-selector
f322e3
%endif
f322e3
f322e3
f322e3
%description
32e947
GROMACS is a versatile and extremely well optimized package to perform
32e947
molecular dynamics computer simulations and subsequent trajectory analysis.
32e947
It is developed for biomolecules like proteins, but the extremely high
32e947
performance means it is used also in several other field like polymer chemistry
32e947
and solid state physics.
f322e3
f322e3
This package provides single and double precision binaries.
f322e3
The documentation is in the package gromacs-common.
f322e3
32e947
N.B. All binaries have names starting with g_, for example mdrun has been
32e947
renamed to g_mdrun.
32e947
32e947
32e947
%package debug
32e947
Summary:	GROMACS debugging binaries without assembly loops
32e947
Group:		Applications/Engineering
32e947
Requires:	gromacs-common = %{version}-%{release}
32e947
32e947
%description debug
32e947
GROMACS is a versatile and extremely well optimized package to perform
32e947
molecular dynamics computer simulations and subsequent trajectory analysis.
32e947
It is developed for biomolecules like proteins, but the extremely high
32e947
performance means it is used also in several other field like polymer chemistry
32e947
and solid state physics.
32e947
32e947
This package provides debugging versions of single and
32e947
double precision binaries, compiled without assembly loops.
32e947
The documentation is in the package gromacs-common.
32e947
You do not want this package for production purposes.
32e947
32e947
N.B. All binaries have names starting with g_, for example mdrun has been
32e947
renamed to g_mdrun.
32e947
f322e3
f322e3
%package libs
f322e3
Summary:	GROMACS libraries
f322e3
Group:		Applications/Engineering
f322e3
Requires:	gromacs-common = %{version}-%{release}
f322e3
f322e3
%description libs
32e947
GROMACS is a versatile and extremely well optimized package to perform
32e947
molecular dynamics computer simulations and subsequent trajectory analysis.
32e947
It is developed for biomolecules like proteins, but the extremely high
32e947
performance means it is used also in several other field like polymer chemistry
32e947
and solid state physics.
32e947
32e947
This package provides runtime libraries needed for the single and double
32e947
precision binaries.
32e947
32e947
32e947
%package debug-libs
32e947
Summary:	GROMACS libraries without assembly loops for debugging
32e947
Group:		Applications/Engineering
32e947
Requires:	gromacs-common = %{version}-%{release}
32e947
32e947
%description debug-libs
32e947
GROMACS is a versatile and extremely well optimized package to perform
32e947
molecular dynamics computer simulations and subsequent trajectory analysis.
32e947
It is developed for biomolecules like proteins, but the extremely high
32e947
performance means it is used also in several other field like polymer chemistry
32e947
and solid state physics.
32e947
32e947
This package provides runtime libraries needed for the debugging versions of
32e947
the single and double precision binaries.
f322e3
f322e3
f322e3
f322e3
%package mpi
f322e3
Summary:	GROMACS MPI binaries
f322e3
Group:		Applications/Engineering
f322e3
Requires:	gromacs-common = %{version}-%{release}
f322e3
f322e3
%description mpi
32e947
GROMACS is a versatile and extremely well optimized package to perform
32e947
molecular dynamics computer simulations and subsequent trajectory analysis.
32e947
It is developed for biomolecules like proteins, but the extremely high
32e947
performance means it is used also in several other field like polymer chemistry
32e947
and solid state physics.
32e947
32e947
This package provides MPI single precision and double precision binaries.
32e947
32e947
32e947
%package debug-mpi
32e947
Summary:	GROMACS debugging MPI binaries without assembly loops
32e947
Group:		Applications/Engineering
32e947
Requires:	gromacs-common = %{version}-%{release}
32e947
32e947
%description debug-mpi
32e947
GROMACS is a versatile and extremely well optimized package to perform
32e947
molecular dynamics computer simulations and subsequent trajectory analysis.
32e947
It is developed for biomolecules like proteins, but the extremely high
32e947
performance means it is used also in several other field like polymer chemistry
32e947
and solid state physics.
32e947
32e947
This package provides debugging versions of MPI single precision and double
f322e3
precision binaries.
f322e3
f322e3
32e947
f322e3
%package common
f322e3
Summary:	GROMACS shared data and documentation
f322e3
Group:		Applications/Engineering
f322e3
f322e3
%description common
32e947
GROMACS is a versatile and extremely well optimized package to perform
32e947
molecular dynamics computer simulations and subsequent trajectory analysis.
32e947
It is developed for biomolecules like proteins, but the extremely high
32e947
performance means it is used also in several other field like polymer chemistry
32e947
and solid state physics.
f322e3
32e947
This package includes architecture independent data and documentation.
f322e3
f322e3
f322e3
%package devel
f322e3
Summary:	GROMACS header files and development libraries
f322e3
Group:		Applications/Engineering
f322e3
Requires:	gromacs-common = %{version}-%{release}
f322e3
Requires:	gromacs-libs = %{version}-%{release}
f322e3
f322e3
%description devel
32e947
GROMACS is a versatile and extremely well optimized package to perform
32e947
molecular dynamics computer simulations and subsequent trajectory analysis.
32e947
It is developed for biomolecules like proteins, but the extremely high
32e947
performance means it is used also in several other field like polymer chemistry
32e947
and solid state physics.
32e947
32e947
This package contains header files and development libraries for the GROMACS
32e947
molecular dynamics software. You need it if you want to write your own analysis
32e947
programs.
32e947
32e947
32e947
32e947
%package debug-devel
32e947
Summary:	GROMACS debugging header files and development libraries
32e947
Group:		Applications/Engineering
32e947
Requires:	gromacs-common = %{version}-%{release}
32e947
Requires:	gromacs-devel = %{version}-%{release}
32e947
Requires:	gromacs-debug-libs = %{version}-%{release}
32e947
32e947
%description debug-devel
32e947
GROMACS is a versatile and extremely well optimized package to perform
32e947
molecular dynamics computer simulations and subsequent trajectory analysis.
32e947
It is developed for biomolecules like proteins, but the extremely high
32e947
performance means it is used also in several other field like polymer chemistry
32e947
and solid state physics.
32e947
32e947
This package contains header files and development libraries for the debugging
32e947
version of the GROMACS molecular dynamics software.
f322e3
f322e3
f322e3
f322e3
%package mpi-devel
f322e3
Summary:	GROMACS MPI development libraries
f322e3
Group:		Applications/Engineering
f322e3
Requires:	gromacs-mpi-libs = %{version}-%{release}
32e947
Requires:	gromacs-devel = %{version}-%{release}
4d7ea8
# Need to have this so that yum doesn't install LAM instead
4d7ea8
Requires:	openmpi
f322e3
f322e3
%description mpi-devel
32e947
GROMACS is a versatile and extremely well optimized package to perform
32e947
molecular dynamics computer simulations and subsequent trajectory analysis.
32e947
It is developed for biomolecules like proteins, but the extremely high
32e947
performance means it is used also in several other field like polymer chemistry
32e947
and solid state physics.
f322e3
f322e3
This package contains development libraries for GROMACS MPI.
f322e3
You need it if you want to write your own analysis programs.
f322e3
f322e3
32e947
%package debug-mpi-devel
32e947
Summary:	GROMACS debugging MPI development libraries
32e947
Group:		Applications/Engineering
32e947
Requires:	gromacs-debug-mpi-libs = %{version}-%{release}
32e947
Requires:	gromacs-debug-devel = %{version}-%{release}
32e947
# Need to have this so that yum doesn't install LAM instead
32e947
Requires:	openmpi
32e947
32e947
%description debug-mpi-devel
32e947
GROMACS is a versatile and extremely well optimized package to perform
32e947
molecular dynamics computer simulations and subsequent trajectory analysis.
32e947
It is developed for biomolecules like proteins, but the extremely high
32e947
performance means it is used also in several other field like polymer chemistry
32e947
and solid state physics.
32e947
32e947
This package contains debugging versions of development libraries for the MPI
32e947
version of GROMACS.
32e947
32e947
f322e3
%package mpi-libs
32e947
Summary:	GROMACS MPI libraries
f322e3
Group:		Applications/Engineering
f322e3
Requires:	gromacs-common = %{version}-%{release}
4d7ea8
# Need to have this so that yum doesn't install LAM instead
4d7ea8
Requires:	openmpi
f322e3
f322e3
%description mpi-libs
32e947
GROMACS is a versatile and extremely well optimized package to perform
32e947
molecular dynamics computer simulations and subsequent trajectory analysis.
32e947
It is developed for biomolecules like proteins, but the extremely high
32e947
performance means it is used also in several other field like polymer chemistry
32e947
and solid state physics.
32e947
32e947
This package provides runtime libraries needed for the MPI single and double
32e947
precision binaries.
32e947
32e947
32e947
%package debug-mpi-libs
32e947
Summary:	GROMACS debugging MPI libraries
32e947
Group:		Applications/Engineering
32e947
Requires:	gromacs-common = %{version}-%{release}
32e947
# Need to have this so that yum doesn't install LAM instead
32e947
Requires:	openmpi
f322e3
32e947
%description debug-mpi-libs
32e947
GROMACS is a versatile and extremely well optimized package to perform
32e947
molecular dynamics computer simulations and subsequent trajectory analysis.
32e947
It is developed for biomolecules like proteins, but the extremely high
32e947
performance means it is used also in several other field like polymer chemistry
32e947
and solid state physics.
32e947
32e947
This package provides debugging versions of runtime libraries needed for the
32e947
debug versions of the MPI single and double precision binaries.
f322e3
f322e3
f322e3
%package bash
f322e3
Summary:	GROMACS bash completion
f322e3
Group:		Applications/Engineering
f322e3
Requires:	bash-completion
f322e3
f322e3
%description bash
32e947
GROMACS is a versatile and extremely well optimized package to perform
32e947
molecular dynamics computer simulations and subsequent trajectory analysis.
32e947
It is developed for biomolecules like proteins, but the extremely high
32e947
performance means it is used also in several other field like polymer chemistry
32e947
and solid state physics.
f322e3
32e947
This package provides bash completion for GROMACS.
f322e3
f322e3
f322e3
%package zsh
f322e3
Summary:	GROMACS zsh support
f322e3
Group:		Applications/Engineering
f322e3
Requires:	zsh
f322e3
f322e3
%description zsh
32e947
GROMACS is a versatile and extremely well optimized package to perform
32e947
molecular dynamics computer simulations and subsequent trajectory analysis.
32e947
It is developed for biomolecules like proteins, but the extremely high
32e947
performance means it is used also in several other field like polymer chemistry
32e947
and solid state physics.
f322e3
32e947
This package provides scripts needed to run GROMACS with zsh and zsh
32e947
completion.
f322e3
f322e3
f322e3
%package csh
f322e3
Summary:	GROMACS csh support
f322e3
Group:		Applications/Engineering
f322e3
Requires:	csh
f322e3
f322e3
%description csh
32e947
GROMACS is a versatile and extremely well optimized package to perform
32e947
molecular dynamics computer simulations and subsequent trajectory analysis.
32e947
It is developed for biomolecules like proteins, but the extremely high
32e947
performance means it is used also in several other field like polymer chemistry
32e947
and solid state physics.
f322e3
32e947
This package provides scripts needed to run GROMACS with csh and a completion
32e947
script.
f322e3
f322e3
%package tutor
f322e3
Summary:	GROMACS tutorial files
f322e3
Group:		Applications/Engineering
f322e3
Requires:	gromacs-common = %{version}-%{release}
f322e3
f322e3
%description tutor
32e947
GROMACS is a versatile and extremely well optimized package to perform
32e947
molecular dynamics computer simulations and subsequent trajectory analysis.
32e947
It is developed for biomolecules like proteins, but the extremely high
32e947
performance means it is used also in several other field like polymer chemistry
32e947
and solid state physics.
f322e3
f322e3
This package provides tutorials for the use of GROMACS.
f322e3
f322e3
%prep
f322e3
%setup -q
32e947
%patch0 -p1 -b .gmxrc
32e947
%patch1 -p1 -b .gmxdemo
32e947
%patch2 -p1 -b .libsuffix
f322e3
f322e3
# Fix incorrect permission
32e947
#chmod a-x src/tools/gmx_xpm2ps.c
f322e3
f322e3
f322e3
f322e3
%build
f322e3
# Assembly kernels haven't got .note.GNU-stack sections
f322e3
# because of incompatibilies with Microsoft Assembler.
f322e3
# Add noexecstack to compiler flags
f322e3
4d7ea8
export CFLAGS="%optflags -Wa,--noexecstack -fPIC"
f322e3
export LIBS="-lblas -llapack"
f322e3
32e947
# Default options, used for all compilations
32e947
export DEFOPTS="--enable-shared --disable-static --with-external-blas \
32e947
	--with-external-lapack --with-gsl --with-x"
32e947
export SINGLE="--enable-float" # Single precision
32e947
export DOUBLE="--disable-float" # Double precision
32e947
export MPI="--enable-mpi"
32e947
export NOASM="--disable-ia32-3dnow --disable-ia32-sse --disable-x86-64-sse \
32e947
	--disable-ppc-altivec --disable-ia64-asm"
32e947
32e947
f322e3
# Single precision
f322e3
mkdir single
f322e3
cd single
32e947
sed "s|@LIBSUFFIX@||g" < ../configure > configure; chmod 777 configure
32e947
%configure $DEFOPTS $SINGLE
32e947
sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' libtool
32e947
sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool
32e947
32e947
make %{?_smp_mflags}
32e947
cd ..
32e947
32e947
# Single precision, debug version with no assembly loops
32e947
mkdir single-debug
32e947
cd single-debug
32e947
sed "s|@LIBSUFFIX@|_debug|g" < ../configure > configure; chmod 777 configure
32e947
%configure $DEFOPTS $SINGLE $NOASM --program-suffix="_debug"
f322e3
sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' libtool
f322e3
sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool
f322e3
f322e3
make %{?_smp_mflags}
f322e3
cd ..
f322e3
32e947
32e947
f322e3
# Double precision
f322e3
mkdir double
f322e3
cd double
32e947
sed "s|@LIBSUFFIX@|_d|g" < ../configure > configure; chmod 777 configure
32e947
%configure $DEFOPTS $DOUBLE --program-suffix="_d"
32e947
sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' libtool
32e947
sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool
32e947
32e947
make %{?_smp_mflags}
32e947
cd ..
32e947
32e947
# Double precision, debug version with no assembly loops
32e947
mkdir double-debug
32e947
cd double-debug
32e947
sed "s|@LIBSUFFIX@|_d_debug|g" < ../configure > configure; chmod 777 configure
32e947
%configure $DEFOPTS $DOUBLE $NOASM --program-suffix="_d_debug"
f322e3
sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' libtool
f322e3
sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool
f322e3
f322e3
make %{?_smp_mflags}
f322e3
cd ..
f322e3
32e947
32e947
f322e3
# Load MPI enviroment
f322e3
f322e3
%if %modules == 1
f322e3
. /etc/profile.d/modules.sh
f322e3
module load %{_libdir}/openmpi/*/openmpi.module
32e947
# The module overrides CFLAGS, need to set them again..
32e947
export CFLAGS="%optflags -Wa,--noexecstack -fPIC"
f322e3
%endif
f322e3
f322e3
%if %selector == 1
f322e3
# Set MPI environment
f322e3
mpi-selector --set `mpi-selector --list | grep openmpi`
f322e3
source /etc/profile.d/mpi-selector.sh
f322e3
%endif
f322e3
f322e3
f322e3
# MPI, single precision
f322e3
f322e3
mkdir mpi-single
f322e3
cd mpi-single
32e947
sed "s|@LIBSUFFIX@|_mpi|g" < ../configure > configure; chmod 777 configure
32e947
%configure $DEFOPTS $SINGLE $MPI --program-suffix="_mpi"
32e947
sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' libtool
32e947
sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool
32e947
32e947
make %{?_smp_mflags} mdrun
32e947
#make %{?_smp_mflags}
32e947
cd ..
32e947
32e947
mkdir mpi-single-debug
32e947
cd mpi-single-debug
32e947
sed "s|@LIBSUFFIX@|_mpi_debug|g" < ../configure > configure; chmod 777 configure
32e947
%configure $DEFOPTS $SINGLE $MPI $NOASM --program-suffix="_mpi_debug"
f322e3
sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' libtool
f322e3
sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool
f322e3
f322e3
make %{?_smp_mflags} mdrun
f322e3
#make %{?_smp_mflags}
f322e3
cd ..
f322e3
32e947
32e947
f322e3
# MPI, double precision
f322e3
mkdir mpi-double
f322e3
cd mpi-double
32e947
sed "s|@LIBSUFFIX@|_mpi_d|g" < ../configure > configure; chmod 777 configure
32e947
%configure $DEFOPTS $DOUBLE $MPI --program-suffix="_mpi_d"
32e947
sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' libtool
32e947
sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool
32e947
32e947
make %{?_smp_mflags} mdrun
32e947
#make %{?_smp_mflags}
32e947
cd ..
32e947
32e947
mkdir mpi-double-debug
32e947
cd mpi-double-debug
32e947
sed "s|@LIBSUFFIX@|_mpi_d_debug|g" < ../configure > configure; chmod 777 configure
32e947
%configure $DEFOPTS $DOUBLE $MPI $NOASM --program-suffix="_mpi_d_debug"
f322e3
sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' libtool
f322e3
sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool
f322e3
f322e3
make %{?_smp_mflags} mdrun
f322e3
#make %{?_smp_mflags}
f322e3
cd ..
f322e3
f322e3
f322e3
%install
f322e3
rm -rf %{buildroot}
f322e3
32e947
# 4.0.3 needs this to build in EPEL-4
32e947
# Load MPI enviroment
32e947
%if %modules == 1
32e947
. /etc/profile.d/modules.sh
32e947
module load %{_libdir}/openmpi/*/openmpi.module
32e947
export CFLAGS="%optflags -Wa,--noexecstack -fPIC"
32e947
%endif
32e947
32e947
%if %selector == 1
32e947
# Set MPI environment
32e947
mpi-selector --set `mpi-selector --list | grep openmpi`
32e947
source /etc/profile.d/mpi-selector.sh
32e947
%endif
32e947
32e947
f322e3
# Single precision
f322e3
cd single
f322e3
make DESTDIR=%{buildroot} INSTALL="install -p" install
f322e3
cd ..
f322e3
32e947
cd single-debug
32e947
make DESTDIR=%{buildroot} INSTALL="install -p" install
32e947
cd ..
32e947
f322e3
# Double precision
f322e3
cd double
f322e3
make DESTDIR=%{buildroot} INSTALL="install -p" install
f322e3
cd ..
f322e3
32e947
cd double-debug
32e947
make DESTDIR=%{buildroot} INSTALL="install -p" install
32e947
cd ..
32e947
f322e3
f322e3
f322e3
# MPI, single precision
f322e3
cd mpi-single
f322e3
make DESTDIR=%{buildroot} INSTALL="install -p" install-mdrun
f322e3
cd ..
f322e3
32e947
cd mpi-single-debug
32e947
make DESTDIR=%{buildroot} INSTALL="install -p" install-mdrun
32e947
cd ..
32e947
32e947
f322e3
# MPI, double precision
f322e3
cd mpi-double
f322e3
make DESTDIR=%{buildroot} INSTALL="install -p" install-mdrun
f322e3
cd ..
f322e3
32e947
cd mpi-double-debug
32e947
make DESTDIR=%{buildroot} INSTALL="install -p" install-mdrun
32e947
cd ..
32e947
32e947
f322e3
# Install manual & packager's note
f322e3
install -cpm 644 %{SOURCE1} .
f322e3
install -cpm 644 %{SOURCE6} README.fedora
f322e3
f322e3
# Remove broken makefiles generated by build process
f322e3
rm -rf %{buildroot}%{_datadir}/%{name}/template/Makefil*
f322e3
# Install template makefiles
f322e3
install -cpm 644 %{SOURCE2} %{buildroot}%{_datadir}/%{name}/template/Makefile.single
f322e3
install -cpm 644 %{SOURCE3} %{buildroot}%{_datadir}/%{name}/template/Makefile.double
f322e3
install -cpm 644 %{SOURCE4} %{buildroot}%{_datadir}/%{name}/template/Makefile.mpi.single
f322e3
install -cpm 644 %{SOURCE5} %{buildroot}%{_datadir}/%{name}/template/Makefile.mpi.double
f322e3
f322e3
f322e3
# Fix GMXRC file permissions
f322e3
chmod a+x %{buildroot}%{_bindir}/GMXRC %{buildroot}%{_bindir}/GMXRC.*
f322e3
f322e3
# Rename binaries and man pages to prevent clashes
f322e3
# (This is done here so that we don't need to mess with machine generated makefiles.
f322e3
for bin in anadock do_dssp editconf eneconv genbox genconf genion genrestr gmxcheck gmxdump grompp highway luck make_edi make_ndx mdrun mk_angndx ngmx pdb2gmx protonate sigeps tpbconv trjcat trjconv trjorder wheel x2top xpm2ps xrama ; do 
f322e3
mv %{buildroot}%{_bindir}/${bin} %{buildroot}%{_bindir}/g_${bin}
32e947
mv %{buildroot}%{_bindir}/${bin}_debug %{buildroot}%{_bindir}/g_${bin}_debug
f322e3
mv %{buildroot}%{_bindir}/${bin}_d %{buildroot}%{_bindir}/g_${bin}_d
32e947
mv %{buildroot}%{_bindir}/${bin}_d_debug %{buildroot}%{_bindir}/g_${bin}_d_debug
f322e3
done
f322e3
f322e3
for bin in demux.pl xplor2gmx.pl; do
f322e3
mv %{buildroot}%{_bindir}/$bin %{buildroot}%{_bindir}/g_${bin}
f322e3
done
f322e3
f322e3
# MPI-enabled binaries (list will continue when the makefile has
f322e3
# the possibility to compile all mpi-enabled files
f322e3
for mpibin in mdrun; do
f322e3
mv %{buildroot}%{_bindir}/${mpibin}_mpi %{buildroot}%{_bindir}/g_${mpibin}_mpi
32e947
mv %{buildroot}%{_bindir}/${mpibin}_mpi_debug %{buildroot}%{_bindir}/g_${mpibin}_mpi_debug
f322e3
mv %{buildroot}%{_bindir}/${mpibin}_mpi_d %{buildroot}%{_bindir}/g_${mpibin}_mpi_d
32e947
mv %{buildroot}%{_bindir}/${mpibin}_mpi_d_debug %{buildroot}%{_bindir}/g_${mpibin}_mpi_d_debug
f322e3
done
f322e3
f322e3
# Man pages
f322e3
for bin in anadock do_dssp editconf eneconv genbox genconf genion genrestr gmxcheck gmxdump grompp highway make_edi make_ndx mdrun mk_angndx ngmx pdb2gmx protonate sigeps tpbconv trjcat trjconv trjorder wheel x2top xpm2ps xrama ; do 
f322e3
mv %{buildroot}%{_mandir}/man1/${bin}.1 %{buildroot}%{_mandir}/man1/g_${bin}.1
f322e3
mv %{buildroot}%{_mandir}/man1/${bin}_d.1 %{buildroot}%{_mandir}/man1/g_${bin}_d.1
f322e3
done
f322e3
f322e3
# Move completion files around
f322e3
chmod a-x %{buildroot}%{_bindir}/completion.*
f322e3
# Zsh
f322e3
mkdir -p %{buildroot}%{_datadir}/zsh/site-functions
f322e3
mv %{buildroot}%{_bindir}/completion.zsh %{buildroot}%{_datadir}/zsh/site-functions/gromacs
f322e3
# Bash
f322e3
mkdir -p %{buildroot}%{_sysconfdir}/bash_completion.d
f322e3
mv %{buildroot}%{_bindir}/completion.bash %{buildroot}/etc/bash_completion.d/gromacs
f322e3
# Tcsh
f322e3
mv %{buildroot}%{_bindir}/completion.csh . 
f322e3
f322e3
# Remove .la files
f322e3
rm -rf %{buildroot}/%{_libdir}/*.la
f322e3
f322e3
# Post install for libs
f322e3
f322e3
%post libs -p /sbin/ldconfig
f322e3
f322e3
%postun libs -p /sbin/ldconfig
f322e3
32e947
%post debug-libs -p /sbin/ldconfig
32e947
32e947
%postun debug-libs -p /sbin/ldconfig
32e947
f322e3
%post mpi-libs -p /sbin/ldconfig
f322e3
f322e3
%postun mpi-libs -p /sbin/ldconfig
f322e3
32e947
%post debug-mpi-libs -p /sbin/ldconfig
32e947
32e947
%postun debug-mpi-libs -p /sbin/ldconfig
32e947
32e947
f322e3
f322e3
%clean
f322e3
rm -rf %{buildroot}
f322e3
f322e3
f322e3
f322e3
f322e3
# Files section
f322e3
f322e3
%files
f322e3
%defattr(-,root,root,-)
f322e3
%{_bindir}/*
32e947
%exclude %{_bindir}/*_debug
32e947
%exclude %{_bindir}/g_mdrun_mpi*
f322e3
%exclude %{_bindir}/GMXRC*
f322e3
32e947
%files debug
32e947
%defattr(-,root,root,-)
32e947
%{_bindir}/*_debug
32e947
%exclude %{_bindir}/g_mdrun_mpi_debug
32e947
%exclude %{_bindir}/g_mdrun_mpi_d_debug
32e947
f322e3
%files libs
f322e3
%defattr(-,root,root,-)
f322e3
%{_libdir}/libgmx.so.*
f322e3
%{_libdir}/libgmx_d.so.*
f322e3
%{_libdir}/libgmxana.so.*
f322e3
%{_libdir}/libgmxana_d.so.*
f322e3
%{_libdir}/libmd.so.*
f322e3
%{_libdir}/libmd_d.so.*
f322e3
32e947
%files debug-libs
32e947
%defattr(-,root,root,-)
32e947
%{_libdir}/libgmx_debug.so.*
32e947
%{_libdir}/libgmx_d_debug.so.*
32e947
%{_libdir}/libgmxana_debug.so.*
32e947
%{_libdir}/libgmxana_d_debug.so.*
32e947
%{_libdir}/libmd_debug.so.*
32e947
%{_libdir}/libmd_d_debug.so.*
32e947
32e947
f322e3
%files mpi
f322e3
%defattr(-,root,root,-)
f322e3
%{_bindir}/g_mdrun_mpi
f322e3
%{_bindir}/g_mdrun_mpi_d
f322e3
32e947
%files debug-mpi
32e947
%defattr(-,root,root,-)
32e947
%{_bindir}/g_mdrun_mpi_debug
32e947
%{_bindir}/g_mdrun_mpi_d_debug
f322e3
f322e3
%files mpi-libs
f322e3
%defattr(-,root,root,-)
f322e3
%{_libdir}/libgmx_mpi.so.*
f322e3
%{_libdir}/libgmx_mpi_d.so.*
f322e3
%{_libdir}/libmd_mpi.so.*
f322e3
%{_libdir}/libmd_mpi_d.so.*
f322e3
32e947
%files debug-mpi-libs
32e947
%defattr(-,root,root,-)
32e947
%{_libdir}/libgmx_mpi_debug.so.*
32e947
%{_libdir}/libgmx_mpi_d_debug.so.*
32e947
%{_libdir}/libmd_mpi_debug.so.*
32e947
%{_libdir}/libmd_mpi_d_debug.so.*
f322e3
f322e3
f322e3
%files common
f322e3
%defattr(-,root,root,-)
32e947
%doc AUTHORS COPYING README manual-4.0.pdf README.fedora
f322e3
%{_bindir}/GMXRC
f322e3
%{_bindir}/GMXRC.bash
f322e3
%{_mandir}/man1/*
f322e3
%{_datadir}/%{name}
f322e3
%exclude %{_datadir}/%{name}/template
f322e3
%exclude %{_datadir}/%{name}/tutor
f322e3
f322e3
%files devel
f322e3
%defattr(-,root,root,-)
f322e3
%{_includedir}/%{name}
f322e3
%{_libdir}/libgmx.so
f322e3
%{_libdir}/libgmx_d.so
f322e3
%{_libdir}/libgmxana.so
f322e3
%{_libdir}/libgmxana_d.so
f322e3
%{_libdir}/libmd.so
f322e3
%{_libdir}/libmd_d.so
f322e3
%{_datadir}/%{name}/template
f322e3
%exclude %{_datadir}/%{name}/template/Makefile.mpi.*
f322e3
32e947
%files debug-devel
32e947
%defattr(-,root,root,-)
32e947
%{_libdir}/libgmx_debug.so
32e947
%{_libdir}/libgmx_d_debug.so
32e947
%{_libdir}/libgmxana_debug.so
32e947
%{_libdir}/libgmxana_d_debug.so
32e947
%{_libdir}/libmd_debug.so
32e947
%{_libdir}/libmd_d_debug.so
32e947
f322e3
%files mpi-devel
f322e3
%defattr(-,root,root,-)
f322e3
%{_libdir}/libgmx_mpi.so
f322e3
%{_libdir}/libgmx_mpi_d.so
f322e3
%{_libdir}/libmd_mpi.so
f322e3
%{_libdir}/libmd_mpi_d.so
f322e3
%{_datadir}/%{name}/template/Makefile.mpi.*
f322e3
32e947
%files debug-mpi-devel
32e947
%defattr(-,root,root,-)
32e947
%{_libdir}/libgmx_mpi_debug.so
32e947
%{_libdir}/libgmx_mpi_d_debug.so
32e947
%{_libdir}/libmd_mpi_debug.so
32e947
%{_libdir}/libmd_mpi_d_debug.so
32e947
f322e3
f322e3
%files zsh
f322e3
%defattr(-,root,root,-)
f322e3
%{_datadir}/zsh/site-functions/gromacs
f322e3
%{_bindir}/GMXRC.zsh
f322e3
f322e3
%files bash
f322e3
%defattr(-,root,root,-)
f322e3
%config(noreplace) %{_sysconfdir}/bash_completion.d/gromacs
f322e3
f322e3
f322e3
%files csh
f322e3
%defattr(-,root,root,-)
f322e3
%doc completion.csh
f322e3
%{_bindir}/GMXRC.csh
f322e3
f322e3
%files tutor
f322e3
%defattr(-,root,root,-)
f322e3
%{_datadir}/%{name}/tutor
f322e3
f322e3
f322e3
%changelog
32e947
* Fri May 22 2009 Jussi Lehtola <jussi.lehtola@iki.fi> - 4.0.5-1
32e947
- Update to 4.0.5.
32e947
- Change spec %%defines to %%globals.
32e947
- Add debug subpackages to make debugging of GROMACS possible.
32e947
32e947
* Tue Feb 17 2009 Jussi Lehtola <jussi.lehtola@iki.fi> - 4.0.4-1
32e947
- Update to 4.0.4.
32e947
32e947
* Mon Jan 19 2009 Jussi Lehtola <jussi.lehtola@iki.fi> - 4.0.3-4
32e947
- Retry fixing gmxdemo.
32e947
32e947
* Mon Jan 19 2009 Jussi Lehtola <jussi.lehtola@iki.fi> - 4.0.3-3
32e947
- Fixed gmxdemo.
32e947
32e947
* Mon Jan 19 2009 Jussi Lehtola <jussi.lehtola@iki.fi> - 4.0.3-2
32e947
- Fix EPEL 4 build.
32e947
32e947
* Mon Jan 19 2009 Jussi Lehtola <jussi.lehtola@iki.fi> - 4.0.3-1
32e947
- Update to 4.0.3.
32e947
32e947
* Wed Jan 14 2009 Jussi Lehtola <jussi.lehtola@iki.fi> - 4.0.2-7
32e947
- Update manual to latest version.
32e947
- Removed Requires: blas and lapack.
32e947
32e947
* Mon Nov 10 2008 Jussi Lehtola <jussi.lehtola@iki.fi> - 4.0.2-6
a1e9bd
- Update to 4.0.2.
a1e9bd
32e947
* Sun Nov 09 2008 Jussi Lehtola <jussi.lehtola@iki.fi> - 4.0.1-5
2c40ef
- Add Requires: blas too.
2c40ef
32e947
* Sun Nov 09 2008 Jussi Lehtola <jussi.lehtola@iki.fi> - 4.0.1-4
4d7ea8
- Update to 4.0.1.
4d7ea8
- Add Requires: lapack and openmpi to prevent yum from pulling atlas and lam
4d7ea8
instead.
4d7ea8
32e947
* Wed Oct 15 2008 Jussi Lehtola <jussi.lehtola@iki.fi> - 4.0-3
f322e3
- Rename also man pages.
f322e3
32e947
* Mon Oct 13 2008 Jussi Lehtola <jussi.lehtola@iki.fi> - 4.0-2
f322e3
- Added noreplace to bash completion file.
f322e3
- Changed double precision mpi binary suffix to _mpi_d.
f322e3
32e947
* Sun Oct 12 2008 Jussi Lehtola <jussi.lehtola@iki.fi> - 4.0-1
f322e3
- Update to Gromacs 4.0.
f322e3
- Remove module system and patch file names to begin with g_.
f322e3
32e947
* Wed Oct 08 2008 Jussi Lehtola <jussi.lehtola@iki.fi> - 4.0-0.15.rc3
f322e3
- Changed location of binaries.
f322e3
- Removed conflict of module file, as the program is binary compatible with older versions.
f322e3
32e947
* Wed Oct 08 2008 Jussi Lehtola <jussi.lehtola@iki.fi> - 4.0-0.14.rc3
f322e3
- The gromacs module is loaded automatically and it conflicts with gromacs3.
f322e3
32e947
* Tue Oct 07 2008 Jussi Lehtola <jussi.lehtola@iki.fi> - 4.0-0.13.rc3
f322e3
- Renamed module files from %%{name}-%%{version} to %%{name}.
f322e3
32e947
* Mon Oct 06 2008 Jussi Lehtola <jussi.lehtola@iki.fi> - 4.0-0.12.rc3
f322e3
- Fix BR to get GROMACS to build in mock for epel-4.
f322e3
32e947
* Sat Oct 04 2008 Jussi Lehtola <jussi.lehtola@iki.fi> - 4.0-0.11.rc3
f322e3
- Fix to get GROMACS to build in mock for epel-5.
f322e3
32e947
* Sat Oct 04 2008 Jussi Lehtola <jussi.lehtola@iki.fi> - 4.0-0.10.rc3
f322e3
- Implement module system & remove binary renaming.
f322e3
- No need for autoreconf anymore.
f322e3
- Update to rc3.
f322e3
32e947
* Sat Oct 04 2008 Jussi Lehtola <jussi.lehtola@iki.fi> - 4.0-0.9.rc2
f322e3
- Fall back to autoreconf due to binary renaming.
f322e3
32e947
* Fri Oct 03 2008 Jussi Lehtola <jussi.lehtola@iki.fi> - 4.0-0.8.rc2
f322e3
- Modified install commands to preserve timestamps.
f322e3
32e947
* Fri Oct 03 2008 Jussi Lehtola <jussi.lehtola@iki.fi> - 4.0-0.7.rc2
f322e3
- Even more review fixes.
f322e3
- Binaries renamed:
f322e3
	highway	->	g_highway
f322e3
	luck	->	g_luck
f322e3
	sigeps	->	g_sigeps
f322e3
	wheel	->	g_wheel
f322e3
32e947
* Thu Oct 02 2008 Jussi Lehtola <jussi.lehtola@iki.fi> - 4.0-0.6.rc2
f322e3
- Final review fixes.
f322e3
32e947
* Wed Oct 01 2008 Jussi Lehtola <jussi.lehtola@iki.fi> - 4.0-0.5.rc2
f322e3
- Strip down requires by branching tutor to its own package.
f322e3
32e947
* Tue Sep 30 2008 Jussi Lehtola <jussi.lehtola@iki.fi> - 4.0-0.4.rc2
f322e3
- Extensive package review fixes.
f322e3
- Unclear licenses on some files, filed upstream bug 217.
f322e3
  http://bugzilla.gromacs.org/show_bug.cgi?id=217
f322e3
32e947
* Mon Sep 29 2008 Jussi Lehtola <jussi.lehtola@iki.fi> - 4.0-0.3.rc2
f322e3
- Move .so files to -devel package.
f322e3
- Remove .la files.
f322e3
32e947
* Mon Sep 29 2008 Jussi Lehtola <jussi.lehtola@iki.fi> - 4.0-0.2.rc2
f322e3
- Implement out-of-tree-builds.
f322e3
- Add --noexecstack to CFLAGS.
f322e3
- Remove execstack procedure and prelink from buildreqs.
f322e3
- Filed upstream bug 215 to add .note.GNU-stack .
f322e3
- Fix incorrect file permission on src/tools/gmx_xpm2ps.c .
f322e3
32e947
* Mon Sep 29 2008 Jussi Lehtola <jussi.lehtola@iki.fi> - 4.0-0.1.rc2
f322e3
- Alphabetized buildrequires.
f322e3
- Changed gromacs-share to gromacs-common.
f322e3
32e947
* Fri Sep 26 2008 Jussi Lehtola <jussi.lehtola@iki.fi> - 4.0-0.0.rc2
f322e3
- Initial build.