# Note that gfsview is distributed in the form of snapshot tarballs of # the darcs development tree at various intervals. No formal version number. # # Downloads are available from: # http://gerris.dalembert.upmc.fr/gerris/tarballs/ %global snapshot 111003 # 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: gfsview Version: 0 Release: 0.4.20%{snapshot}%{?dist} Summary: A visualizer for Gerris simulations 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 fixes up errors in Makefile.am files which break out-of-tree builds Patch0: gfsview-111003-out-of-tree-build.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRequires: gerris BuildRequires: gtk2-devel BuildRequires: gtkglext-devel BuildRequires: startup-notification-devel BuildRequires: mesa-libOSMesa-devel Requires: hicolor-icon-theme %description GfsView displays the results of 2D and 3D Gerris simulations. A brief summary of its main features: * Scalar and vector cross-sections. * Isosurfaces. * Streamlines. * User-defined functions. * Fast adaptive display (using the multiresolution data representation of Gerris). * Scriptable. * Offline image generation. * Quality PostScript, PDF and bitmap outputs. See http://gfs.sf.net for more information and documentation. %if %{with_openmpi} %package openmpi Summary: Gerris visualizer with OpenMPI support Group: Applications/Engineering Requires: %{name} = %{version}-%{release} BuildRequires: openmpi-devel %description openmpi This package contains the GFSView visualizer for Gerris compiled with OpenMPI support. %endif %if %{with_mpich2} %package mpich2 Summary: Gerris visualizer with MPICH2 support Group: Applications/Engineering Requires: %{name} = %{version}-%{release} BuildRequires: mpich2-devel %description mpich2 This package contains the GFSView visualizer for Gerris compiled with MPICH2 support. %endif %prep %setup -q -n %{name}-snapshot-%{snapshot} %patch0 -p1 -b .outoftree 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 ; mkdir 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 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=$RPM_BUILD_ROOT # Remove libtool archive files and static libs. Note that we don't # remove static libs and .la files from {_libdir}/gerris as these are # needed for on-the-fly function compilation. rm -f $RPM_BUILD_ROOT%{_libdir}/*.la rm -f $RPM_BUILD_ROOT%{_libdir}/*.a # 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 # These make little sense outside of their normal location, so remove rm -rf $RPM_BUILD_ROOT/$MPI_HOME/share/applications rm -rf $RPM_BUILD_ROOT/$MPI_HOME/share/mime rm -rf $RPM_BUILD_ROOT/$MPI_HOME/share/icons module purge done %clean rm -rf $RPM_BUILD_ROOT %post /sbin/ldconfig /bin/touch --no-create %{_datadir}/icons/hicolor &>/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 README COPYING NEWS THANKS AUTHORS TODO %{_bindir}/* %{_libdir}/*so* # Note that we don't remove static libs and .la files from this directory %{_libdir}/gerris/* %{_datadir}/gfsview %{_datadir}/applications/* %{_datadir}/icons/hicolor/48x48/mimetypes/*.png %{_datadir}/mime/packages/gfsview.xml %if %{with_openmpi} %files openmpi %defattr(-,root,root,-) %doc NEWS README TODO COPYING %{_libdir}/openmpi/bin/* %{_libdir}/openmpi/lib/gerris/* %{_libdir}/openmpi/share/gfsview %{_libdir}/openmpi/lib/*.so* %endif %if %{with_mpich2} %files mpich2 %defattr(-,root,root,-) %doc NEWS README TODO COPYING %{_libdir}/mpich2/bin/* %{_libdir}/mpich2/lib/gerris/* %{_libdir}/mpich2/share/gfsview/ %{_libdir}/mpich2/lib/*.so* %endif %changelog * Sat Feb 4 2012 Jonathan G. Underwood - 0-0.4.111003 - Fix release numbering to comply with Fedora packaging guidelines - Add ldconfig calls to post/postun for openmpi and mpich2 packages * Sat Feb 4 2012 Jonathan G. Underwood - 0-0.3.111003 - Fix up rpath removal from libtool (after configure, before make) * Fri Feb 3 2012 Jonathan G. Underwood - 0-0.2.111003 - Initial package