Blob Blame History Raw
%global		module		Couenne

%if 0%{?fedora} > 21
%global		with_asl	1
%else
%global		with_asl	0
%endif

%global		with_mpi	0

Name:		coin-or-%{module}
Group:		Applications/Engineering
Summary:	An exact solver for nonconvex MINLPs
Version:	0.5.6
Release:	7%{?dist}
License:	EPL
URL:		http://www.coin-or.org/projects/%{module}.xml
Source0:	http://www.coin-or.org/download/pkgsource/%{module}/%{module}-%{version}.tgz
BuildRequires:	atlas-devel
BuildRequires:	blas-devel
BuildRequires:	bzip2-devel
BuildRequires:	coin-or-Bonmin-devel
BuildRequires:	coin-or-Cbc-devel
BuildRequires:	coin-or-Cgl-devel
BuildRequires:	coin-or-Clp-devel
BuildRequires:	coin-or-CoinUtils-devel
%if %{with_mpi}
BuildRequires:	coin-or-Ipopt-openmpi-devel
%else
BuildRequires:	coin-or-Ipopt-devel
%endif
BuildRequires:	coin-or-Osi-devel
BuildRequires:	doxygen
BuildRequires:	glpk-devel
BuildRequires:	graphviz
BuildRequires:	lapack-devel
%if %{with_asl}
BuildRequires:	mp-devel
%endif
%if %{with_mpi}
BuildRequires:	openmpi-devel
BuildRequires:	scalapack-openmpi-devel
BuildRequires:	openssh-clients
%endif
BuildRequires:	pkgconfig
BuildRequires:	readline-devel
BuildRequires:	zlib-devel

# Install documentation in standard rpm directory
Patch0:		%{name}-docdir.patch

# Read config.h
Patch1:		%{name}-config.patch

%description
Couenne (Convex Over and Under ENvelopes for Nonlinear Estimation) is a
branch&bound algorithm to solve Mixed-Integer Nonlinear Programming (MINLP)
problems of the form:
      min f0(x,y)
             fi(x,y) <= 0     i=1,2..., m
             x in Rn, y in Zp

where all fi(x,y) are, in general, nonlinear functions.

Couenne aims at finding global optima of nonconvex MINLPs. It implements
linearization, bound reduction, and branching methods within a
branch-and-bound framework. Its main components are:

  * an expression library;
  * separation of linearization cuts;
  * branching rules;
  * bound tightening methods.

%package	devel
Summary:	Development files for %{name}
Group:		Development/Libraries
Requires:	coin-or-CoinUtils-devel
Requires:	%{name}%{?_isa} = %{version}-%{release}

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

%package	doc
Summary:	Documentation files for %{name}
Group:		Documentation
Requires:	%{name} = %{version}-%{release}
BuildArch:	noarch

%description	doc
This package contains the documentation for %{name}.

%prep
%setup -q -n %{module}-%{version}
%patch0 -p1
%patch1 -p1
%if %{with_asl}
%endif

%build
%if %{with_mpi}
%_openmpi_load
%endif
%configure	\
%if %{with_asl}
	--with-asl-lib="-lasl -lmp -lipoptamplinterface -lbonminampl" \
	--with-asl-incdir="%{_includedir}/asl"
%endif

# Kill rpaths
sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' libtool
sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool

make %{?_smp_mflags} all

%install
make install DESTDIR=%{buildroot}
rm -f %{buildroot}%{_libdir}/*.la
mkdir -p %{buildroot}%{_docdir}/%{name}/
install -p -m644 doc/couenne-user-manual.pdf -t %{buildroot}%{_docdir}/%{name}/

%check
%if %{with_mpi}
%_openmpi_load
%endif
LD_LIBRARY_PATH=%{buildroot}%{_libdir}:$LD_LIBRARY_PATH make test

%post -p /sbin/ldconfig

%postun -p /sbin/ldconfig

%files
%if 0%{?fedora} > 21
%{_bindir}/couenne
%endif
%dir %{_docdir}/%{name}
%doc %{_docdir}/%{name}/AUTHORS
%license %{_docdir}/%{name}/LICENSE
%doc %{_docdir}/%{name}/README
%doc %{_docdir}/%{name}/couenne_addlibs.txt
%{_libdir}/*.so.*

%files		devel
%{_includedir}/coin/*
%{_libdir}/*.so
%{_libdir}/pkgconfig/*

%files		doc
%doc %{_docdir}/%{name}/*.pdf

%changelog
* Thu Jun 29 2017 Antonio Trande <sagitterATfedoraproject.org> - 0.5.6-7
- Rebuild for MUMPS-5.1.1 (after a bug-fix)

* Mon May 15 2017 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.5.6-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_27_Mass_Rebuild

* Wed Apr  5 2017 pcpa <paulo.cesar.pereira.de.andrade@gmail.com> - 0.5.6-5
- Rebuild for newer mumps

* Fri Feb 10 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.5.6-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild

* Sun Nov 13 2016 Peter Robinson <pbrobinson@fedoraproject.org> 0.5.6-3
- Rebuild (Power64)

* Tue Aug 02 2016 pcpa <paulo.cesar.pereira.de.andrade@gmail.com> - 0.5.6-2
- Rebuild for newer mumps

* Wed Mar 16 2016 pcpa <paulo.cesar.pereira.de.andrade@gmail.com> - 0.5.6-1
- Update to latest upstream release
- Correct FTBFS in rawhide (#1307387)

* Wed Feb 03 2016 Fedora Release Engineering <releng@fedoraproject.org> - 0.5.2-7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild

* Sun Jun 21 2015 pcpa <paulo.cesar.pereira.de.andrade@gmail.com> - 0.5.2-6
- Full rebuild of coin-or stack.

* Wed Jun 17 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.5.2-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild

* Sat May 02 2015 Kalev Lember <kalevlember@gmail.com> - 0.5.2-4
- Rebuilt for GCC 5 C++11 ABI change

* Sun Mar  1 2015 pcpa <paulo.cesar.pereira.de.andrade@gmail.com> - 0.5.2-3
- Rediff patches (#894606#c15)
- Use license macro (#894606#c14)
- Do not mix rpm macros and rpm shell variables (#894606#c14)

* Sat Feb 28 2015 pcpa <paulo.cesar.pereira.de.andrade@gmail.com> - 0.5.2-2
- Correct make check.

* Sat Feb 28 2015 pcpa <paulo.cesar.pereira.de.andrade@gmail.com> - 0.5.2-1
- Update to latest upstream release.

* Sat Sep 20 2014 pcpa <paulo.cesar.pereira.de.andrade@gmail.com> - 0.4.7-1
- Update to latest upstream release
- Remove module name from description
- Create doc subpackage

* Mon Jan 14 2013 pcpa <paulo.cesar.pereira.de.andrade@gmail.com> - 0.4.3-4
- Update to run make check (#894610#c4).

* Sat Jan 12 2013 pcpa <paulo.cesar.pereira.de.andrade@gmail.com> - 0.4.3-3
- Rename repackaged tarball.

* Sun Nov 18 2012 pcpa <paulo.cesar.pereira.de.andrade@gmail.com> - 0.4.3-2
- Rename package to coin-or-Couenne.
- Do not package Thirdy party data or data without clean license.

* Sat Sep 29 2012 pcpa <paulo.cesar.pereira.de.andrade@gmail.com> - 0.4.3-1
- Initial coinor-Couenne spec.