rpms/orsa/devel orsa.spec,1.11,1.12

Miloš Jakubíček mjakubicek at fedoraproject.org
Thu Aug 27 14:41:40 UTC 2009


Author: mjakubicek

Update of /cvs/pkgs/rpms/orsa/devel
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv9623

Modified Files:
	orsa.spec 
Log Message:
- Make compliant to new MPI guidelines:
- Do not build in %%install (resolves BZ#513697)
- Split docs into a -common subpackage




Index: orsa.spec
===================================================================
RCS file: /cvs/pkgs/rpms/orsa/devel/orsa.spec,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -p -r1.11 -r1.12
--- orsa.spec	24 Jul 2009 11:44:40 -0000	1.11
+++ orsa.spec	27 Aug 2009 14:41:39 -0000	1.12
@@ -1,6 +1,9 @@
+# Define a macro for calling ../configure instead of ./configure
+%global dconfigure %(printf %%s '%configure' | sed 's!\./configure!../configure!g')
+
 Name:			orsa
 Version:		0.7.0
-Release:		10%{?dist}
+Release:		11%{?dist}
 Summary:		Orbit Reconstruction, Simulation and Analysis
 
 Group:			Amusements/Graphics
@@ -34,6 +37,8 @@ BuildRequires:	gsl-devel
 BuildRequires:	cln-devel
 BuildRequires:	ginac-devel
 
+Requires:	%{name}-common = %{version}-%{release}
+
 %description
 ORSA is an interactive tool for scientific grade Celestial Mechanics
 computations. Asteroids, comets, artificial satellites, Solar and extra-Solar
@@ -57,6 +62,8 @@ Summary:	A build of %{name} with support
 Group:		Applications/Engineering
 
 BuildRequires: openmpi-devel
+Requires:	%{name}-common = %{version}-%{release}
+Requires:	openmpi
 
 %description openmpi
 This package contains a build of %{name} with support for OpenMPI.
@@ -77,6 +84,8 @@ Summary:	A build of %{name} with support
 Group:		Applications/Engineering
 
 BuildRequires: mpich2-devel
+Requires:	%{name}-common = %{version}-%{release}
+Requires:	mpich2
 
 %description mpich2
 This package contains a build of %{name} with support for MPICH2 MPI.
@@ -97,6 +106,8 @@ Summary:	A build of %{name} with support
 Group:		Applications/Engineering
 
 BuildRequires: lam-devel
+Requires:	%{name}-common = %{version}-%{release}
+Requires:	lam
 
 %description lam
 This package contains a build of %{name} with support for LAM MPI.
@@ -119,6 +130,13 @@ Group:		Development/Libraries
 %description headers
 This package contains C++ header files for development with %{name}.
 
+%package common
+Summary:	Common files for %{name}
+Group:		Documentation
+
+%description common
+This package contains files shared across the MPI/non-MPI builds of %{name}.
+
 %prep
 %setup -q
 %patch0 -p1
@@ -129,16 +147,18 @@ This package contains C++ header files f
 install -p -m644 %{SOURCE1} .
 
 %build
-# Have to build in the install step to do multiple builds
-
-%install
-rm -rf $RPM_BUILD_ROOT
-
 # honor $RPM_OPT_FLAGS
 sed -i 's|-g -Wall -W -pipe -ftemplate-depth-64 -O3 -fno-exceptions -funroll-loops -fstrict-aliasing -fno-gcse|$CXXFLAGS|' configure
 
-# common configure options for MPI as well as non-MPI builds
-%global confflags --disable-dependency-tracking --disable-static "CLN_CONFIG=`which pkg-config` cln" "GINACLIB_CONFIG=`which pkg-config` ginac" CXXFLAGS="$CXXFLAGS -DHAVE_INLINE"
+# To avoid replicated code define a build macro
+%define dobuild() \
+mkdir $MPI_COMPILER; \
+cd $MPI_COMPILER; \
+%dconfigure $WITH_MPI --prefix=$MPI_HOME --bindir=$MPI_BIN --libdir=$MPI_LIB --program-suffix=$MPI_SUFFIX --disable-dependency-tracking --disable-static "CLN_CONFIG=`which pkg-config` cln" "GINACLIB_CONFIG=`which pkg-config` ginac" CXXFLAGS="$CXXFLAGS -DHAVE_INLINE" ;\
+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} ; \
+cd ..
 
 # load the module function
 . /etc/profile.d/modules.sh
@@ -146,51 +166,35 @@ sed -i 's|-g -Wall -W -pipe -ftemplate-d
 %global OpenMPI_LIB %(. /etc/profile.d/modules.sh; module load openmpi-%{_arch}; echo $MPI_LIB)
 %global LAM_BIN %(. /etc/profile.d/modules.sh; module load lam-%{_arch}; echo $MPI_BIN | sed 's|-L||')
 %global LAM_LIB %(. /etc/profile.d/modules.sh; module load lam-%{_arch}; echo $MPI_LIB | sed 's|-L||')
-%global MPICH_BIN %(. /etc/profile.d/modules.sh; module load %{_datadir}/mpich2/mpich2.module; echo $PATH | cut -f 1 -d :)
+%global MPICH_BIN %(. /etc/profile.d/modules.sh; module load mpich2.module; echo $PATH | cut -f 1 -d :)
 
 ################################
 echo -e "\n##############################\nNow making the non-MPI version\n##############################\n"
 ################################
 
-%configure --without-mpi %{confflags}
-# remove rpaths
-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}
-make install DESTDIR=$RPM_BUILD_ROOT
-# we don't want to ship libtool archives:
-rm $RPM_BUILD_ROOT%{_libdir}/{liborsa.la,libxorsa.la}
-make clean
+# Build serial version, dummy arguments
+MPI_COMPILER=serial MPI_SUFFIX= WITH_MPI=--without-mpi MPI_HOME=%{_prefix} MPI_BIN=%{_bindir} MPI_LIB=%{_libdir} %dobuild
+
+# Build parallel versions: set compiler variables to MPI wrappers
+export CC=mpicc
+export CXX=mpicxx
+export FC=mpif90
+export F77=mpif77
 
 ################################
 echo -e "\n##############################\nNow making the OpenMPI version\n##############################\n"
 ################################
+
 module load openmpi-%{_arch}
-%configure --with-mpi --prefix=$MPI_HOME --bindir=$MPI_BIN --libdir=$MPI_LIB %{confflags}
-# remove rpaths
-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 CC=mpicc %{?_smp_mflags}
-make install DESTDIR=$RPM_BUILD_ROOT
-# we don't want to ship libtool archives:
-rm $RPM_BUILD_ROOT/$MPI_LIB/{liborsa.la,libxorsa.la}
-make clean
+MPI_COMPILER=openmpi MPI_SUFFIX=_openmpi WITH_MPI=--with-mpi %dobuild
 module unload openmpi-%{_arch}
 
 ################################
 echo -e "\n##############################\nNow making the MPICH2 version\n##############################\n"
 ################################
-module load %{_datadir}/mpich2/mpich2.module
-%configure --with-mpi --bindir=%{MPICH_BIN} --libdir=%{_libdir}/mpich2/ %{confflags} MPICXX=mpicxx
-# remove rpaths
-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 CC=mpicxx %{?_smp_mflags}
-make install DESTDIR=%{buildroot} 
-# we don't want to ship libtool archives:
-rm $RPM_BUILD_ROOT%{_libdir}/mpich2/{liborsa.la,libxorsa.la}
-make clean
-module unload %{_datadir}/mpich2/mpich2.module
+module load mpich2.module
+MPI_COMPILER=mpich2 MPI_BIN=%{MPICH_BIN} MPI_LIB=%{_libdir}/mpich2/ MPICXX=mpicxx MPI_SUFFIX=_mpich2 CC=mpicxx WITH_MPI=--with-mpi %dobuild
+module unload mpich2.module
 
 ################################
 echo -e "\n##############################\nNow making the LAM version\n##############################\n"
@@ -199,14 +203,42 @@ module load lam-%{_arch}
 export MPI_HOME=`echo $MPI_HOME | sed 's|-L||'`
 export MPI_BIN=`echo $MPI_BIN | sed 's|-L||'`
 export MPI_LIB=`echo $MPI_LIB | sed 's|-L||'`
-%configure --with-mpi --prefix=$MPI_HOME --bindir=$MPI_BIN --libdir=$MPI_LIB %{confflags} MPICXX=mpic++
-# remove rpaths
-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 CC=mpic++ %{?_smp_mflags}
-make install DESTDIR=%{buildroot} 
+MPI_COMPILER=lam CC=mpic++ MPICXX=mpic++ WITH_MPI=--with-mpi MPI_SUFFIX=_lam %dobuild
+module unload lam-%{_arch}
+
+
+%install
+rm -rf $RPM_BUILD_ROOT
 # we don't want to ship libtool archives:
-rm $RPM_BUILD_ROOT/$MPI_LIB/{liborsa.la,libxorsa.la}
+
+# load the module function
+. /etc/profile.d/modules.sh
+
+# Install serial version
+make -C serial install DESTDIR=%{buildroot} INSTALL="install -p" CPPROG="cp -p"
+rm $RPM_BUILD_ROOT%{_libdir}/{liborsa.la,libxorsa.la}
+
+# Install OpenMPI version
+module load openmpi-%{_arch}
+MPI_COMPILER=openmpi
+make -C $MPI_COMPILER install DESTDIR=%{buildroot} INSTALL="install -p" CPPROG="cp -p"
+rm $RPM_BUILD_ROOT$MPI_LIB/{liborsa.la,libxorsa.la}
+module unload openmpi-%{_arch}
+
+# Install MPICH2 version
+module load mpich2.module
+MPI_COMPILER=mpich2
+make -C $MPI_COMPILER install DESTDIR=%{buildroot} INSTALL="install -p" CPPROG="cp -p"
+rm $RPM_BUILD_ROOT%{_libdir}/mpich2/{liborsa.la,libxorsa.la}
+module unload mpich2.module
+
+# Install LAM version
+module load lam-%{_arch}
+MPI_COMPILER=lam
+MPI_LIB=`echo $MPI_LIB | sed 's|-L||'`
+make -C $MPI_COMPILER install DESTDIR=%{buildroot} INSTALL="install -p" CPPROG="cp -p"
+rm $RPM_BUILD_ROOT$MPI_LIB/{liborsa.la,libxorsa.la}
+module unload lam-%{_arch}
 
 %clean
 rm -rf $RPM_BUILD_ROOT
@@ -217,7 +249,6 @@ rm -rf $RPM_BUILD_ROOT
 
 %files
 %defattr(-,root,root,-)
-%doc COPYING DEVELOPERS ORSA_MPI
 %{_bindir}/xorsa
 %{_libdir}/liborsa.so.*
 %{_libdir}/libxorsa.so.*
@@ -232,7 +263,6 @@ rm -rf $RPM_BUILD_ROOT
 
 %files openmpi
 %defattr(-,root,root,-)
-%doc COPYING DEVELOPERS ORSA_MPI
 %{OpenMPI_LIB}/liborsa.so.*
 %{OpenMPI_LIB}/libxorsa.so.*
 %{OpenMPI_BIN}/*
@@ -243,7 +273,6 @@ rm -rf $RPM_BUILD_ROOT
 
 %files mpich2
 %defattr(-,root,root,-)
-%doc COPYING DEVELOPERS ORSA_MPI
 %{MPICH_BIN}/*
 %{_libdir}/mpich2/liborsa.so.*
 %{_libdir}/mpich2/libxorsa.so.*
@@ -254,7 +283,6 @@ rm -rf $RPM_BUILD_ROOT
 
 %files lam
 %defattr(-,root,root,-)
-%doc COPYING DEVELOPERS ORSA_MPI
 %{LAM_LIB}/liborsa.so.*
 %{LAM_LIB}/libxorsa.so.*
 %{LAM_BIN}/*
@@ -263,7 +291,16 @@ rm -rf $RPM_BUILD_ROOT
 %defattr(-,root,root,-)
 %{LAM_LIB}/*.so
 
+%files common
+%defattr(-,root,root,-)
+%doc COPYING DEVELOPERS ORSA_MPI
+
 %changelog
+* Thu Aug 27 2009 Milos Jakubicek <xjakub at fi.muni.cz> - 0.7.0-11
+- Make compliant to new MPI guidelines:
+- Do not build in %%install (resolves BZ#513697)
+- Split docs into a -common subpackage
+
 * Fri Jul 24 2009 Milos Jakubicek <xjakub at fi.muni.cz> - 0.7.0-10
 - Reenabled MPI support in a way described in BZ#511099, introduced
   separate subpackages with support for OpenMPI, MPICH2 and LAM MPI




More information about the fedora-extras-commits mailing list