# Until upstream starts tagging releases properly again, commits are used...
%global commit baef0cebdebbe59cf77aea5ecef5d92a36fac20f
%global shortcommit %(c=%{commit}; echo ${c:0:7})
%global snap .git%{shortcommit}
Name: engrid
Version: 2.0.0
Release: 0.13%{?snap}%{?dist}
Summary: Mesh generation tool
License: GPLv3+
URL: http://engits.eu/en/engrid
# wget https://github.com/enGits/engrid/tarball/$commit
Source0: https://github.com/enGits/engrid/archive/%{commit}.tar.gz
# Taken from src/libengrid/resources/icons/G.png and resized to 64x64
Source1: engrid.png
# - Unbundle netgen
# - Link against netcdf_cxx
# - Link against vtk libraries
# - Don't link against QtNetwork
Patch0: engrid_build.patch
# Fix build against VTK 6.3, works for 6.1+
# https://github.com/enGits/engrid/issues/55
Patch1: engrid-vtk.patch
BuildRequires: gcc-c++
BuildRequires: cmake
BuildRequires: desktop-file-utils
BuildRequires: qt-devel
BuildRequires: vtk-devel >= 6.1
BuildRequires: CGAL-devel
BuildRequires: tetgen-devel
BuildRequires: netcdf-cxx-devel
BuildRequires: tex(latex)
BuildRequires: texlive-helvetic texlive-ec
BuildRequires: tex(amsfonts.sty)
BuildRequires: tex(amsmath.sty)
BuildRequires: tex(amssymb.sty)
BuildRequires: tex(babel.sty)
BuildRequires: tex(boxedminipage.sty)
BuildRequires: tex(calc.sty)
BuildRequires: tex(color.sty)
BuildRequires: tex(fancyhdr.sty)
BuildRequires: tex(fontenc.sty)
BuildRequires: tex(graphicx.sty)
BuildRequires: tex(helvet.sty)
BuildRequires: tex(ifthen.sty)
BuildRequires: tex(inputenc.sty)
BuildRequires: tex(lastpage.sty)
BuildRequires: tex(layouts.sty)
BuildRequires: tex(natbib.sty)
BuildRequires: tex(setspace.sty)
BuildRequires: tex(titlesec.sty)
BuildRequires: tex(ucs.sty)
BuildRequires: tex(xspace.sty)
BuildRequires: tex(german.ldf)
Requires: hicolor-icon-theme
%description
enGrid is an open-source mesh generation software with CFD applications in mind.
enGrid uses the Netgen library for tetrahedral grid generation and an in-house
development for prismatic boundary layer grids. Internally, enGrid uses the VTK
data structures as well as the *.vtu file format.
%package devel
Summary: Development files for enGrid
Requires: %{name}%{?_isa} = %{version}-%{release}
%description devel
The %{name}-devel package contains libraries and header files for
developing applications that use enGrid.
%package doc
Summary: Documentation and Tutorials for enGrid
BuildArch: noarch
Obsoletes: %{name}-blender < 1.4.0-6
Provides: %{name}-blender = %{version}-%{release}
%description doc
This package contains the documentation and tutorials for enGrid.
%prep
%autosetup -p1 -n engrid-%{commit}
# Unbundle tetgen
rm -rf src/tetgen
# Fix bad permissions
chmod -x src/libengrid/egvtkinteractorstyle.h
chmod -x src/libengrid/egvtkinteractorstyle.cpp
chmod -x src/libengrid/createvolumemesh.cpp
%build
# Build application
pushd src
LDFLAGS="%{__global_ldflags} -Wl,--as-needed" %cmake -DGIT_SHA1=%{commit} .
%make_build
popd
# Build documentation
pushd manual
pdflatex main.tex
mv main.pdf manual.pdf
popd
%install
%make_install -C src
# Remove useless script
rm %{buildroot}%{_bindir}/%{name}.bash
# Desktop file, icon
desktop-file-install \
--dir=%{buildroot}%{_datadir}/applications \
--set-icon=engrid \
--add-category=Science \
--remove-category=Education \
engrid.desktop
install -Dpm 0644 %{SOURCE1} %{buildroot}%{_datadir}/icons/hicolor/64x64/apps/engrid.png
# Manpage
install -Dpm 0644 debian/engrid.1 %{buildroot}%{_mandir}/man1/engrid.1
%post
/sbin/ldconfig
update-desktop-database &> /dev/null || :
/bin/touch --no-create %{_datadir}/icons/hicolor &>/dev/null || :
%postun
/sbin/ldconfig
update-desktop-database &> /dev/null || :
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
%posttrans
/usr/bin/gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
%files
%license licence.txt gpl.txt
%{_bindir}/engrid
%{_datadir}/applications/engrid.desktop
%{_datadir}/icons/hicolor/64x64/apps/engrid.png
%{_libdir}/liblibengrid.so.*
%{_mandir}/man1/engrid.1*
%files devel
%{_includedir}/%{name}/
%{_libdir}/liblibengrid.so
%files doc
%doc tutorials manual/manual.pdf src/blender_scripts
%license fdl-1.3.txt
%changelog
* Wed Sep 21 2016 Sandro Mani <manisandro@gmail.com> - 2.0.0-0.13.gitbaef0ce
- Rebuild (CGAL)
* Fri Mar 25 2016 Björn Esser <fedora@besser82.io> - 2.0.0-0.12.gitbaef0ce
- Rebuilt for libjsoncpp.so.1
* Wed Feb 03 2016 Fedora Release Engineering <releng@fedoraproject.org> - 2.0.0-0.11.gitbaef0ce
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
* Thu Jan 21 2016 Orion Poplawski <orion@cora.nwra.com> - 2.0.0-0.10.gitbaef0ce
- Rebuild for hdf5 1.8.16
* Mon Jan 18 2016 Jonathan Wakely <jwakely@redhat.com> - 2.0.0-0.9.gitbaef0ce
- Rebuilt for Boost 1.60
* Thu Oct 29 2015 Orion Poplawski <orion@cora.nwra.com> - 2.0.0-0.8.gitbaef0ce
- Add patch for VTK 6.3 support
* Thu Aug 27 2015 Jonathan Wakely <jwakely@redhat.com> - 2.0.0-0.7.gitbaef0ce
- Rebuilt for Boost 1.59
* Fri Jul 31 2015 Sandro Mani <manisandro@gmail.com> - 2.0.0-0.6.gitbaef0ce
- Rebuild (boost)
* Fri Jul 24 2015 Sandro Mani <manisandro@gmail.com> - 2.0.0-0.5.gitbaef0ce
- Rebuild (boost)
* Wed Jun 17 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.0.0-0.4.gitbaef0ce
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
* Mon May 18 2015 Sandro Mani <manisandro@gmail.com> - 2.0.0-0.3.gitbaef0ce
- Rebuild (hdf5)
* Sun May 03 2015 Kalev Lember <kalevlember@gmail.com> - 2.0.0-0.2.gitbaef0ce
- Rebuilt for GCC 5 C++11 ABI change
* Sun Mar 22 2015 Sandro Mani <manisandro@gmail.com> - 2.0.0-0.1.gitbaef0ce
- Update to latest git
- Remove blender subpackage and ship them in -doc, they are out of date anyway
* Tue Oct 07 2014 Sandro Mani <manisandro@gmail.com> - 1.4.0-5.gite6d55f5
- Rebuild (netgen-mesher)
* Sat Aug 16 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.4.0-4.gite6d55f5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild
* Wed Aug 06 2014 Sandro Mani <manisandro@gmail.com> - 1.4.0-3.gite6d55f5
- Install manpage
- Fix spurious executable permissions
* Wed Jul 30 2014 Sandro Mani <manisandro@gmail.com> - 1.4.0-2.gite6d55f5
- Don't rename license file
- Use desktop-file-install to set icon and fix category
- Add doc subpackage
- Add blender subpackage
- Update build patch to also link against vtk libraries, and not QtNetwork
* Thu Jun 19 2014 Sandro Mani <manisandro@gmail.com> - 1.4.0-1.gite6d55f5
- Initial package