## START: Set by rpmautospec
## (rpmautospec version 0.7.3)
## RPMAUTOSPEC: autorelease, autochangelog
%define autorelease(e:s:pb:n) %{?-p:0.}%{lua:
    release_number = 59;
    base_release_number = tonumber(rpm.expand("%{?-b*}%{!?-b:1}"));
    print(release_number + base_release_number - 1);
}%{?-e:.%{-e*}}%{?-s:.%{-s*}}%{!?-n:%{?dist}}
## END: Set by rpmautospec

Name:           teem
Version:        1.11.0
%global so_version 1
Release:        %autorelease -b 13
Summary:        Libraries for processing and visualizing scientific raster data

# The entire source is LGPL-2.1-or-later, except files noted at the License
# fields of certain subpackages.
License:        LGPL-2.1-or-later
# Additionally, the following are removed in %%prep to assert that they do not
# contribute to the built package:
#
# Zlib:
#   arch/win32/include/zlib.h
# MIT:
#   python/ctypes/Nrrd.py
#   python/ctypes/pullDemo.py
#   python/ctypes/teem-gen.py
#   python/ctypes/teem.py
SourceLicense:  %{shrink:
                %{license} AND
                BSD-3-Clause AND
                MIT AND
                Zlib
                }
URL:            https://teem.sourceforge.net
Source0:        https://downloads.sourceforge.net/project/teem/teem/%{version}/%{name}-%{version}-src.tar.gz

# https://fedoraproject.org/wiki/Changes/EncourageI686LeafRemoval
ExcludeArch:    %{ix86}

Source1:        gprobe.1
Source2:        ilk.1
Source3:        miter.1
Source4:        mrender.1
Source5:        nrrdSanity.1
Source6:        overrgb.1
Source7:        puller.1
Source8:        tend.1
Source9:        unu.1
Source10:       vprobe.1

Source800:      tend-about.1
Source801:      tend-grads.1
Source802:      tend-epireg.1
Source803:      tend-bmat.1
Source804:      tend-estim.1
Source805:      tend-sim.1
Source806:      tend-mfit.1
Source807:      tend-mconv.1
Source808:      tend-msim.1
Source809:      tend-make.1
Source810:      tend-avg.1
Source811:      tend-helix.1
Source812:      tend-sten.1
Source813:      tend-glyph.1
Source814:      tend-ellipse.1
Source815:      tend-anplot.1
Source816:      tend-anvol.1
Source817:      tend-anscale.1
Source818:      tend-anhist.1
Source819:      tend-triple.1
Source820:      tend-tconv.1
Source821:      tend-point.1
Source822:      tend-slice.1
Source823:      tend-norm.1
Source824:      tend-fiber.1
Source825:      tend-eval.1
Source826:      tend-evalpow.1
Source827:      tend-evalclamp.1
Source828:      tend-evaladd.1
Source829:      tend-evalmult.1
Source830:      tend-log.1
Source831:      tend-exp.1
Source832:      tend-evec.1
Source833:      tend-evecrgb.1
Source834:      tend-evq.1
Source835:      tend-unmf.1
Source836:      tend-expand.1
Source837:      tend-shrink.1
Source838:      tend-bfit.1
Source839:      tend-satin.1

Source900:      unu-about.1
Source901:      unu-env.1
Source902:      unu-i2w.1
Source903:      unu-w2i.1
Source904:      unu-make.1
Source905:      unu-head.1
Source906:      unu-data.1
Source907:      unu-convert.1
Source908:      unu-resample.1
Source909:      unu-fft.1
Source910:      unu-cmedian.1
Source911:      unu-dist.1
Source912:      unu-minmax.1
Source913:      unu-cksum.1
Source914:      unu-diff.1
Source915:      unu-quantize.1
Source916:      unu-unquantize.1
Source917:      unu-project.1
Source918:      unu-slice.1
Source919:      unu-sselect.1
Source920:      unu-dice.1
Source921:      unu-splice.1
Source922:      unu-join.1
Source923:      unu-crop.1
Source924:      unu-acrop.1
Source925:      unu-inset.1
Source926:      unu-pad.1
Source927:      unu-reshape.1
Source928:      unu-permute.1
Source929:      unu-swap.1
Source930:      unu-shuffle.1
Source931:      unu-flip.1
Source932:      unu-unorient.1
Source933:      unu-axinfo.1
Source934:      unu-axinsert.1
Source935:      unu-axsplit.1
Source936:      unu-axdelete.1
Source937:      unu-axmerge.1
Source938:      unu-tile.1
Source939:      unu-untile.1
Source940:      unu-histo.1
Source941:      unu-dhisto.1
Source942:      unu-jhisto.1
Source943:      unu-histax.1
Source944:      unu-heq.1
Source945:      unu-gamma.1
Source946:      unu-1op.1
Source947:      unu-2op.1
Source948:      unu-3op.1
Source949:      unu-affine.1
Source950:      unu-lut.1
Source951:      unu-mlut.1
Source952:      unu-subst.1
Source953:      unu-rmap.1
Source954:      unu-mrmap.1
Source955:      unu-imap.1
Source956:      unu-lut2.1
Source957:      unu-ccfind.1
Source958:      unu-ccadj.1
Source959:      unu-ccmerge.1
Source960:      unu-ccsettle.1
Source961:      unu-save.1

# Patch CMakeLists.txt to fix library install paths to match what Fedora
# expects. It is not immediately obvious if this patch is suitable for
# sending upstream or not.
Patch:          lib_install_dir.patch

BuildRequires:  gcc-c++
BuildRequires:  cmake
BuildRequires:  make

BuildRequires:  zlib-devel
BuildRequires:  libpng-devel
BuildRequires:  bzip2-devel
BuildRequires:  fftw-devel
BuildRequires:  levmar-devel

%global common_description %{expand:
What Is Teem?

Teem is a coordinated group of libraries for representing, processing, and
visualizing scientific raster data. Teem includes command-line tools that
permit the library functions to be quickly applied to files and streams,
without having to write any code. The most important and useful libraries in
Teem are:

  • Nrrd (and the unu command-line tool on top of it) supports a range of
    operations for transforming N-dimensional raster data (resample, crop,
    slice, project, histogram, etc.), as well as the NRRD file format for
    storing arrays and their meta-information.
  • Gage: fast convolution-based measurements at arbitrary point locations in
    volume datasets (scalar, vector, tensor, etc.)
  • Mite: a multi-threaded ray-casting volume render with transfer functions
    based on any quantity Gage can measure
  • Ten: for estimating, processing, and visualizing diffusion tensor fields,
    including fiber tractography methods.

Strengths of Teem

  • Teem works: Its purpose is to enable research in visualization and image
    processing, and research is enabled when simple things are simple to do.
    Teem’s functionality and its ease of use have allowed it to become a
    component of larger research software projects, such as SCIRun and 3D
    Slicer.
  • Teem is light-weight: The libraries are written with an eye towards
    minimizing the annoyance of getting data in an out, by using the simplest
    possible constructs for the job, and by supporting combinations of
    operations that arise in common practice.
  • Teem is coherent: There is a consistent logic to how information is
    represented, and uniformity in the APIs across libraries.
  • Teem is portable: All the code is written in plain ANSI C, so it compiles
    everywhere, including Windows, using either CMake or GNU Make. A Dashboard
    is used to monitor compiler errors and warnings.
  • Teem is growing: Some Teem libraries were created years ago and have
    remained stable, but new libraries and new functionality are continually
    being added.
  • Teem is open source: Anyone can use it, and contributions are welcome. Teem
    is licensed under the GNU Lesser General Public License, plus exceptions
    which facilitate linking Teem into binary-only applications.}

%description %{common_description}

The %{name} package contains the command-line tools included with Teem.


%package libs
Summary:        Libraries for %{name}

%description libs %{common_description}

The %{name}-libs package contains libraries that may be required at runtime by
applications that use Teem.


%package devel
Summary:        Development files for %{name}

Requires:       %{name}-libs%{?_isa} = %{version}-%{release}

%description devel %{common_description}

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


%package examples
Summary:        Examples for developing with for %{name}
# The entire contents of this subpackage are LGPL-2.1-or-later, except:
#
# Zlib:
#   UseTeemCMakeDemo/sanity.c
# BSD-3-Clause:
#   Examples/sanity/sanity.c
License:        LGPL-2.1-or-later AND Zlib AND BSD-3-Clause
BuildArch:      noarch

%description examples %{common_description}

The %{name}-examples package contains examples for developing applications that
use Teem.


%prep
%autosetup -n %{name}-%{version}-src -p1

# Remove files that, while they have acceptable licenses, we want to assert do
# not contribute to the built RPMs:
#   - Not applicable to this platform
rm -rvf arch/win32
#   - Nothing here appears suitable for packaging:
rm -rvf python


%conf
%cmake \
    -DCMAKE_SKIP_INSTALL_RPATH=ON \
    -DTeem_USE_LIB_INSTALL_SUBDIR=ON \
    -DTeem_FFTW3=ON \
    -DTeem_LEVMAR=ON


%build
%cmake_build


%install
%cmake_install

install -d %{buildroot}%{_mandir}/man1
install -t %{buildroot}%{_mandir}/man1 -p -m 0644 \
    %{SOURCE1} %{SOURCE2} %{SOURCE3} %{SOURCE4} %{SOURCE5} %{SOURCE6} \
    %{SOURCE7} %{SOURCE8} %{SOURCE9} %{SOURCE10} \
    %{SOURCE800} %{SOURCE801} %{SOURCE802} %{SOURCE803} %{SOURCE804} \
    %{SOURCE805} %{SOURCE806} %{SOURCE807} %{SOURCE808} %{SOURCE809} \
    %{SOURCE810} %{SOURCE811} %{SOURCE812} %{SOURCE813} %{SOURCE814} \
    %{SOURCE815} %{SOURCE816} %{SOURCE817} %{SOURCE818} %{SOURCE819} \
    %{SOURCE820} %{SOURCE821} %{SOURCE822} %{SOURCE823} %{SOURCE824} \
    %{SOURCE825} %{SOURCE826} %{SOURCE827} %{SOURCE828} %{SOURCE829} \
    %{SOURCE830} %{SOURCE831} %{SOURCE832} %{SOURCE833} %{SOURCE834} \
    %{SOURCE835} %{SOURCE836} %{SOURCE837} %{SOURCE838} %{SOURCE839} \
    %{SOURCE900} %{SOURCE901} %{SOURCE902} %{SOURCE903} %{SOURCE904} \
    %{SOURCE905} %{SOURCE906} %{SOURCE907} %{SOURCE908} %{SOURCE909} \
    %{SOURCE910} %{SOURCE911} %{SOURCE912} %{SOURCE913} %{SOURCE914} \
    %{SOURCE915} %{SOURCE916} %{SOURCE917} %{SOURCE918} %{SOURCE919} \
    %{SOURCE920} %{SOURCE921} %{SOURCE922} %{SOURCE923} %{SOURCE924} \
    %{SOURCE925} %{SOURCE926} %{SOURCE927} %{SOURCE928} %{SOURCE929} \
    %{SOURCE930} %{SOURCE931} %{SOURCE932} %{SOURCE933} %{SOURCE934} \
    %{SOURCE935} %{SOURCE936} %{SOURCE937} %{SOURCE938} %{SOURCE939} \
    %{SOURCE940} %{SOURCE941} %{SOURCE942} %{SOURCE943} %{SOURCE944} \
    %{SOURCE945} %{SOURCE946} %{SOURCE947} %{SOURCE948} %{SOURCE949} \
    %{SOURCE950} %{SOURCE951} %{SOURCE952} %{SOURCE953} %{SOURCE954} \
    %{SOURCE955} %{SOURCE956} %{SOURCE957} %{SOURCE958} %{SOURCE959} \
    %{SOURCE960} %{SOURCE961}


%check
# We must exclude probeSS_ctmr04 and probeSS_ctmr10 on certain architectures
# due to overly-strict rounding requirements.
%ifarch %{arm64} ppc64le s390x
%global ctest_excludes --exclude-regex '^(probeSS_ctmr(04|10))$'
%endif

# Tests are not parallel-safe
%global _smp_mflags -j1
%ctest %{?ctest_excludes}


%files
%doc README.txt
%{_bindir}/gprobe
%{_bindir}/ilk
%{_bindir}/miter
%{_bindir}/mrender
%{_bindir}/nrrdSanity
%{_bindir}/overrgb
%{_bindir}/puller
%{_bindir}/tend
%{_bindir}/unu
%{_bindir}/vprobe

%{_mandir}/man1/gprobe.1*
%{_mandir}/man1/ilk.1*
%{_mandir}/man1/miter.1*
%{_mandir}/man1/mrender.1*
%{_mandir}/man1/nrrdSanity.1*
%{_mandir}/man1/overrgb.1*
%{_mandir}/man1/puller.1*
%{_mandir}/man1/tend.1*
%{_mandir}/man1/tend-*.1*
%{_mandir}/man1/unu.1*
%{_mandir}/man1/unu-*.1*
%{_mandir}/man1/vprobe.1*


%files libs
%license LICENSE.txt
%{_libdir}/libteem.so.%{so_version}{,.*}


%files devel
%{_includedir}/teem/
%{_libdir}/libteem.so
%{_libdir}/cmake/Teem-%{version}/


%files examples
%license LICENSE.txt
%doc Examples
%doc UseTeemCMakeDemo


%changelog
## START: Generated by rpmautospec
* Sun Dec 15 2024 Benjamin A. Beasley <code@musicinmybrain.net> - 1.11.0-71
- Add a SourceLicense field

* Sat Nov 16 2024 Benjamin A. Beasley <code@musicinmybrain.net> - 1.11.0-70
- Fix failure to build from source with CMake 3.30.0

* Sun Nov 03 2024 Benjamin A. Beasley <code@musicinmybrain.net> - 1.11.0-69
- Invoke %%cmake in %%conf rather than in %%build

* Mon Aug 12 2024 Benjamin A. Beasley <code@musicinmybrain.net> - 1.11.0-68
- Update URL to HTTPS

* Sat Jul 20 2024 Fedora Release Engineering <releng@fedoraproject.org> - 1.11.0-67
- Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild

* Thu Apr 04 2024 Benjamin A. Beasley <code@musicinmybrain.net> - 1.11.0-66
- Actually install the man pages

* Sat Jan 27 2024 Fedora Release Engineering <releng@fedoraproject.org> - 1.11.0-64
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild

* Sat Jul 22 2023 Fedora Release Engineering <releng@fedoraproject.org> - 1.11.0-63
- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild

* Sat Mar 18 2023 Benjamin A. Beasley <code@musicinmybrain.net> - 1.11.0-62
- Run tests serially *without* overriding spec-file macros

* Sat Jan 21 2023 Fedora Release Engineering <releng@fedoraproject.org> - 1.11.0-61
- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild

* Thu Dec 22 2022 Benjamin A. Beasley <code@musicinmybrain.net> - 1.11.0-60
- Leaf package: remove i686 support

* Thu Dec 22 2022 Benjamin A. Beasley <code@musicinmybrain.net> - 1.11.0-59
- Trivially simplify one files list

* Tue Nov 29 2022 Benjamin A. Beasley <code@musicinmybrain.net> - 1.11.0-58
- Update License to SPDX

* Fri Nov 25 2022 Benjamin A. Beasley <code@musicinmybrain.net> - 1.11.0-57
- Improve summary for -libs subpackage

* Sat Jul 23 2022 Fedora Release Engineering <releng@fedoraproject.org> - 1.11.0-56
- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild

* Sat Apr 16 2022 Benjamin A. Beasley <code@musicinmybrain.net> - 1.11.0-55
- Stop numbering patches

* Sat Jan 22 2022 Fedora Release Engineering <releng@fedoraproject.org> - 1.11.0-54
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild

* Tue Dec 14 2021 Benjamin A. Beasley <code@musicinmybrain.net> - 1.11.0-53
- Dep. on cmake-filesystem is now auto-generated

* Sat Aug 21 2021 Benjamin A. Beasley <code@musicinmybrain.net> - 1.11.0-52
- Remove EPEL workarounds from Fedora spec file

* Sat Aug 21 2021 Benjamin A. Beasley <code@musicinmybrain.net> - 1.11.0-51
- Finish complete set of man pages (adds unu-* man pages)

* Tue Apr 13 2021 Benjamin A. Beasley <code@musicinmybrain.net> - 1.11.0-16
- Finish man pages, except “unu” sub-pages. Start installing man pages.

* Sat Apr 03 2021 Benjamin A. Beasley <code@musicinmybrain.net> - 1.11.0-15
- Fix typo in lib_install_dir.patch
- Update download URL from HTTP to HTTPS
- Improved package summaries and descriptions
- Adjust whitespace to personal preference
- Fix stray line continuation backslash
- Support EPEL7
- Build with “levmar” support enabled
- Use stricter file globs, including specifying the so-version
- Add an -examples subpackage so the BSD and zlib licenses can be “contained”
  to that subpackage; remove certain unused files with other licenses in %%prep
- Require cmake-filesystem instead of all of CMake in -devel
- More precisely skip overly-strict floating-point tests where required
- Start work on adding a complete set of man pages

* Wed Jan 27 2021 Fedora Release Engineering <releng@fedoraproject.org> - 1.11.0-14
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild

* Fri Sep 04 2020 Ankur Sinha <ankursinha AT fedoraproject DOT org> - 1.11.0-13
- Use cmake macros to fix build

* Sat Aug 01 2020 Fedora Release Engineering <releng@fedoraproject.org> - 1.11.0-12
- Second attempt - Rebuilt for
  https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild

* Wed Jul 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 1.11.0-11
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild

* Fri Jan 31 2020 Fedora Release Engineering <releng@fedoraproject.org> - 1.11.0-10
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild

* Sat Jul 27 2019 Fedora Release Engineering <releng@fedoraproject.org> - 1.11.0-9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild

* Sun Feb 03 2019 Fedora Release Engineering <releng@fedoraproject.org> - 1.11.0-8
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild

* Sat Jul 14 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.11.0-7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild

* Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.11.0-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild

* Thu Aug 03 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.11.0-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild

* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.11.0-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild

* Sat Feb 11 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.11.0-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild

* Fri Feb 05 2016 Fedora Release Engineering <releng@fedoraproject.org> - 1.11.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild

* Wed Nov 25 2015 Dmitry Mikhirev <mikhirev@gmail.com> 1.11.0-1
- Initial package

## END: Generated by rpmautospec