# Note on packaging: at first inspection it would seem sensible to # split out separate -libs and -devel subpackages for gerris, (and # gerris-openmpi, gerris-mpich2 etc). However, as the upstream author # points out here: # # https://groups.google.com/group/gerris-devel/browse_thread/thread/5fc0c66332abe09f?hl=en # # the main runtime requires the headers etc to provide runtime # compilation of modules and functions. As such, splitting out the # -devel and -libs packages makes little sense. # Note that gerris is distributed in the form of snapshot tarballs of # the darcs development tree at various intervals. Unfortunately the # snapshot tarball name does not contain any version information. For # packaging, the version information taken from configure.in - see # GFS_MAJOR_VERSION, GFS_MINOR_VERSION, GFS_MICRO_VERSION # # Downloads are available from: # http://gerris.dalembert.upmc.fr/gerris/tarballs/ %global snapshot 111123 # Decide which MPI versions to build %global with_mpich2 1 %global with_openmpi 1 # No mpich2 on ppc64 in EL %if 0%{?rhel} %ifarch ppc64 %global with_mpich2 0 %endif %endif # No openmpi on s390(x) %ifarch s390 s390x %global with_openmpi 0 %endif %if %{with_mpich2} %global mpi_list mpich2 %endif %if %{with_openmpi} %global mpi_list %{?mpi_list} openmpi %endif Name: gerris Version: 1.3.2 Release: 6.20%{snapshot}%{?dist} Summary: The Gerris Flow Solver Group: Applications/Engineering License: GPLv2 URL: http://gfs.sourceforge.net Source0: http://gerris.dalembert.upmc.fr/gerris/tarballs/%{name}-snapshot-%{snapshot}.tar.gz # This patch taken from the Debian package and fixes out of tree builds of the docs Patch0: gerris-20111123-fix-doc-build.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRequires: netcdf-devel proj-devel gcc-gfortran BuildRequires: gsl-devel gts-devel BuildRequires: ode-devel fftw-devel BuildRequires: emacs Requires: hicolor-icon-theme Provides: %{name}-devel = 1.3.2-4.20111123 Obsoletes: %{name}-devel < 1.3.2-4.20111123 Provides: %{name}-libs = 1.3.2-4.20111123 Obsoletes: %{name}-libs < 1.3.2-4.20111123 # For Fedora 15 and lower, and for EL6 we need to split out the emacs # support into a sub-package. For Fedora 16 and later keep the emacs # support files in the main package and require the emacs-filesystem # package %if 0%{?fedora} >= 16 Requires: emacs-filesystem >= %{_emacs_version} %endif %description Gerris is an Open Source Free Software library for the solution of the partial differential equations describing fluid flow. A brief summary of its main (current) features: * Quadtree-based (Octree in 3D) spatial discretisation with automatic and dynamic refinement. * Multigrid Poisson solver. * Second-order Godunov type advection scheme. * Solves the time-dependent incompressible Euler, Stokes ans Navier-Stokes equations. * Support for complex solid boundaries (automatic locally-refined mesh generation). %if 0%{?fedora} < 16 || 0%{?rhel} %package -n emacs-%{name} Summary: Emacs mode for editing Gerris input files Group: Applications/Editors BuildArch: noarch Requires: emacs(bin) >= %{_emacs_version} %description -n emacs-%{name} Emacs mode for editing Gerris input files. %endif %if %{with_openmpi} %package openmpi Summary: Gerris runtime with OpenMPI support Group: Applications/Engineering Requires: %{name} = %{version}-%{release} Requires: hdf5-openmpi BuildRequires: openmpi-devel hdf5-openmpi-devel %description openmpi This package contains the Gerris runtime compiled with OpenMPI support %endif %if %{with_mpich2} %package mpich2 Summary: Gerris runtime with MPICH2 support Group: Applications/Engineering Requires: %{name} = %{version}-%{release} Requires: hdf5-mpich2 BuildRequires: mpich2-devel hdf5-mpich2-devel %description mpich2 This package contains the Gerris runtime compiled with MPICH2 support. %endif %prep %setup -q -n %{name}-snapshot-%{snapshot} %patch0 -p1 autoreconf %build # Note the configure script doesn't honor --disable-rpath so we have # to do it manually with the two sed invocations in this macro. %global rm_rpath() \ 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 ; # Build serial version, dummy arguments mkdir serial cp -a build_function* serial pushd serial ln -s ../configure . %{configure} --disable-mpi %rm_rpath make %{?_smp_mflags} popd # Build parallel versions: set compiler variables to MPI wrappers export CC=mpicc export CXX=mpicxx export FC=mpif90 export F77=mpif77 for mpi in %{mpi_list} do mkdir $mpi cp -a build_function* $mpi pushd $mpi module load $mpi-%{_arch} ln -s ../configure . # Note here that it should only be necessary to set datarootdir, but # for some reason datadir isn't inheriting datarootdir on rhel6 %configure \ --libdir=$MPI_LIB \ --bindir=$MPI_BIN \ --sbindir=$MPI_HOME/sbin \ --includedir=$MPI_INCLUDE \ --datarootdir=$MPI_HOME/share \ --datadir=$MPI_HOME/share \ --mandir=$MPI_MAN %rm_rpath make %{?_smp_mflags} module purge popd done %install rm -rf $RPM_BUILD_ROOT # Install serial version make -C serial install DESTDIR=%{buildroot} #INSTALL="install -p" CPPROG="cp -p" # Remove libtool archive files and static libs rm -f $RPM_BUILD_ROOT%{_libdir}/*.la rm -f $RPM_BUILD_ROOT%{_libdir}/*.a # Remove incorrectly located elisp file rm -f $RPM_BUILD_ROOT%{_datadir}/gerris/*.el # Remove this as it's a convenience script for the gerris developers rm -f $RPM_BUILD_ROOT%{_bindir}/darcs2dist # MPI installs for mpi in %{mpi_list} do module load $mpi-%{_arch} make -C $mpi install DESTDIR=$RPM_BUILD_ROOT # These removed for the same reasons as in the serial package rm -f $RPM_BUILD_ROOT/$MPI_LIB/*.la rm -f $RPM_BUILD_ROOT/$MPI_LIB/*.a rm -f $RPM_BUILD_ROOT/$MPI_HOME/share/gerris/*.el rm -f $RPM_BUILD_ROOT/$MPI_BIN/darcs2dist # These make little sense outside of their normal location, so remove rm -f $RPM_BUILD_ROOT/$MPI_HOME/share/mime/packages/*.xml rm -f $RPM_BUILD_ROOT/$MPI_HOME/share/icons/hicolor/48x48/mimetypes/*.png module purge done # Properly install the Emacs elisp files and byte compile them install -d $RPM_BUILD_ROOT%{_emacs_sitelispdir}/%{name} install -m 644 doc/examples/gfs-mode.el $RPM_BUILD_ROOT%{_emacs_sitelispdir}/%{name} install -m 644 serial/doc/examples/gfs-keywords.el $RPM_BUILD_ROOT%{_emacs_sitelispdir}/%{name} # Byte compilation currently broken #{_emacs_bytecompile} $RPM_BUILD_ROOT%{_emacs_sitelispdir}/%{name}/gfs-mode.el #{_emacs_bytecompile} $RPM_BUILD_ROOT%{_emacs_sitelispdir}/%{name}/gfs-keywords.el # Load gfs-mode on start-up of Emacs install -d $RPM_BUILD_ROOT%{_emacs_sitestartdir} cat > $RPM_BUILD_ROOT%{_emacs_sitestartdir}/gerris.el </dev/null || : /usr/bin/update-mime-database %{_datadir}/mime &> /dev/null || : %postun /sbin/ldconfig if [ $1 -eq 0 ] ; then /bin/touch --no-create %{_datadir}/icons/hicolor &>/dev/null /usr/bin/gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || : fi /usr/bin/update-mime-database %{_datadir}/mime &> /dev/null || : %posttrans /usr/bin/gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || : %if %{with_openmpi} %post openmpi -p /sbin/ldconfig %postun openmpi -p /sbin/ldconfig %endif %if %{with_mpich2} %post mpich2 -p /sbin/ldconfig %postun mpich2 -p /sbin/ldconfig %endif %files %defattr(-,root,root,-) %doc NEWS README TODO COPYING %{_bindir}/* %{_libdir}/gerris/ %{_datadir}/gerris/ %{_mandir}/man1/*.gz %{_datadir}/mime/packages/*.xml %{_datadir}/icons/hicolor/48x48/mimetypes/*.png %{_libdir}/*.so* %{_includedir}/*.h %{_includedir}/gerris/ %{_libdir}/pkgconfig/*.pc %if 0%{?fedora} < 16 || 0%{?rhel} %files -n emacs-%{name} %doc COPYING %defattr(-,root,root,-) %{_emacs_sitelispdir}/%{name} %{_emacs_sitestartdir}/gerris.el %endif %if %{with_openmpi} %files openmpi %defattr(-,root,root,-) %doc NEWS README TODO COPYING %{_libdir}/openmpi/bin/* %{_libdir}/openmpi/lib/gerris/ %{_libdir}/openmpi/share/gerris/ %{_mandir}/openmpi-%{_arch}/man1/*.gz %{_libdir}/openmpi/lib/*.so* %{_includedir}/openmpi-%{_arch}/*.h %{_includedir}/openmpi-%{_arch}/gerris/ %{_libdir}/openmpi/lib/pkgconfig/*.pc %endif %if %{with_mpich2} %files mpich2 %defattr(-,root,root,-) %doc NEWS README TODO COPYING %{_libdir}/mpich2/bin/* %{_libdir}/mpich2/lib/gerris/ %{_libdir}/mpich2/share/gerris/ # Note that this next one should be {_mandir}/mpich2-%{arch}/man1/*.gz # See https://bugzilla.redhat.com/show_bug.cgi?id=786201 %{_mandir}/mpich2/man1/*.gz %{_libdir}/mpich2/lib/*.so* %{_includedir}/mpich2-%{_arch}/*.h %{_includedir}/mpich2-%{_arch}/gerris/ %{_libdir}/mpich2/lib/pkgconfig/*.pc %endif %changelog * Sat Feb 4 2012 Jonathan G. Underwood - 1.3.2-6.20111123 - Add ldconfig calls to post/postun for openmpi and mpicj2 packages - Properly fix rpath removal from libtool (after configure, before make) * Sat Feb 4 2012 Jonathan G. Underwood - 1.3.2-5.20111123 - Cleanups * Mon Jan 31 2012 Jonathan G. Underwood - 1.3.2-4.20111123 - Package overhaul to comply with MPI packaging conventions * Mon Dec 5 2011 Jonathan G. Underwood - 1.3.2-3.20111123 - Add support for Fedora 16 and greater where we don't need to split out the emacs-gerris sub-package * Mon Dec 5 2011 Jonathan G. Underwood - 1.3.2-2.20111123 - Enable fftw and ode plugins * Mon Dec 5 2011 Jonathan G. Underwood - 1.3.2-1.20111123 - Properly package Emacs mode in a subpackage and ensure it's loaded at Emacs start * Mon Dec 5 2011 Jonathan G. Underwood - 1.3.2-0.20111123 - Initial package