26afebd
Name:       gmsh
26afebd
Summary:    A three-dimensional finite element mesh generator
310e560
Version:    2.9.2
5dbec05
Release:    1%{?dist}
26afebd
26afebd
License:    GPLv2+
26afebd
URL:        http://geuz.org/gmsh/
26afebd
# Download source from http://geuz.org/gmsh/src/%%{name}-%%{version}-source.tgz
310e560
# Delete contrib/blossom and contrib/mpeg_encode from source archive
5dbec05
Source0:    %{name}-%{version}-source-fedora.tar.xz
26afebd
Source1:    %{name}.desktop
26afebd
26afebd
# Unbundle most of the bundled libraries, see comments in %%prep
26afebd
Patch0:     gmsh_unbundle.patch
26afebd
# Fix include paths for alglib headers
26afebd
Patch1:     gmsh_alglib.patch
26afebd
# Rename sign macro which conflicts with sign function in alglib header
26afebd
Patch2:     gmsh_sign.patch
26afebd
# Port to newer tetgen
26afebd
Patch3:     gmsh_tetgen.patch
26afebd
# Installation paths fixup, allow setting them from command line for MPI compilation
26afebd
Patch4:     gmsh_install-dirs.patch
26afebd
26afebd
BuildRequires: alglib-devel
26afebd
BuildRequires: ann-devel
26afebd
BuildRequires: blas-devel
26afebd
BuildRequires: cmake
26afebd
BuildRequires: desktop-file-utils
26afebd
BuildRequires: fltk-devel
26afebd
BuildRequires: gcc-gfortran
26afebd
BuildRequires: gmm-devel
26afebd
BuildRequires: gmp-devel
26afebd
BuildRequires: hdf5-devel
26afebd
BuildRequires: lapack-devel
26afebd
BuildRequires: libjpeg-turbo-devel
26afebd
BuildRequires: liblbfgs-devel
26afebd
BuildRequires: libpng-devel
26afebd
BuildRequires: mathex-devel
26afebd
BuildRequires: mesa-libGLU-devel
26afebd
# BuildRequires: metis-devel
26afebd
BuildRequires: mmg3d-devel
26afebd
BuildRequires: netgen-mesher-devel-private
26afebd
BuildRequires: OCE-devel
26afebd
BuildRequires: tetgen-devel
26afebd
BuildRequires: voro++-devel
26afebd
BuildRequires: zlib-devel
26afebd
BuildRequires: openmpi-devel
26afebd
BuildRequires: mpich-devel
26afebd
BuildRequires: cgnslib-devel
26afebd
BuildRequires: med-devel
26afebd
BuildRequires: python2-devel
26afebd
26afebd
Requires:       %{name}-common = %{version}-%{release}
26afebd
26afebd
%description
26afebd
Gmsh is a 3D finite element grid generator with a build-in CAD engine 
26afebd
and post-processor. Its design goal is to provide a fast, light and 
26afebd
user-friendly meshing tool with parametric input and advanced 
26afebd
visualization capabilities. Gmsh is built around four modules: 
26afebd
geometry, mesh, solver and post-processing. The specification of any 
26afebd
input to these modules is done either interactively using the 
26afebd
graphical user interface or in ASCII text files using Gmsh's own scripting 
26afebd
language.
26afebd
26afebd
%package common
26afebd
Summary:        Common files for %{name}
26afebd
Requires:       hicolor-icon-theme
26afebd
BuildArch:      noarch
26afebd
26afebd
%description common
26afebd
Common files for %{name}.
26afebd
26afebd
26afebd
%package libs
26afebd
Summary:        Libraries provided by %{name}
26afebd
26afebd
26afebd
%description libs
26afebd
Libraries provided by %{name}. These libraries are not required for 
26afebd
base %{name} package and are used for development only.
26afebd
26afebd
26afebd
%package devel
26afebd
Summary:        Development with %{name}
26afebd
Requires:       %{name}-libs%{?_isa} = %{version}-%{release}
26afebd
26afebd
%description devel
26afebd
Header files for development with %{name}.
26afebd
26afebd
26afebd
%package doc
26afebd
Summary:        Documentation, demos and tutorials for %{name}
8e301b6
Requires:       %{name} = %{version}-%{release}
26afebd
BuildArch:      noarch
26afebd
26afebd
%description doc
26afebd
Documentation, demo projects and tutorials for %{name}.
26afebd
26afebd
###############################################################################
26afebd
26afebd
%package        openmpi
26afebd
Summary:        %{name} compiled against openmpi
26afebd
# Require explicitly for dir ownership and to guarantee the pickup of the right runtime
26afebd
Requires:       openmpi
26afebd
Requires:       %{name}-common = %{version}-%{release}
26afebd
Requires:       %{name}-openmpi-libs%{?_isa} = %{version}-%{release}
26afebd
26afebd
%description    openmpi
26afebd
%{name} compiled against openmpi.
26afebd
26afebd
%package        openmpi-libs
26afebd
Summary:        %{name} libraries compiled against openmpi
26afebd
26afebd
%description    openmpi-libs
26afebd
%{name} libraries compiled against openmpi.
26afebd
26afebd
%package        openmpi-devel
26afebd
Summary:        Development files for %{name} compiled against openmpi
26afebd
# Require explicitly for dir ownership
26afebd
Requires:       openmpi-devel
26afebd
Requires:       %{name}-openmpi%{?_isa} = %{version}-%{release}
26afebd
26afebd
%description    openmpi-devel
26afebd
Development files for %{name} compiled against openmpi.
26afebd
26afebd
###############################################################################
26afebd
26afebd
%package        mpich
26afebd
Summary:        %{name} compiled against mpich
26afebd
# Require explicitly for dir ownership and to guarantee the pickup of the right runtime
26afebd
Requires:       mpich
26afebd
Requires:       %{name}-common = %{version}-%{release}
26afebd
Requires:       %{name}-mpich-libs%{?_isa} = %{version}-%{release}
26afebd
26afebd
%description    mpich
26afebd
%{name} compiled against mpich.
26afebd
26afebd
%package        mpich-libs
26afebd
Summary:        %{name} libraries compiled against mpich
26afebd
26afebd
%description    mpich-libs
26afebd
%{name} libraries compiled against mpich.
26afebd
26afebd
%package        mpich-devel
26afebd
Summary:        Development files for %{name} compiled against mpich
26afebd
# Require explicitly for dir ownership
26afebd
Requires:       mpich-devel
26afebd
Requires:       %{name}-mpich%{?_isa} = %{version}-%{release}
26afebd
26afebd
%description    mpich-devel
26afebd
Development files for %{name} compiled against mpich.
26afebd
26afebd
###############################################################################
26afebd
26afebd
%prep
26afebd
%autosetup -p1 -n %{name}-%{version}-source
26afebd
26afebd
# Copy these outside the contrib folder (Patch takes care of including these in the build)
26afebd
cp contrib/Netgen/nglib_gmsh.h contrib/Netgen/nglib_gmsh.cpp Mesh
26afebd
26afebd
# Bamg: part of freefem++, modified source code
26afebd
# Chaco: http://www.cs.sandia.gov/~bahendr/chaco.html - no fedora package, modified source code, see contrib/Chaco/README.txt
26afebd
# DiscreteIntegration: gmsh internal module
26afebd
# HighOrderMeshOptimizer: gmsh internal module
26afebd
# kbipack: Source not available on the net anymore
26afebd
# onelab: gmsh internal module
26afebd
# rtree: single header file from http://superliminal.com/sources/sources.htm
26afebd
ls -1 contrib | \
26afebd
    grep -v ^bamg$ | \
26afebd
    grep -v ^Chaco$ | \
26afebd
    grep -v ^DiscreteIntegration$ | \
26afebd
    grep -v ^HighOrderMeshOptimizer$ | \
26afebd
    grep -v ^kbipack$ | \
26afebd
    grep -v ^onelab$ | \
26afebd
    grep -v ^rtree$ | \
26afebd
rm -rf
26afebd
26afebd
# Convert to utf-8
26afebd
for file in tutorial/t12.geo; do
26afebd
    iconv -f ISO-8859-1 -t UTF-8 -o $file.new $file && \
26afebd
    touch -r $file $file.new && \
26afebd
    mv $file.new $file
26afebd
done
26afebd
26afebd
# Fix line endings
26afebd
sed -i 's|\r||g' demos/component8.step
26afebd
26afebd
26afebd
%build
26afebd
# mpeg not in fedora due to patent issues
26afebd
# gmsh only supports metis 4
26afebd
# blossoms is nonfree, see contrib/blossoms/README.txt
26afebd
26afebd
### serial version ###
26afebd
mkdir build-serial
26afebd
pushd build-serial
5dbec05
LDFLAGS="%{__global_ldflags} -Wl,--as-needed" %cmake .. \
26afebd
    -DENABLE_BUILD_LIB=YES \
26afebd
    -DENABLE_BUILD_SHARED=YES \
26afebd
    -DENABLE_BUILD_DYNAMIC=YES \
26afebd
    -DENABLE_MPEG_ENCODE=NO \
26afebd
    -DENABLE_METIS=NO \
26afebd
    -DENABLE_BLOSSOM=NO \
26afebd
    -DENABLE_CGNS=YES \
26afebd
    -DENABLE_MED=YES
26afebd
26afebd
make %{?_smp_mflags}
26afebd
popd
26afebd
26afebd
### openmpi version ###
26afebd
%{_openmpi_load}
26afebd
export CXX=mpicxx
26afebd
mkdir build-openmpi
26afebd
pushd build-openmpi
5dbec05
LDFLAGS="%{__global_ldflags} -Wl,--as-needed" %cmake .. \
26afebd
    -DENABLE_BUILD_LIB=YES \
26afebd
    -DENABLE_BUILD_SHARED=YES \
26afebd
    -DENABLE_BUILD_DYNAMIC=YES \
26afebd
    -DENABLE_MPI=YES \
26afebd
    -DGMSH_BIN=$MPI_BIN \
26afebd
    -DGMSH_LIB=$MPI_LIB \
26afebd
    -DGMSH_INCLUDE=$MPI_INCLUDE \
26afebd
    -DENABLE_MPEG_ENCODE=NO \
26afebd
    -DENABLE_METIS=NO \
26afebd
    -DENABLE_BLOSSOM=NO \
26afebd
    -DENABLE_CGNS=YES \
26afebd
    -DENABLE_MED=YES
26afebd
26afebd
make %{?_smp_mflags}
26afebd
popd
26afebd
%{_openmpi_unload}
26afebd
26afebd
### mpich version ###
26afebd
%{_mpich_load}
26afebd
export CXX=mpicxx
26afebd
mkdir build-mpich
26afebd
pushd build-mpich
5dbec05
LDFLAGS="%{__global_ldflags} -Wl,--as-needed" %cmake .. \
26afebd
    -DENABLE_BUILD_LIB=YES \
26afebd
    -DENABLE_BUILD_SHARED=YES \
26afebd
    -DENABLE_BUILD_DYNAMIC=YES \
26afebd
    -DENABLE_MPI=YES \
26afebd
    -DGMSH_BIN=$MPI_BIN \
26afebd
    -DGMSH_LIB=$MPI_LIB \
26afebd
    -DGMSH_INCLUDE=$MPI_INCLUDE \
26afebd
    -DENABLE_MPEG_ENCODE=NO \
26afebd
    -DENABLE_METIS=NO \
26afebd
    -DENABLE_BLOSSOM=NO \
26afebd
    -DENABLE_CGNS=YES \
26afebd
    -DENABLE_MED=YES
26afebd
26afebd
make %{?_smp_mflags}
26afebd
popd
26afebd
%{_mpich_unload}
26afebd
26afebd
26afebd
# Fix to create correct debuginfo
26afebd
cp -a Parser/Gmsh.* build-serial
26afebd
cp -a Parser/Gmsh.* build-openmpi
26afebd
cp -a Parser/Gmsh.* build-mpich
26afebd
26afebd
26afebd
%install
26afebd
%make_install -C build-openmpi
26afebd
%make_install -C build-mpich
26afebd
%make_install -C build-serial
26afebd
26afebd
# Remove static libraries
26afebd
find %{buildroot} -type f -name libGmsh.a -exec rm -f {} \;
26afebd
26afebd
# Install icon and .desktop file
26afebd
install -Dpm 0644 utils/icons/solid_128x128.png  %{buildroot}%{_datadir}/icons/hicolor/128x128/apps/%{name}.png
26afebd
desktop-file-install --dir=%{buildroot}%{_datadir}/applications %{SOURCE1}
26afebd
26afebd
# Add API demo to documentation
26afebd
install -Dpm 0644 utils/api_demos/mainSimple.cpp %{buildroot}%{_defaultdocdir}/%{name}/api/mainSimple.cpp
26afebd
5dbec05
# Install License.txt via %%license
5dbec05
rm -f %{buildroot}%{_defaultdocdir}/%{name}/LICENSE.txt
5dbec05
26afebd
26afebd
%post common
26afebd
/usr/bin/update-desktop-database &> /dev/null || :
26afebd
/bin/touch --no-create %{_datadir}/icons/hicolor &>/dev/null || :
26afebd
26afebd
%postun common
26afebd
/usr/bin/update-desktop-database &> /dev/null || :
26afebd
if [ $1 -eq 0 ] ; then
26afebd
    /bin/touch --no-create %{_datadir}/icons/hicolor &>/dev/null
26afebd
    /usr/bin/gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
26afebd
fi
26afebd
26afebd
%posttrans common
26afebd
/usr/bin/gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
26afebd
26afebd
26afebd
%post libs -p /sbin/ldconfig
26afebd
26afebd
%postun libs -p /sbin/ldconfig
26afebd
26afebd
26afebd
%post openmpi-libs -p /sbin/ldconfig
26afebd
26afebd
%postun openmpi-libs -p /sbin/ldconfig
26afebd
26afebd
26afebd
%post mpich-libs -p /sbin/ldconfig
26afebd
26afebd
%postun mpich-libs -p /sbin/ldconfig
26afebd
26afebd
26afebd
%files common
26afebd
%doc %{_defaultdocdir}/%{name}/CREDITS.txt
26afebd
%doc %{_defaultdocdir}/%{name}/README.txt
5dbec05
%license doc/LICENSE.txt
26afebd
%{_mandir}/man1/gmsh.1.gz
26afebd
%{_datadir}/icons/hicolor/128x128/apps/%{name}.png
26afebd
%{_datadir}/applications/%{name}.desktop
26afebd
%{python2_sitelib}/onelab.py*
26afebd
26afebd
%files doc
5dbec05
%license doc/LICENSE.txt
26afebd
%doc %{_defaultdocdir}/%{name}/tutorial
26afebd
%doc %{_defaultdocdir}/%{name}/demos
26afebd
%doc %{_defaultdocdir}/%{name}/api
26afebd
26afebd
%files
26afebd
%{_bindir}/%{name}
26afebd
26afebd
%files devel
26afebd
%{_includedir}/%{name}/
26afebd
%{_libdir}/libGmsh.so
26afebd
26afebd
%files libs
5dbec05
%license doc/LICENSE.txt
26afebd
%{_libdir}/libGmsh.so.*
26afebd
26afebd
%files openmpi
26afebd
%{_libdir}/openmpi/bin/%{name}
26afebd
26afebd
%files openmpi-devel
26afebd
%{_includedir}/openmpi*/%{name}/
26afebd
%{_libdir}/openmpi/lib/libGmsh.so
26afebd
26afebd
%files openmpi-libs
5dbec05
%license doc/LICENSE.txt
26afebd
%{_libdir}/openmpi/lib/libGmsh.so.*
26afebd
26afebd
%files mpich
26afebd
%{_libdir}/mpich/bin/%{name}
26afebd
26afebd
%files mpich-devel
26afebd
%{_includedir}/mpich*/%{name}/
26afebd
26afebd
%{_libdir}/mpich/lib/libGmsh.so
26afebd
26afebd
%files mpich-libs
5dbec05
%license doc/LICENSE.txt
26afebd
%{_libdir}/mpich/lib/libGmsh.so.*
26afebd
26afebd
26afebd
%changelog
310e560
* Tue Mar 31 2015 Sandro Mani <manisandro@gmail.com> - 2.9.2-1
310e560
- Update to 2.9.2
310e560
335d05d
* Wed Mar 18 2015 Sandro Mani <manisandro@gmail.com> - 2.9.1-1
335d05d
- Update to 2.9.1
335d05d
5dbec05
* Sat Mar 14 2015 Sandro Mani <manisandro@gmail.com> - 2.9.0-1
5dbec05
- Update to 2.9.0
5dbec05
- Use %%license
5dbec05
- Fix -Wl,--as-needed clearing default LDFLAGS
5dbec05
Rex Dieter 8a5c778
* Thu Feb 19 2015 Rex Dieter <rdieter@fedoraproject.org> 2.8.5-8
Rex Dieter 8a5c778
- rebuild (fltk)
Rex Dieter 8a5c778
Orion Poplawski c390e00
* Wed Jan 07 2015 Orion Poplawski <orion@cora.nwra.com> - 2.8.5-7
Orion Poplawski c390e00
- Rebuild for hdf5 1.8.14
Orion Poplawski c390e00
5dbec05
* Sat Dec 13 2014 Sandro Mani <manisandro@gmail.com> - 2.8.5-6
1a850af
- Rebuild (alglib)
1a850af
5d16865
* Tue Oct 07 2014 Sandro Mani <manisandro@gmail.com> - 2.8.5-5
5d16865
- Rebuild (netgen-mesher)
5d16865
Rex Dieter 3f49768
* Sat Sep 06 2014 Rex Dieter <rdieter@fedoraproject.org> 2.8.5-4
Rex Dieter 3f49768
- rebuild (gmm)
Rex Dieter 3f49768
29d5e6f
* Sat Aug 16 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.8.5-3
29d5e6f
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild
29d5e6f
4010a70
* Tue Jul 29 2014 Sandro Mani <manisandro@gmail.com> - 2.8.5-2
4010a70
- Rebuild (OCE)
4010a70
8e301b6
* Wed Jul 23 2014 Sandro Mani <manisandro@gmail.com> - 2.8.5-1
8e301b6
- Update to 2.8.5
8e301b6
- Fix -doc requires
8e301b6
- Rebase patches
8e301b6
26afebd
* Tue Jul 22 2014 Sandro Mani <manisandro@gmail.com> - 2.8.4-4
26afebd
- Rename gmsh-demos to gmsh-doc
26afebd
- Fix scriptlets for gmsh-common
26afebd
- Install license file with *-libs subpackages
26afebd
26afebd
* Thu Jul 17 2014 Sandro Mani <manisandro@gmail.com> - 2.8.4-3
26afebd
- Fix encoding of file tutorial/t12.geo
26afebd
- Fix line endings of demos/component8.step
26afebd
- Fix incorrect changelog
26afebd
- Add -Wl,--as-needed
26afebd
- Add BRs: cgnslib-devel med-devel
26afebd
- Pass -DENABLE_CGNS=YES -DENABLE_MED=YES to cmake
26afebd
- Install onelab.py in %%{python2_sitelib}
26afebd
- Add missing Requires: gmsh-common
26afebd
26afebd
* Thu Jun 19 2014 Sandro Mani <manisandro@gmail.com> - 2.8.4-2
26afebd
- Link executable against library
26afebd
- Compile with mpi support
26afebd
26afebd
* Sat Jun 14 2014 Sandro Mani <manisandro@gmail.com> - 2.8.4-1
26afebd
- Update to 2.8.3
26afebd
- Update/add patches for unbundling libraries
26afebd
- Spec cleanup, add missing scriptlets
26afebd
26afebd
* Mon Jan 23 2012 Alexey Vasyukov <vasyukov@gmail.com> - 2.5.0-6
26afebd
- Add script to remove prohibited code completely from sources
26afebd
- Do not set CMake flags because they are set in CMakeLists.txt by the script now
26afebd
26afebd
* Mon Nov 14 2011 Alexey Vasyukov <vasyukov@gmail.com> - 2.5.0-5
26afebd
- Disable MPEG support because of patent issues
26afebd
- Add patch to use system ANN instead of built-in one
26afebd
- Add patch to use system GMM instead of built-in one
26afebd
- Update CMake soname patch to avoid hardcoded numbers
26afebd
26afebd
* Sun Nov 13 2011 Alexey Vasyukov <vasyukov@gmail.com> - 2.5.0-4
26afebd
- Add patch for API demo to make it usable
26afebd
26afebd
* Sun Nov 13 2011 Alexey Vasyukov <vasyukov@gmail.com> - 2.5.0-3
26afebd
- Add desktop files
26afebd
26afebd
* Sat Nov 12 2011 Alexey Vasyukov <vasyukov@gmail.com> - 2.5.0-2
26afebd
- Break into subpackages
26afebd
26afebd
* Thu Nov 10 2011 Alexey Vasyukov <vasyukov@gmail.com> - 2.5.0-1
26afebd
- Initial build for Fedora