08c45a3
%global upver 2-3-00
08c45a3
08c45a3
Name:           libminc
08c45a3
Version:        2.3.00
7ba7fed
Release:        2%{?dist}
08c45a3
Summary:        Core library and API of the MINC toolkit
08c45a3
08c45a3
License:        MIT
08c45a3
URL:            https://github.com/BIC-MNI/libminc
08c45a3
Source0:        https://github.com/BIC-MNI/libminc/archive/%{name}-%{upver}/%{name}-%{version}.tar.gz
08c45a3
Patch0:         0001-install-cmake-files-in-private-directory.patch
08c45a3
# https://github.com/BIC-MNI/libminc/issues/63
08c45a3
Patch1:         0002-rename-hdf_close-to-hdf_fclose-due-to-first-exposed-.patch
7ba7fed
# https://github.com/BIC-MNI/libminc/commit/166aca9f4c33bc5642047ceafd5c6bae0d888187
7ba7fed
Patch2:         0001-Fix-endian-issues-with-label-data.patch
08c45a3
BuildRequires:  git-core
08c45a3
BuildRequires:  cmake
08c45a3
BuildRequires:  gcc gcc-c++
08c45a3
BuildRequires:  zlib-devel
08c45a3
BuildRequires:  netcdf-devel
08c45a3
BuildRequires:  hdf5-devel
08c45a3
08c45a3
%description
08c45a3
The MINC file format is a highly flexible medical image file format
08c45a3
built on the HDF5 generalized data format. The format is
08c45a3
simple, self-describing, extensible, portable and N-dimensional, with
08c45a3
programming interfaces for both low-level data access and high-level
08c45a3
volume manipulation. On top of the libraries is a suite of generic
08c45a3
image-file manipulation tools. The format, libraries and tools are
08c45a3
designed for use in a medical-imaging research environment : they are
08c45a3
simple and powerful and make no attempt to provide a pretty interface
08c45a3
to users.
08c45a3
08c45a3
%package devel
08c45a3
Summary:        Development files for %{name}
08c45a3
Requires:       %{name}%{?_isa} = %{version}-%{release}
08c45a3
Requires:       netcdf-devel%{?_isa}
08c45a3
Requires:       zlib-devel%{?_isa}
08c45a3
Requires:       hdf5-devel%{?_isa}
08c45a3
Requires:       cmake%{?_isa}
08c45a3
08c45a3
%description devel
08c45a3
The %{name}-devel package contains libraries and header files for
08c45a3
developing applications that use %{name}.
08c45a3
08c45a3
%prep
08c45a3
%autosetup -n %{name}-%{name}-%{upver} -S git
08c45a3
rm -rf build/
08c45a3
mkdir -p build/
08c45a3
sed -i -e '/SET (LIBMINC_INSTALL_INCLUDE_DIR/s/include/include\/%{name}/' CMakeLists.txt
08c45a3
08c45a3
%build
08c45a3
pushd build/
08c45a3
  %cmake ../ \
08c45a3
    -DLIBMINC_BUILD_SHARED_LIBS=ON \
08c45a3
    -DLIBMINC_MINC1_SUPPORT=ON \
08c45a3
    -DLIBMINC_BUILD_EZMINC=ON
08c45a3
  %make_build
08c45a3
popd
08c45a3
08c45a3
%install
08c45a3
pushd build/
08c45a3
  %make_install
08c45a3
popd
08c45a3
08c45a3
%check
08c45a3
pushd build/
08c45a3
  ctest -VV
08c45a3
popd
08c45a3
08c45a3
%post -p /sbin/ldconfig
08c45a3
08c45a3
%postun -p /sbin/ldconfig
08c45a3
08c45a3
%files
08c45a3
%license COPYING
08c45a3
%doc README README.release doc/ NEWS ChangeLog AUTHORS
08c45a3
%{_libdir}/%{name}*.so.*
08c45a3
08c45a3
%files devel
08c45a3
%doc volume_io/example/*.c ezminc/examples/*.cpp ezminc/examples/Example_CMakeLists.txt
08c45a3
%{_includedir}/%{name}/
08c45a3
%{_libdir}/cmake/LIBMINC/
08c45a3
%{_libdir}/%{name}*.so
08c45a3
08c45a3
%changelog
7ba7fed
* Wed Dec 02 2015 Igor Gnatenko <i.gnatenko.brain@gmail.com> - 2.3.00-2
7ba7fed
- Apply patch to fix endian tests (RHBZ #1287015)
7ba7fed
08c45a3
* Sat Nov 07 2015 Igor Gnatenko <i.gnatenko.brain@gmail.com> - 2.3.00-1
08c45a3
- Initial package