Blame octave-iso2mesh.spec

87e00bc
%global octpkg iso2mesh
87e00bc
87e00bc
Name:           octave-%{octpkg}
43cfb52
Version:        1.9.6
43cfb52
Release:        1%{?dist}
87e00bc
Summary:        A 3D surface and volumetric mesh generator for MATLAB/Octave
f09a58c
# Main package: GPLv3+
2a98feb
# Meshfix: GPLv2+
2a98feb
# JMeshLib: GPLv2+
f09a58c
# Tetgen: AGPLv3+
2a98feb
License: GPLv3+ and GPLv2+ and AGPLv3+
f09a58c
87e00bc
URL:            http://iso2mesh.sf.net
87e00bc
# the following utilities are called internally by iso2mesh (stored under a private folder),
87e00bc
# this is needed for making outputs reproducible
87e00bc
Source0:        https://github.com/fangq/iso2mesh/archive/v%{version}/%{octpkg}-%{version}.tar.gz
43cfb52
Source1:        https://github.com/fangq/cork/archive/v0.9.1/cork-0.9.1.tar.gz
43cfb52
Source2:        https://github.com/fangq/meshfix/archive/v1.2.2/meshfix-1.2.2.tar.gz
87e00bc
Source3:        http://ftp.mcs.anl.gov/pub/petsc/externalpackages/tetgen1.5.1.tar.gz
87e00bc
87e00bc
ExcludeArch:    armv7hl
6051b5a
BuildRequires:  cmake CGAL-devel SuperLU-devel blas-static gcc-c++ zlib-devel octave-devel
87e00bc
87e00bc
%if 0%{?fedora} >=32
2a98feb
Requires:       octave mpfr-devel boost-devel SuperLU octave-jsonlab octave-jnifti octave-zmat
87e00bc
%else
2a98feb
Requires:       octave CGAL SuperLU octave-jsonlab octave-jnifti octave-zmat
87e00bc
%endif
87e00bc
87e00bc
Requires(post): octave
87e00bc
Requires(postun): octave
87e00bc
87e00bc
%description
87e00bc
Iso2Mesh is a MATLAB/Octave-based mesh generation toolbox,
f09a58c
designed for easy creation of high quality surface and
f09a58c
tetrahedral meshes from 3D volumetric images. It contains
f09a58c
a rich set of mesh processing scripts/programs, working
f09a58c
either independently or interacting with external free
87e00bc
meshing utilities. Iso2Mesh toolbox can directly convert
f09a58c
a 3D image stack, including binary, segmented or gray-scale
f09a58c
images such as MRI or CT scans, into quality volumetric
f09a58c
meshes. This makes it particularly suitable for multi-modality
87e00bc
medical imaging data analysis and multi-physics modeling.
f09a58c
Iso2Mesh is cross-platform and is compatible with both MATLAB
87e00bc
and GNU Octave.
87e00bc
87e00bc
%package -n %{octpkg}-demos
87e00bc
Summary:        Example datasets and scripts for the Iso2Mesh toolbox
87e00bc
BuildArch:      noarch
87e00bc
Requires:       octave octave-%{octpkg}
87e00bc
Recommends:     %{octpkg}-demos
87e00bc
87e00bc
%description -n %{octpkg}-demos
f09a58c
This package contains the demo script and sample datasets for octave-%{octpkg}.
87e00bc
87e00bc
%prep
03bb48a
%setup -q -b 1 -n %{octpkg}-%{version}
43cfb52
%setup -q -T -D -b 2 -n meshfix-1.2.2
87e00bc
%setup -q -T -D -b 3 -n %{octpkg}-%{version}
87e00bc
rm -rf tools/cork
87e00bc
rm -rf tools/meshfix
87e00bc
rm -rf tools/tetgen
43cfb52
mv ../cork-0.9.1 tools/cork
43cfb52
mv ../meshfix-1.2.2 tools/meshfix
87e00bc
mv ../tetgen1.5.1 tools/tetgen
87e00bc
rm -rf bin/*.mex* bin/*.exe bin/*.dll
87e00bc
87e00bc
cp COPYING.txt COPYING
87e00bc
87e00bc
mkdir -p inst/
2a98feb
2a98feb
rm -rf base64decode base64encode fast_match_bracket gzipdecode gzipencode \
2a98feb
jdatadecode jdataencode jnifticreate loadjnifti loadjson loadmsgpack \
2a98feb
loadnifti loadubjson lz4decode lz4encode lz4hcdecode lz4hcencode lzipdecode \
2a98feb
lzipencode lzmadecode lzmaencode match_bracket nestbracket2dim nifticreate \
2a98feb
nii2jnii niicodemap niiformat readnifti savebnii savejnifti savejnii \
2a98feb
savemsgpack savenifti saveubjson zlibdecode zlibencode
2a98feb
87e00bc
mv *.m inst/
87e00bc
mv img2mesh.fig inst/
87e00bc
527ace8
# Fix jmeshlib build flags
527ace8
sed -e "s|-Wall|%{optflags}|;s|^LIBS = |&$RPM_LD_FLAGS |" \
527ace8
    -i tools/meshfix/contrib/JMeshLib/test/Makefile
527ace8
527ace8
# Fix tetgen build flags
527ace8
sed -e "s|^\(CXXFLAGS = \).*|\1%{optflags} $RPM_LD_FLAGS|" \
527ace8
    -e "s|-O0|%{optflags} $RPM_LD_FLAGS|" \
527ace8
    -i tools/tetgen/makefile
527ace8
87e00bc
%build
87e00bc
%set_build_flags
f09a58c
pushd tools
3150111
# can't use make_build macro below because parallel make with CGAL exhausts
3150111
# vm's memory and crash the building process, use sequential make instead
527ace8
make USERCCFLAGS="%{optflags}"
f09a58c
popd
f09a58c
pushd bin
87e00bc
ln -s tetgen1.5 tetgen
f09a58c
popd
f09a58c
f09a58c
mkdir inst/bin
f09a58c
pushd bin
f09a58c
for exec in *; do
f09a58c
   ln -s %{_libexecdir}/%{octpkg}/$exec ../inst/bin/$exec
f09a58c
done
f09a58c
popd
87e00bc
%octave_pkg_build
87e00bc
87e00bc
%if 0%{?fedora} <=30
87e00bc
   %global octave_tar_suffix any-none
87e00bc
%endif
87e00bc
87e00bc
%install
87e00bc
%octave_pkg_install
f09a58c
install -m 0755 -vd  %{buildroot}%{_libexecdir}/%{octpkg}
f09a58c
install -m 0755 -vp  bin/* %{buildroot}%{_libexecdir}/%{octpkg}/
87e00bc
87e00bc
%post
87e00bc
%octave_cmd pkg rebuild
87e00bc
87e00bc
%preun
87e00bc
%octave_pkg_preun
87e00bc
87e00bc
%postun
87e00bc
%octave_cmd pkg rebuild
87e00bc
87e00bc
%files
87e00bc
%license COPYING.txt
87e00bc
%doc README.txt
87e00bc
%doc Content.txt
87e00bc
%doc AUTHORS.txt
87e00bc
%doc ChangeLog.txt
87e00bc
%dir %{octpkgdir}
87e00bc
%dir %{octpkgdir}/doc
87e00bc
%dir %{octpkgdir}/bin
f09a58c
%{_libexecdir}/%{octpkg}
87e00bc
%{octpkgdir}/doc/*
87e00bc
%{octpkgdir}/bin/*
87e00bc
%{octpkgdir}/*.m
87e00bc
%{octpkgdir}/*.fig
87e00bc
%doc %{octpkgdir}/doc-cache
87e00bc
%{octpkgdir}/packinfo
87e00bc
87e00bc
%files -n %{octpkg}-demos
87e00bc
%license COPYING.txt
87e00bc
%doc sample
87e00bc
87e00bc
%changelog
43cfb52
* Fri Sep 04 2020 Qianqian Fang <fangqq@gmail.com> - 1.9.6-1
43cfb52
- New upstream release 1.9.6
bf9dc6a
8d39ced
* Sat Aug 01 2020 Fedora Release Engineering <releng@fedoraproject.org> - 1.9.1-7
43cfb52
- Fix cgal build error on F34
8d39ced
- Second attempt - Rebuilt for
8d39ced
  https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
8d39ced
882c271
* Tue Jul 28 2020 Fedora Release Engineering <releng@fedoraproject.org> - 1.9.1-6
882c271
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
882c271
ebe8190
* Wed Jan 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 1.9.1-5
ebe8190
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
ebe8190
527ace8
* Mon Nov 25 2019 Jerry James <loganjerry@gmail.com> - 1.9.1-4
527ace8
- Rebuild for mpfr 4
527ace8
- Use Fedora build flags when building jmeshlib and tetgen
527ace8
2a98feb
* Fri Oct 11 2019 Qianqian Fang <fangqq@gmail.com> - 1.9.1-3
2a98feb
- Define octave package-level dependency via the DESCRIPTION file
2a98feb
- Remove gmp-devel from Requires
2a98feb
705c870
* Thu Oct 10 2019 Qianqian Fang <fangqq@gmail.com> - 1.9.1-2
f09a58c
- Fix licenses
f09a58c
- Move binaries to libexec
f09a58c
87e00bc
* Wed Oct 02 2019 Qianqian Fang <fangqq@gmail.com> - 1.9.1-1
87e00bc
- Initial package