Blob Blame History Raw
# Bump this as appropriate when doing release updates, check i.e. with abi_compliance_checker
# First digit: major, bump when incompatible changes were performed
# Second digit: minor, bump when interface was extended
%global mmg2d_sover 5.0.0
%global mmg3d_sover 5.0.0
%global mmgs_sover 5.0.0
%global mmg_sover 5.0.0

Name:           mmg
Version:        5.3.13
Release:        1%{?dist}
Summary:        Surface and volume remeshers

License:        LGPLv3+
URL:            https://www.mmgtools.org/
Source0:        https://github.com/MmgTools/mmg/archive/v%{version}/%{name}-%{version}.tar.gz

# - Set project language to C
# - Fix library installation dirs
# - Add shared library versioning
Patch0:         mmg_cmake.patch

BuildRequires:  doxygen
BuildRequires:  cmake
BuildRequires:  gcc
BuildRequires:  make
BuildRequires:  scotch-devel


%description
mmg is an open source software for bidimensional and tridimensional surface and
volume remeshing. It provides:
- The mmg2d application and library: adaptation and optimization of a
  bidimensional triangulation
- The mmgs application and library: adaptation and optimization of a surface
  triangulation and isovalue discretization
- The mmg3d application and library: adaptation and optimization of a
  tetrahedral mesh and implicit domain meshing
- The mmg library, combining the mmg2d, mmgs and mmg3d libraries.


%package devel
Summary:        Development files for %{name}
Requires:       %{name}%{?_isa} = %{version}-%{release}

%description devel
The %{name}-devel package contains libraries and header files for
developing applications that use %{name}.

###############################################################################

%package -n mmg2d
Summary:        Surface remesher

%description -n mmg2d
The mmg2d application and library: adaptation and optimization of a
bidimensional triangulation.


%package -n mmg2d-devel
Summary:        Development files for mmg2d
Requires:       mmg2d%{?_isa} = %{version}-%{release}

%description -n mmg2d-devel
The mmg2d-devel package contains libraries and header files for
developing applications that use mmg2d.


%package -n mmg2d-devel-doc
Summary:        Development documentation for mmg2d
BuildArch:      noarch

%description -n mmg2d-devel-doc
The mmg2d-devel-doc package contains the documentation for developing
applications that use mmg2d.

###############################################################################

%package -n mmgs
Summary:        Surface remesher

%description -n mmgs
The mmgs application and library: adaptation and optimization of a surface
triangulation and isovalue discretization.


%package -n mmgs-devel
Summary:        Development files for mmgs
Requires:       mmgs%{?_isa} = %{version}-%{release}

%description -n mmgs-devel
The mmgs-devel package contains libraries and header files for
developing applications that use mmgs.


%package -n mmgs-devel-doc
Summary:        Development documentation for mmgs
BuildArch:      noarch

%description -n mmgs-devel-doc
The mmgs-devel-doc package contains the documentation for developing
applications that use mmgs.

###############################################################################

%package -n mmg3d
Summary:        Volume remesher
Obsoletes:      mmg3d-libs < 5.3.10
Provides:       mmg3d-libs = %{version}-%{release}

%description -n mmg3d
The mmg3d application and library: adaptation and optimization of a
tetrahedral mesh and implicit domain meshing.


%package -n mmg3d-devel
Summary:        Development files for mmg3d
Requires:       mmg3d%{?_isa} = %{version}-%{release}

%description -n mmg3d-devel
The mmg3d-devel package contains libraries and header files for
developing applications that use mmg3d

%package -n mmg3d-devel-doc
Summary:        Development documentation for mmg3d
Requires:       mmg3d%{?_isa} = %{version}-%{release}

%description -n mmg3d-devel-doc
The mmg3d-devel-doc package contains the documentation for developing
applications that use mmg3d

###############################################################################


%prep
%autosetup -p1


%build
LDFLAGS="%{__global_ldflags} -Wl,--as-needed" %cmake \
    -DBUILD_SHARED_LIBS=ON \
    -Dlibmmg2d_so_SOVER=%{mmg2d_sover} \
    -Dlibmmg3d_so_SOVER=%{mmg3d_sover} \
    -Dlibmmgs_so_SOVER=%{mmgs_sover} \
    -Dlibmmg_so_SOVER=%{mmg_sover} .

%make_build
make doc


%install
%make_install

# Install suffix-less symlinks
ln -s mmg2d_O3 %{buildroot}/%{_bindir}/mmg2d
ln -s mmgs_O3 %{buildroot}/%{_bindir}/mmgs
ln -s mmg3d_O3 %{buildroot}/%{_bindir}/mmg3d

# Install man pages
install -Dpm 0644 doc/man/mmg2d.1.gz %{buildroot}%{_mandir}/man1/mmg2d.1.gz
install -Dpm 0644 doc/man/mmgs.1.gz %{buildroot}%{_mandir}/man1/mmgs.1.gz
install -Dpm 0644 doc/man/mmg3d.1.gz %{buildroot}%{_mandir}/man1/mmg3d.1.gz


%ldconfig_scriptlets
%ldconfig_scriptlets -n mmg2d
%ldconfig_scriptlets -n mmgs
%ldconfig_scriptlets -n mmg3d


%files
%doc AUTHORS README.md
%license LICENSE COPYING COPYING.LESSER
%{_libdir}/libmmg.so.*

%files devel
%dir %{_includedir}/mmg
%{_includedir}/mmg/libmmg.h
%{_includedir}/mmg/libmmgf.h
%{_libdir}/libmmg.so

%files -n mmg2d
%doc AUTHORS README.md
%license LICENSE COPYING COPYING.LESSER
%{_bindir}/mmg2d_O3
%{_bindir}/mmg2d
%{_libdir}/libmmg2d.so.*
%{_mandir}/man1/mmg2d.1*

%files -n mmg2d-devel
%dir %{_includedir}/mmg
%{_includedir}/mmg/mmg2d/
%{_libdir}/libmmg2d.so

%files -n mmg2d-devel-doc
%doc doc/mmg2d/html

%files -n mmgs
%doc AUTHORS README.md
%license LICENSE COPYING COPYING.LESSER
%{_bindir}/mmgs_O3
%{_bindir}/mmgs
%{_libdir}/libmmgs.so.*
%{_mandir}/man1/mmgs.1*

%files -n mmgs-devel
%dir %{_includedir}/mmg
%{_includedir}/mmg/mmgs/
%{_libdir}/libmmgs.so

%files -n mmgs-devel-doc
%doc doc/mmgs/html

%files -n mmg3d
%doc AUTHORS README.md
%license LICENSE COPYING COPYING.LESSER
%{_bindir}/mmg3d_O3
%{_bindir}/mmg3d
%{_libdir}/libmmg3d.so.*
%{_mandir}/man1/mmg3d.1*

%files -n mmg3d-devel
%dir %{_includedir}/mmg
%{_includedir}/mmg/mmg3d/
%{_libdir}/libmmg3d.so

%files -n mmg3d-devel-doc
%doc doc/mmg3d/html


%changelog
* Thu Jan 24 2019 Sandro Mani <manisandro@gmail.com> - 5.3.13-1
- Update to 5.3.13

* Wed Aug 29 2018 Sandro Mani <manisandro@gmail.com> - 5.3.11-1
- Update to 5.3.11

* Thu Jul 19 2018 Sandro Mani <manisandro@gmail.com> - 5.3.10-4
- Rebuild (scotch)

* Fri Jul 13 2018 Fedora Release Engineering <releng@fedoraproject.org> - 5.3.10-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild

* Sun Jun 10 2018 Sandro Mani <manisandro@gmail.com> - 5.3.10-2
- Use %%ldconfig_scriptlets
- Move documentation to separate subpackages
- Install man pages

* Fri Jun 08 2018 Sandro Mani <manisandro@gmail.com> - 5.3.10-1
- Initial package