[gromacs/f12/master] Fix BZ #644950, split libraries into an own package.

Jussi Lehtola jussilehtola at fedoraproject.org
Wed Oct 27 16:38:51 UTC 2010


commit 4e360138e7aaded4825cb2816b2f86341aa2f1ad
Author: Jussi Lehtola <jussilehtola at fedoraproject.org>
Date:   Wed Oct 27 19:38:51 2010 +0300

    Fix BZ #644950, split libraries into an own package.

 gromacs-4.5.1-gmxrc.patch |  160 +++++++++++++++++++++++++++++
 gromacs.spec              |  246 +++++++++++++++++++++++++++++----------------
 2 files changed, 321 insertions(+), 85 deletions(-)
---
diff --git a/gromacs-4.5.1-gmxrc.patch b/gromacs-4.5.1-gmxrc.patch
new file mode 100644
index 0000000..62a2400
--- /dev/null
+++ b/gromacs-4.5.1-gmxrc.patch
@@ -0,0 +1,160 @@
+diff -up gromacs-4.5.1/scripts/GMXRC.bash.cmakein.orig gromacs-4.5.1/scripts/GMXRC.bash.cmakein
+--- gromacs-4.5.1/scripts/GMXRC.bash.cmakein.orig	2010-08-23 20:58:30.000000000 +0300
++++ gromacs-4.5.1/scripts/GMXRC.bash.cmakein	2010-10-25 17:11:05.955213941 +0300
+@@ -8,8 +8,12 @@
+ tmppath=""
+ for i in `echo $LD_LIBRARY_PATH | sed "s/:/ /g"`; do
+   if test "$i" != "$GMXLDLIB"; then
++    if test "${tmppath}" == ""; then
++      tmppath=$i
++    else
+     tmppath=${tmppath}:$i
+   fi
++  fi
+ done
+ LD_LIBRARY_PATH=$tmppath
+ 
+@@ -38,6 +42,9 @@ for i in `echo $MANPATH | sed "s/:/ /g"`
+     tmppath=${tmppath}:$i
+   fi
+ done
++if test "$tmppath" == ""; then
++    tmppath=":"
++fi
+ MANPATH=$tmppath
+ 
+ ##########################################################
+diff -up gromacs-4.5.1/scripts/GMXRC.bash.in.orig gromacs-4.5.1/scripts/GMXRC.bash.in
+--- gromacs-4.5.1/scripts/GMXRC.bash.in.orig	2010-08-23 20:58:30.000000000 +0300
++++ gromacs-4.5.1/scripts/GMXRC.bash.in	2010-10-25 17:11:05.955213941 +0300
+@@ -8,8 +8,12 @@
+ tmppath=""
+ for i in `echo $LD_LIBRARY_PATH | sed "s/:/ /g"`; do
+   if test "$i" != "$GMXLDLIB"; then
++    if test "${tmppath}" == ""; then
++      tmppath=$i
++    else
+     tmppath=${tmppath}:$i
+   fi
++  fi
+ done
+ LD_LIBRARY_PATH=$tmppath
+ 
+@@ -38,6 +42,9 @@ for i in `echo $MANPATH | sed "s/:/ /g"`
+     tmppath=${tmppath}:$i
+   fi
+ done
++if test "$tmppath" == ""; then
++    tmppath=":"
++fi
+ MANPATH=$tmppath
+ 
+ ##########################################################
+diff -up gromacs-4.5.1/scripts/GMXRC.csh.cmakein.orig gromacs-4.5.1/scripts/GMXRC.csh.cmakein
+--- gromacs-4.5.1/scripts/GMXRC.csh.cmakein.orig	2010-08-23 20:58:30.000000000 +0300
++++ gromacs-4.5.1/scripts/GMXRC.csh.cmakein	2010-10-25 17:11:05.955213941 +0300
+@@ -16,7 +16,13 @@ if (! $?GMXMAN) setenv GMXMAN ""
+ # remove previous gromacs part from ld_library_path
+ set tmppath = ""
+ foreach i ( `echo $LD_LIBRARY_PATH | sed "s/:/ /g"` )
+-  if ( "$i" != "$GMXLDLIB" ) set tmppath = "${tmppath}:$i"
++  if ( "$i" != "$GMXLDLIB" ) then
++    if ("${tmppath}" == "") then
++      set tmppath = "$i"
++    else
++      set tmppath = "${tmppath}:$i"
++    endif
++  endif
+ end
+ setenv LD_LIBRARY_PATH $tmppath
+ 
+@@ -39,6 +45,9 @@ set tmppath = ""
+ foreach i ( `echo $MANPATH | sed "s/:/ /g"` )
+   if ( "$i" != "$GMXMAN" ) set tmppath = "${tmppath}:$i"
+ end
++if ("$tmppath" == "") then
++    set tmppath = ":"
++endif
+ setenv MANPATH $tmppath
+ 
+ ##########################################################
+diff -up gromacs-4.5.1/scripts/GMXRC.csh.in.orig gromacs-4.5.1/scripts/GMXRC.csh.in
+--- gromacs-4.5.1/scripts/GMXRC.csh.in.orig	2010-08-23 20:58:30.000000000 +0300
++++ gromacs-4.5.1/scripts/GMXRC.csh.in	2010-10-25 17:11:05.955213941 +0300
+@@ -16,7 +16,13 @@ if (! $?GMXMAN) setenv GMXMAN ""
+ # remove previous gromacs part from ld_library_path
+ set tmppath = ""
+ foreach i ( `echo $LD_LIBRARY_PATH | sed "s/:/ /g"` )
+-  if ( "$i" != "$GMXLDLIB" ) set tmppath = "${tmppath}:$i"
++  if ( "$i" != "$GMXLDLIB" ) then
++    if ("${tmppath}" == "") then
++      set tmppath = "$i"
++    else
++      set tmppath = "${tmppath}:$i"
++    endif
++  endif
+ end
+ setenv LD_LIBRARY_PATH $tmppath
+ 
+@@ -39,6 +45,9 @@ set tmppath = ""
+ foreach i ( `echo $MANPATH | sed "s/:/ /g"` )
+   if ( "$i" != "$GMXMAN" ) set tmppath = "${tmppath}:$i"
+ end
++if ("$tmppath" == "") then
++    set tmppath = ":"
++endif
+ setenv MANPATH $tmppath
+ 
+ ##########################################################
+diff -up gromacs-4.5.1/scripts/GMXRC.zsh.cmakein.orig gromacs-4.5.1/scripts/GMXRC.zsh.cmakein
+--- gromacs-4.5.1/scripts/GMXRC.zsh.cmakein.orig	2010-08-23 20:58:30.000000000 +0300
++++ gromacs-4.5.1/scripts/GMXRC.zsh.cmakein	2010-10-25 17:11:05.955213941 +0300
+@@ -8,8 +8,12 @@
+ tmppath=""
+ for i in `echo $LD_LIBRARY_PATH | sed "s/:/ /g"`; do
+   if test "$i" != "$GMXLDLIB"; then
++    if test "${tmppath}" = ""; then
++      tmppath=$i
++    else
+     tmppath=${tmppath}:$i
+   fi
++  fi
+ done
+ LD_LIBRARY_PATH=$tmppath
+ 
+@@ -38,6 +42,9 @@ for i in `echo $MANPATH | sed "s/:/ /g"`
+     tmppath=${tmppath}:$i
+   fi
+ done
++if test "$tmppath" = ""; then
++    tmppath=":"
++fi
+ MANPATH=$tmppath
+ 
+ ##########################################################
+diff -up gromacs-4.5.1/scripts/GMXRC.zsh.in.orig gromacs-4.5.1/scripts/GMXRC.zsh.in
+--- gromacs-4.5.1/scripts/GMXRC.zsh.in.orig	2010-08-23 20:58:30.000000000 +0300
++++ gromacs-4.5.1/scripts/GMXRC.zsh.in	2010-10-25 17:11:05.955213941 +0300
+@@ -8,8 +8,12 @@
+ tmppath=""
+ for i in `echo $LD_LIBRARY_PATH | sed "s/:/ /g"`; do
+   if test "$i" != "$GMXLDLIB"; then
++    if test "${tmppath}" = ""; then
++      tmppath=$i
++    else
+     tmppath=${tmppath}:$i
+   fi
++  fi
+ done
+ LD_LIBRARY_PATH=$tmppath
+ 
+@@ -38,6 +42,9 @@ for i in `echo $MANPATH | sed "s/:/ /g"`
+     tmppath=${tmppath}:$i
+   fi
+ done
++if test "$tmppath" = ""; then
++    tmppath=":"
++fi
+ MANPATH=$tmppath
+ 
+ ##########################################################
diff --git a/gromacs.spec b/gromacs.spec
index b3c0a53..b9d5a9d 100644
--- a/gromacs.spec
+++ b/gromacs.spec
@@ -1,13 +1,14 @@
 Name:		gromacs
-Version:	4.0.7
-Release:	1%{?dist}
+Version:	4.5.1
+Release:	2%{?dist}
 Summary:	Fast, Free and Flexible Molecular Dynamics
 Group:		Applications/Engineering
 License:	GPLv2+
 URL:		http://www.gromacs.org
 BuildRoot:	%{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 Source0:	ftp://ftp.gromacs.org/pub/gromacs/gromacs-%{version}.tar.gz
-Source1:	ftp://ftp.gromacs.org/pub/manual/manual-4.0.pdf
+# File gotten from http://www.gromacs.org/@api/deki/files/126/=gromacs_manual-4.5.pdf
+Source1:	manual-4.5.pdf
 Source2:	gromacs-template-makefile-single
 Source3:	gromacs-template-makefile-double
 Source4:	gromacs-template-makefile-mpi-single
@@ -20,16 +21,17 @@ Patch0:		gromacs-GMXRC.patch
 Patch1:		gromacs-gmxdemo.patch
 # Patch configure for the library suffix
 Patch2:		gromacs-configure.patch
+# Patch for BZ #644950, CVE-2010-4001
+Patch3:		gromacs-4.5.1-gmxrc.patch
 
-BuildRequires:	blas-devel
+BuildRequires:	cmake
+BuildRequires:	atlas-devel
 BuildRequires:	fftw-devel
 BuildRequires:	gsl-devel
-BuildRequires:	lapack-devel
 BuildRequires:	libxml2-devel
 BuildRequires:	libX11-devel
 
 Requires:	gromacs-common = %{version}-%{release}
-Obsoletes:	gromacs-libs < %{version}-%{release}
 
 %description
 GROMACS is a versatile and extremely well optimized package to perform
@@ -41,6 +43,10 @@ and solid state physics.
 This package provides single and double precision binaries.
 The documentation is in the package gromacs-common.
 
+mdrun has been compiled with thread parallellization, so it runs in parallel
+on shared memory systems. If you want to run on a cluster, you probably want
+to install one of the MPI parallellized packages.
+
 N.B. All binaries have names starting with g_, for example mdrun has been
 renamed to g_mdrun.
 
@@ -50,7 +56,7 @@ Summary:	GROMACS shared data and documentation
 Group:		Applications/Engineering
 BuildArch:	noarch
 # Due to switch to noarch package
-Obsoletes:	gromacs-common < %{version}-%{release}
+Obsoletes:	gromacs-common < 4.0.7-1
 
 %description common
 GROMACS is a versatile and extremely well optimized package to perform
@@ -79,11 +85,25 @@ molecular dynamics software. You need it if you want to write your own analysis
 programs.
 
 
+%package libs
+Summary:	GROMACS shared libraries
+Group:		System Environment/Libraries
+
+%description libs
+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 package contains libraries needed for operation of GROMACS.
+
+
+
 %package openmpi
 Summary:	GROMACS Open MPI binaries and libraries
 Group:		Applications/Engineering
 Obsoletes:	gromacs-mpi < %{version}-%{release}
-Obsoletes:	gromacs-mpi-libs < %{version}-%{release}
 Requires:	gromacs-common = %{version}-%{release}
 BuildRequires:	openmpi-devel
 Requires:	openmpi
@@ -95,8 +115,25 @@ 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 package provides Open MPI single precision and double precision binaries
-and libraries.
+mdrun has been compiled with thread parallellization (for running on
+a single node) and with Open MPI (for running on multiple nodes).
+This package single and double precision binaries and libraries.
+
+
+%package openmpi-libs
+Summary:	GROMACS Open MPI shared libraries
+Group:		System Environment/Libraries
+Obsoletes:	gromacs-mpi-libs < %{version}-%{release}
+Requires:	openmpi
+
+%description openmpi-libs
+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 package contains libraries needed for operation of GROMACS Open MPI.
 
 
 %package openmpi-devel
@@ -116,7 +153,7 @@ performance means it is used also in several other field like polymer chemistry
 and solid state physics.
 
 This package contains development libraries for GROMACS Open MPI.
-You need it if you want to write your own analysis programs.
+You may need it if you want to write your own analysis programs.
 
 
 %package mpich2
@@ -132,8 +169,23 @@ 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 package provides MPICH2 single precision and double precision binaries
-and libraries.
+mdrun has been compiled with thread parallellization (for running on
+a single node) and with MPICH2 (for running on multiple nodes).
+This package single and double precision binaries and libraries.
+
+%package mpich2-libs
+Summary:	GROMACS MPICH2 shared libraries
+Group:		System Environment/Libraries
+Requires:	mpich2
+
+%description mpich2-libs
+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 package contains libraries needed for operation of GROMACS MPICH2.
 
 
 %package mpich2-devel
@@ -152,7 +204,7 @@ performance means it is used also in several other field like polymer chemistry
 and solid state physics.
 
 This package contains development libraries for GROMACS MPICH2.
-You need it if you want to write your own analysis programs.
+You may need it if you want to write your own analysis programs.
 
 
 
@@ -162,7 +214,7 @@ Group:		Applications/Engineering
 Requires:	bash-completion
 BuildArch:	noarch
 # Due to switch to noarch package
-Obsoletes:	gromacs-bash < %{version}-%{release}
+Obsoletes:	gromacs-bash < 4.0.7-1 
 
 
 %description bash
@@ -181,7 +233,7 @@ Group:		Applications/Engineering
 Requires:	zsh
 BuildArch:	noarch
 # Due to switch to noarch package
-Obsoletes:	gromacs-zsh < %{version}-%{release}
+Obsoletes:	gromacs-zsh < 4.0.7-1
 
 
 %description zsh
@@ -201,7 +253,7 @@ Group:		Applications/Engineering
 Requires:	csh
 BuildArch:	noarch
 # Due to switch to noarch package
-Obsoletes:	gromacs-csh < %{version}-%{release}
+Obsoletes:	gromacs-csh < 4.0.7-1 
 
 
 %description csh
@@ -220,7 +272,7 @@ Group:		Applications/Engineering
 Requires:	gromacs-common = %{version}-%{release}
 BuildArch:	noarch
 # Due to switch to noarch package
-Obsoletes:	gromacs-tutor < %{version}-%{release}
+Obsoletes:	gromacs-tutor < 4.0.7-1 
 
 %description tutor
 GROMACS is a versatile and extremely well optimized package to perform
@@ -232,10 +284,11 @@ and solid state physics.
 This package provides tutorials for the use of GROMACS.
 
 %prep
-%setup -q
+%setup -q 
 %patch0 -p1 -b .gmxrc
 %patch1 -p1 -b .gmxdemo
-%patch2 -p1 -b .libsuffix
+#%patch2 -p1 -b .libsuffix
+%patch3 -p1 -b .gmxrc_cve
 
 # Fix incorrect permission
 #chmod a-x src/tools/gmx_xpm2ps.c
@@ -243,45 +296,37 @@ This package provides tutorials for the use of GROMACS.
 
 
 %build
+# First, override bug in MPICH2 packaging.
+%{_mpich2_unload}
+
 # Assembly kernels haven't got .note.GNU-stack sections
 # because of incompatibilies with Microsoft Assembler.
 # Add noexecstack to compiler flags
 
 export CFLAGS="%optflags -Wa,--noexecstack -fPIC"
-export LIBS="-lblas -llapack"
+export LIBS="-L%{_libdir}/atlas -lblas -llapack"
 
 # Default options, used for all compilations
-export DEFOPTS="--enable-shared --disable-static --with-external-blas \
-	--with-external-lapack --with-gsl --with-x"
-export SINGLE="--enable-float" # Single precision
-export DOUBLE="--disable-float" # Double precision
-export MPI="--enable-mpi"
+export DEFOPTS="-D BUILD_SHARED_LIBS=ON -DCMAKE_SKIP_RPATH:BOOL=ON -DCMAKE_SKIP_BUILD_RPATH:BOOL=ON"
+export SINGLE="-D GMX_DOUBLE=OFF" # Single precision
+export DOUBLE="-D GMX_DOUBLE=ON" # Double precision
+export MPI="-D GMX_MPI=ON"
 
 # Add this to the configure options if you want to build a debug version
-export NOASM="--disable-ia32-3dnow --disable-ia32-sse --disable-x86-64-sse \
-	--disable-ppc-altivec --disable-ia64-asm"
-
+export NOASM="-D GMX_ACCELERATION=OFF"
 
 # Single precision
 mkdir single
 cd single
-sed "s|@LIBSUFFIX@||g" < ../configure > configure; chmod 777 configure
-%configure $DEFOPTS $SINGLE
-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 %{?_smp_mflags}
+%cmake $DEFOPTS $SINGLE ..
+make VERBOSE=1 %{?_smp_mflags}
 cd ..
 
 # Double precision
 mkdir double
 cd double
-sed "s|@LIBSUFFIX@|_d|g" < ../configure > configure; chmod 777 configure
-%configure $DEFOPTS $DOUBLE --program-suffix="_d"
-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 %{?_smp_mflags}
+%cmake $DEFOPTS $DOUBLE ..
+make VERBOSE=1 %{?_smp_mflags}
 cd ..
 
 
@@ -294,46 +339,46 @@ export FC=mpif90
 
 ## Open MPI
 %{_openmpi_load}
+# Suffix to be used for single precision is
+SUFFIXCONF="-D GMX_DEFAULT_SUFFIX=OFF -D GMX_BINARY_SUFFIX=$SUFFIX -D GMX_LIBS_SUFFIX=${MPI_SUFFIX}"
 # single precision
 mkdir openmpi-single
 cd openmpi-single
-sed "s|@LIBSUFFIX@|_mpi|g" < ../configure > configure; chmod 777 configure
-%configure $DEFOPTS $SINGLE $MPI --program-suffix=${MPI_SUFFIX} --bindir=${MPI_BIN} --libdir=${MPI_LIB}
-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 %{?_smp_mflags} mdrun
+%cmake $DEFOPTS $SINGLE $MPI $SUFFIXCONF ..
+make VERBOSE=1 %{?_smp_mflags} mdrun
 cd ..
+
 # double precision
+# Suffix to be used for double precision is
+SUFFIXCONF="-D GMX_DEFAULT_SUFFIX=OFF -D GMX_BINARY_SUFFIX=$SUFFIX -D GMX_LIBS_SUFFIX=${MPI_SUFFIX}_d"
 mkdir openmpi-double
 cd openmpi-double
-sed "s|@LIBSUFFIX@|_mpi_d|g" < ../configure > configure; chmod 777 configure
-%configure $DEFOPTS $DOUBLE $MPI --program-suffix=${MPI_SUFFIX}_d --bindir=${MPI_BIN} --libdir=${MPI_LIB}
-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 %{?_smp_mflags} mdrun
+%cmake $DEFOPTS $DOUBLE $MPI $SUFFIXCONF ..
+make VERBOSE=1 %{?_smp_mflags} mdrun
 cd ..
 # unload
 %{_openmpi_unload}
 
+
 ## MPICH2
 %{_mpich2_load}
+# Suffix to be used for single precision is
+SUFFIXCONF="-D GMX_DEFAULT_SUFFIX=OFF -D GMX_BINARY_SUFFIX=$SUFFIX -D GMX_LIBS_SUFFIX=${MPI_SUFFIX}"
+# MPICH 2 is broken, so need to modify linker command
+export CC="mpicc -lstdc++"
 # single precision
 mkdir mpich2-single
 cd mpich2-single
-sed "s|@LIBSUFFIX@|_mpi|g" < ../configure > configure; chmod 777 configure
-%configure $DEFOPTS $SINGLE $MPI --program-suffix=${MPI_SUFFIX} --bindir=${MPI_BIN} --libdir=${MPI_LIB}
-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 %{?_smp_mflags} mdrun
+%cmake $DEFOPTS $SINGLE $MPI $SUFFIXCONF ..
+make VERBOSE=1 %{?_smp_mflags} mdrun
 cd ..
 # double precision
+# Suffix to be used for double precision is
+SUFFIXCONF="-D GMX_DEFAULT_SUFFIX=OFF -D GMX_BINARY_SUFFIX=$SUFFIX -D GMX_LIBS_SUFFIX=${MPI_SUFFIX}_d"
 mkdir mpich2-double
 cd mpich2-double
-sed "s|@LIBSUFFIX@|_mpi_d|g" < ../configure > configure; chmod 777 configure
-%configure $DEFOPTS $DOUBLE $MPI --program-suffix=${MPI_SUFFIX}_d --bindir=${MPI_BIN} --libdir=${MPI_LIB}
-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 %{?_smp_mflags} mdrun
+%cmake $DEFOPTS $DOUBLE $MPI $SUFFIXCONF ..
+make VERBOSE=1 %{?_smp_mflags} mdrun
 cd ..
 %{_mpich2_unload}
 
@@ -344,25 +389,33 @@ rm -rf %{buildroot}
 
 ## Open MPI
 %{_openmpi_load}
+# Make install-mdrun target is broken, do install manually
+mkdir -p %{buildroot}%{_libdir}/openmpi/{bin,lib}
 # single precision
 cd openmpi-single
-make DESTDIR=%{buildroot} INSTALL="install -p" BINDIR=${MPI_BIN} LIBDIR=${MPI_LIB} install-mdrun
+install -p -m 755 src/kernel/mdrun %{buildroot}%{_libdir}/openmpi/bin/g_mdrun_openmpi
+cp -a src/*/*.so* %{buildroot}%{_libdir}/openmpi/lib/
 cd ..
 # double precision
 cd openmpi-double
-make DESTDIR=%{buildroot} INSTALL="install -p" BINDIR=${MPI_BIN} LIBDIR=${MPI_LIB} install-mdrun
+install -p -m 755 src/kernel/mdrun %{buildroot}%{_libdir}/openmpi/bin/g_mdrun_openmpi_d
+cp -a src/*/*.so* %{buildroot}%{_libdir}/openmpi/lib/
 cd ..
 %{_openmpi_unload}
 
 ## MPICH 2
 %{_mpich2_load}
+# Make install-mdrun target is broken, do install manually
+mkdir -p %{buildroot}%{_libdir}/mpich2/{bin,lib}
 # single precision
 cd mpich2-single
-make DESTDIR=%{buildroot} INSTALL="install -p" BINDIR=${MPI_BIN} LIBDIR=${MPI_LIB} install-mdrun
+install -p -m 755 src/kernel/mdrun %{buildroot}%{_libdir}/mpich2/bin/g_mdrun_mpich2
+cp -a src/*/*.so* %{buildroot}%{_libdir}/mpich2/lib/
 cd ..
 # double precision
 cd mpich2-double
-make DESTDIR=%{buildroot} INSTALL="install -p" BINDIR=${MPI_BIN} LIBDIR=${MPI_LIB} install-mdrun
+install -p -m 755 src/kernel/mdrun %{buildroot}%{_libdir}/mpich2/bin/g_mdrun_mpich2_d
+cp -a src/*/*.so* %{buildroot}%{_libdir}/mpich2/lib/
 cd ..
 %{_mpich2_unload}
 
@@ -378,6 +431,15 @@ cd double
 make DESTDIR=%{buildroot} INSTALL="install -p" install
 cd ..
 
+## Now, the rest of the necessary stuff
+
+# Fix location of libraries
+%ifarch x86_64 sparc64
+mv %{buildroot}/usr/lib/*.so* %{buildroot}%{_libdir}/
+# and pkgconfig files
+mkdir -p %{buildroot}%{_libdir}/pkgconfig/
+mv %{buildroot}/usr/lib/pkgconfig/* %{buildroot}%{_libdir}/pkgconfig/
+%endif
 
 # Install manual & packager's note
 install -cpm 644 %{SOURCE1} .
@@ -391,13 +453,13 @@ install -cpm 644 %{SOURCE3} %{buildroot}%{_datadir}/%{name}/template/Makefile.do
 install -cpm 644 %{SOURCE4} %{buildroot}%{_datadir}/%{name}/template/Makefile.mpi.single
 install -cpm 644 %{SOURCE5} %{buildroot}%{_datadir}/%{name}/template/Makefile.mpi.double
 
-
 # Fix GMXRC file permissions
 chmod a+x %{buildroot}%{_bindir}/GMXRC %{buildroot}%{_bindir}/GMXRC.*
 
 # Rename binaries and man pages to prevent clashes
 # (This is done here so that we don't need to mess with machine generated makefiles.
-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 
+#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 
+for bin in do_dssp editconf eneconv genbox genconf genion genrestr gmxcheck gmxdump grompp make_edi make_ndx mdrun mk_angndx pdb2gmx tpbconv trjcat trjconv trjorder xpm2ps; do
 mv %{buildroot}%{_bindir}/${bin} %{buildroot}%{_bindir}/g_${bin}
 mv %{buildroot}%{_bindir}/${bin}_d %{buildroot}%{_bindir}/g_${bin}_d
 done
@@ -406,19 +468,11 @@ for bin in demux.pl xplor2gmx.pl; do
 mv %{buildroot}%{_bindir}/$bin %{buildroot}%{_bindir}/g_${bin}
 done
 
-# MPI-enabled binaries (list will continue when the makefile has
-# the possibility to compile all mpi-enabled files
-for mpi in openmpi mpich2; do
- for mpibin in mdrun; do
-  mv %{buildroot}%{_libdir}/$mpi/bin/${mpibin}_${mpi} %{buildroot}%{_libdir}/$mpi/bin/g_${mpibin}_${mpi}
-  mv %{buildroot}%{_libdir}/$mpi/bin/${mpibin}_${mpi}_d %{buildroot}%{_libdir}/$mpi/bin/g_${mpibin}_${mpi}_d
- done
-done
-
 # Man pages
-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 
+#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 
+for bin in do_dssp editconf eneconv genbox genconf genion genrestr gmxcheck gmxdump grompp make_edi make_ndx mdrun mk_angndx pdb2gmx tpbconv trjcat trjconv trjorder xpm2ps; do
 mv %{buildroot}%{_mandir}/man1/${bin}.1 %{buildroot}%{_mandir}/man1/g_${bin}.1
-mv %{buildroot}%{_mandir}/man1/${bin}_d.1 %{buildroot}%{_mandir}/man1/g_${bin}_d.1
+#mv %{buildroot}%{_mandir}/man1/${bin}_d.1 %{buildroot}%{_mandir}/man1/g_${bin}_d.1
 done
 
 # Move completion files around
@@ -449,23 +503,29 @@ rm -rf %{buildroot}
 %files
 %defattr(-,root,root,-)
 %{_bindir}/g_*
-%{_libdir}/libgmx.so.*
-%{_libdir}/libgmx_d.so.*
-%{_libdir}/libgmxana.so.*
-%{_libdir}/libgmxana_d.so.*
-%{_libdir}/libmd.so.*
-%{_libdir}/libmd_d.so.*
 
 %files common
 %defattr(-,root,root,-)
-%doc AUTHORS COPYING README manual-4.0.pdf README.fedora
+%doc AUTHORS COPYING README manual-4.5.pdf README.fedora
 %{_bindir}/GMXRC
 %{_bindir}/GMXRC.bash
 %{_mandir}/man1/*
+%{_mandir}/man7/gromacs.*
 %{_datadir}/%{name}/
 %exclude %{_datadir}/%{name}/template/
 %exclude %{_datadir}/%{name}/tutor/
 
+%files libs
+%defattr(-,root,root,-)
+%{_libdir}/libgmx.so.*
+%{_libdir}/libgmx_d.so.*
+%{_libdir}/libgmxana.so.*
+%{_libdir}/libgmxana_d.so.*
+%{_libdir}/libgmxpreprocess.so.*
+%{_libdir}/libgmxpreprocess_d.so.*
+%{_libdir}/libmd.so.*
+%{_libdir}/libmd_d.so.*
+
 %files devel
 %defattr(-,root,root,-)
 %{_includedir}/%{name}
@@ -473,14 +533,20 @@ rm -rf %{buildroot}
 %{_libdir}/libgmx_d.so
 %{_libdir}/libgmxana.so
 %{_libdir}/libgmxana_d.so
+%{_libdir}/libgmxpreprocess.so
+%{_libdir}/libgmxpreprocess_d.so
 %{_libdir}/libmd.so
 %{_libdir}/libmd_d.so
+%{_libdir}/pkgconfig/*.pc
 %{_datadir}/%{name}/template/
 %exclude %{_datadir}/%{name}/template/Makefile.mpi.*
 
 %files openmpi
 %defattr(-,root,root,-)
 %{_libdir}/openmpi/bin/g_mdrun*
+
+%files openmpi-libs
+%defattr(-,root,root,-)
 %{_libdir}/openmpi/lib/lib*.so.*
 
 %files openmpi-devel
@@ -490,6 +556,9 @@ rm -rf %{buildroot}
 %files mpich2
 %defattr(-,root,root,-)
 %{_libdir}/mpich2/bin/g_mdrun*
+
+%files mpich2-libs
+%defattr(-,root,root,-)
 %{_libdir}/mpich2/lib/lib*.so.*
 
 %files mpich2-devel
@@ -516,6 +585,13 @@ rm -rf %{buildroot}
 
 
 %changelog
+* Wed Oct 27 2010 Jussi Lehtola <jussilehtola at fedoraproject.org> - 4.5.1-2
+- Patch around #644950.
+- Split libraries in own packages to avoid multilib problems.
+
+* Sat Oct 09 2010 Jussi Lehtola <jussilehtola at fedoraproject.org> - 4.5.1-1
+- Update to 4.5.1.
+
 * Sun Dec 06 2009 Jussi Lehtola <jussilehtola at fedoraproject.org> - 4.0.7-1
 - Update to 4.0.7.
 


More information about the scm-commits mailing list