Blob Blame History Raw
# The (empty) main package is arch, to have the package built and tests run
# on all arches, but the actual result package is the noarch -devel subpackge.
# Debuginfo packages are disabled to prevent rpmbuild from generating an empty
# debuginfo package for the empty main package.
%global debug_package %{nil}

%global commit bdd17ee3b1b3

Name:           eigen3
Version:        3.2.5
Release:        2%{?dist}
Summary:        A lightweight C++ template library for vector and matrix math

Group:          Development/Libraries
License:        MPLv2.0 and LGPLv2+ and BSD
URL:            http://eigen.tuxfamily.org/index.php?title=Main_Page
# Source file is at: http://bitbucket.org/eigen/eigen/get/3.2.2.tar.bz2
# Renamed source file so it's not just a version number
Source0:        eigen-%{version}.tar.bz2
BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)

# Install FindEigen3.cmake
# Adapted from Debian eigen3 package
Patch0:         01_install_FindEigen3.patch

BuildRequires:  atlas-devel
BuildRequires:  fftw-devel
BuildRequires:  glew-devel
BuildRequires:  gmp-devel
BuildRequires:  gsl-devel
%if 0%{?fedora}
BuildRequires:  sparsehash-devel
BuildRequires:  suitesparse-devel
%endif

BuildRequires:  cmake
BuildRequires:  doxygen
BuildRequires:  graphviz
BuildRequires:  tex(latex)

%description
%{summary}

%package devel
Summary: A lightweight C++ template library for vector and matrix math
Group:   Development/Libraries
# -devel subpkg only atm, compat with other distros
Provides: %{name} = %{version}-%{release}
# not *strictly* a -static pkg, but the results are the same
Provides: %{name}-static = %{version}-%{release}
BuildArch: noarch

%description devel
%{summary}.

%package doc
Summary:   Developer documentation for Eigen
Requires:  %{name}-devel = %{version}-%{release}
BuildArch: noarch
%description doc
Developer documentation for Eigen.

%prep
%setup -q -n eigen-eigen-%{commit}

# Layout file incompatible, disable
sed -i 's|LAYOUT_FILE|#LAYOUT_FILE|' doc/Doxyfile.in
%patch0 -p1

%build
mkdir %{_target_platform}
pushd %{_target_platform}
%ifarch ppc64
# Currently get a compiler ICE, work around it
# https://bugzilla.redhat.com/show_bug.cgi?id=1063999
export CXXFLAGS="%{optflags} -mno-vsx"
%endif
%cmake .. -DBLAS_LIBRARIES="cblas" -DBLAS_LIBRARIES_DIR=%{_libdir}/atlas
popd
make -C %{_target_platform} %{?_smp_mflags}
make doc -C %{_target_platform} %{?_smp_mflags}

rm -f %{_target_platform}/doc/html/installdox
rm -f %{_target_platform}/doc/html/unsupported/installdox

%install
rm -rf %{buildroot}
make install DESTDIR=%{buildroot} -C %{_target_platform}

%check
# Run tests but make failures non-fatal. Note that upstream doesn't expect the
# tests to pass consistently since they're seeded randomly.
make -C %{_target_platform} %{?_smp_mflags} buildtests
make -C %{_target_platform} %{?_smp_mflags} test ARGS="-V" || exit 0

%clean
rm -rf %{buildroot}

%files devel
%defattr(-,root,root,-)
%doc COPYING.GPL COPYING.LGPL
%{_includedir}/eigen3
%{_datadir}/pkgconfig/*
%{_datadir}/cmake/Modules/*.cmake

%files doc
%doc %{_target_platform}/doc/html

%changelog
* Mon Aug 10 2015 Rich Mattes <richmattes@gmail.com> - 3.2.5-1
- Update to release 3.2.5
- Switch from cmake28 to cmake
- Remove upstreamed patches
- Apply patch to install FindEigen3.cmake

* Sun Jan 04 2015 Rich Mattes <richmattes@gmail.com> - 3.2.3-1
- Update to release 3.2.3
- Backport upstream Rotation2D fix
- Remove upstreamed patches

* Sun Dec 14 2014 Rich Mattes <richmattes@gmail.com> - 3.2.2-1
- Update to release 3.2.2

* Mon Aug 06 2012 Rich Mattes <richmattes@gmail.com> - 3.0.6-1
- Update to release 3.0.6

* Sat Feb 18 2012 Rich Mattes <richmattes@gmail.com> - 3.0.4-3
- Imported into el6
- Applied patch for CMake 2.6 compatibility

* Fri Jan 13 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.0.4-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild

* Sun Dec 18 2011 Rich Mattes <richmattes@gmail.com> - 3.0.4-1
- Update to release 3.0.4

* Tue Nov 15 2011 Rich Mattes <richmattes@gmail.com> - 3.0.3-1
- Update to release 3.0.3

* Sun Apr 17 2011 Rich Mattes <richmattes@gmail.com> - 3.0.0-2
- Patched sources to fix build failure
- Removed fixes made upstream
- Added project name to source tarball filename

* Sat Mar 26 2011 Rich Mattes <richmattes@gmail.com> - 3.0.0-1
- Update to release 3.0.0

* Tue Jan 25 2011 Rich Mattes <richmattes@gmail.com> - 3.0-0.2.beta2
- Change blas-devel buildrequirement to atlas-devel
- Don't make the built-in experimental blas library

* Mon Jan 24 2011 Rich Mattes <richmattes@gmail.com> - 3.0-0.1.beta2
- Initial package