File nlopt.spec of Package nlopt
#
# spec file for package nlopt
#
# Copyright (c) 2015 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
Name: nlopt
Version: 2.4.2
Release: 0
Summary: A library for nonlinear optimization
License: LGPL-2.0
Group: Development/Libraries/C and C++
Url: http://ab-initio.mit.edu/wiki/index.php/NLopt
Source0: http://ab-initio.mit.edu/nlopt/%{name}-%{version}.tar.gz
# PATCH-FIX-UPSTREAM nlopt-2.3-pkgconfig.patch
Patch1: nlopt-2.3-pkgconfig.patch
# PATCH-FIX-UPSTREAM pythondir.patch
Patch2: pythondir.patch
BuildRequires: fdupes
BuildRequires: gcc-c++
BuildRequires: hdf5-devel
# BuildRequires: octave-devel
BuildRequires: pkgconfig
BuildRequires: python-numpy-devel
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%description
NLopt is a free/open-source library for nonlinear optimization,
providing a common interface for a number of different free
optimization routines available online as well as original
implementations of various other algorithms.
%package -n lib%{name}0
Summary: A library for nonlinear optimization
Group: System/Libraries
# FIXME temporary, octave-nlopt_optimize is inconsistent with octave 4.0
Obsoletes: octave-nlopt_optimize
%description -n lib%{name}0
NLopt is a free/open-source library for nonlinear optimization,
providing a common interface for a number of different free
optimization routines available online as well as original
implementations of various other algorithms.
%package devel
Summary: Development files for %{name}
Group: Development/Libraries/C and C++
Requires: lib%{name}0 = %{version}
%description devel
The %{name}-devel package contains libraries and header files for
developing applications that use %{name}.
%package -n python-%{name}
Summary: Python interface to nonlinear optimization libray
Group: Development/Libraries/Python
Requires: python-numpy
%description -n python-%{name}
NLopt is a free/open-source library for nonlinear optimization,
providing a common interface for a number of different free
optimization routines available online as well as original
implementations of various other algorithms.
This package contains Python interface to NLopt library.
# %%package -n octave-nlopt_optimize
# Summary: Octave interface to nonlinear optimization libray
# Group: Productivity/Scientific/Math
# Requires: octave
#
# %%description -n octave-nlopt_optimize
# NLopt is a free/open-source library for nonlinear optimization,
# providing a common interface for a number of different free
# optimization routines available online as well as original
# implementations of various other algorithms.
#
# This package contains Octave interface to NLopt library.
%prep
%setup -q
%patch1
%patch2 -p1
%build
%configure --enable-shared \
--disable-static
make %{?_smp_mflags}
%install
%makeinstall
find %{buildroot} -name '*.la' -exec rm -f {} ';'
%fdupes %{buildroot}%{py_sitedir}
%post -n lib%{name}0 -p /sbin/ldconfig
%postun -n lib%{name}0 -p /sbin/ldconfig
%files -n lib%{name}0
%defattr(-,root,root,-)
%{_libdir}/*.so.*
%files devel
%defattr(-,root,root,-)
%doc AUTHORS COPYING NEWS README TODO
%{_includedir}/*
%{_libdir}/*.so
%{_libdir}/pkgconfig/%{name}.pc
%{_mandir}/man3/%{name}.*
%files -n python-%{name}
%defattr(-,root,root,-)
%doc COPYING
%{python_sitearch}/*
# %%files -n octave-nlopt_optimize
# %%defattr(-,root,root,-)
# %%doc COPYING
# %%dir %%{_libdir}/octave/*/site
# %%dir %%{_libdir}/octave/*/site/oct
# %%dir %%{_libdir}/octave/*/site/oct/*
# %%{_libdir}/octave/*/site/oct/*/*.oct
# %%{_datadir}/octave/*/site/m/*
%changelog