Blob Blame History Raw
Name:           coin-or-lemon
Version:        1.3.1
Release:        11%{?dist}
Summary:        A C++ template library providing many common graph algorithms

License:        Boost and BSD
URL:            http://lemon.cs.elte.hu/trac/lemon
Source0:        http://lemon.cs.elte.hu/pub/sources/lemon-%{version}.tar.gz

# https://lemon.cs.elte.hu/trac/lemon/ticket/502
Patch0:         lemon-1.3.1-cmake-policy.patch

# https://lemon.cs.elte.hu/trac/lemon/ticket/503
Patch1:         lemon-1.3.1-buildfix.patch

BuildRequires:  cmake coin-or-Clp-devel coin-or-Cbc-devel glpk-devel bzip2-devel zlib-devel

%description
LEMON stands for Library for Efficient Modeling and Optimization in
Networks. It is a C++ template library providing efficient
implementations of common data structures and algorithms with focus on
combinatorial optimization tasks connected mainly with graphs and
networks.

%package        devel
Summary:        Development files for %{name}
Requires:       %{name}%{?_isa} = %{version}-%{release}

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


%package        tools
Summary:        Command-line tools for %{name}
Requires:       %{name}%{?_isa} = %{version}-%{release}

%description    tools
The %{name}-tools package contains a handful of command-line tools that
come with %{name}.


%package        doc
Summary:        Documentation for for %{name}
BuildArch:      noarch

%description    doc
The %{name}-doc package contains a %{name}'s API documentation.


%prep
%setup -q -n lemon-%{version}
%patch0 -p1
%patch1 -p1


%build

# CPLEX (aka ILOG) and SOPLEX are non-free, so don't try to detect them.
#
# We suppress detection of ghostscript, doxygen, and python to make
# the build behave the same way with and without them installed -- we
# don't actually need them, since we don't need to rebuild the docs.
%cmake -DLEMON_ENABLE_GLPK=YES -DLEMON_ENABLE_ILOG=NO -DLEMON_ENABLE_COIN=YES \
    -DLEMON_ENABLE_SOPLEX=no \
    -DGHOSTSCRIPT_EXECUTABLE= -DDOXYGEN_EXECUTABLE= -DPYTHON_EXECUTABLE=

make %{?_smp_mflags}


%check
make check


%install
%make_install

# lemon hardcodes prefix/lib for libraries.  Fix it.
if [[ "%{_libdir}" != "/usr/lib" ]]; then
  mv %{buildroot}/usr/lib %{buildroot}/%{_libdir}
fi

# Annoyingly, 'make install' will only install docs if it rebuilt them.
# Rather than patching CMakeLists.txt, just install them manually.
mkdir -p %{buildroot}/%{_pkgdocdir}/
cp -r -p doc/html %{buildroot}/%{_pkgdocdir}/

# We also need to install NEWS, README, and LICENSE.  See:
# https://fedorahosted.org/fpc/ticket/338
cp -r -p NEWS LICENSE README %{buildroot}/%{_pkgdocdir}/

# We don't own /usr/share/lemon; rename it
mv %{buildroot}/%{_datadir}/lemon %{buildroot}/%{_datadir}/%{name}

%post -p /sbin/ldconfig

%postun -p /sbin/ldconfig


%files
%dir %{_pkgdocdir}
%{_pkgdocdir}/NEWS
%{_pkgdocdir}/README
%{_pkgdocdir}/LICENSE
%{_libdir}/*.so.*

%files devel
%{_includedir}/*
%{_libdir}/*.so
%{_libdir}/pkgconfig/*.pc
%{_datadir}/coin-or-lemon/

%files tools
%{_bindir}/*

%files doc
%{_pkgdocdir}
%exclude %{_pkgdocdir}/NEWS
%exclude %{_pkgdocdir}/README


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

* Wed Apr  5 2017 Jerry James <loganjerry@gmail.com> - 1.3.1-10
- Rebuild for glpk 4.61

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

* Fri Mar 11 2016 luto@kernel.org - 1.3.1-8
- Rebuild for libglpk.so.40

* Fri Feb 19 2016 luto@kernel.org - 1.3.1-7
- Rebuild for updated glpk

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

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

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

* Sat Aug 16 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.3.1-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild

* Wed Jul 09 2014 Andy Lutomirski <luto@mit.edu> - 1.3.1-2
- Switch to the upstream fix for bug 503.

* Tue Jul 08 2014 Andy Lutomirski <luto@mit.edu> - 1.3.1-1
- New minor release.
- Drop now-unnecessary patches (thanks, LEMON upstream!).

* Mon Jun 09 2014 Andy Lutomirski <luto@mit.edu> - 1.3-6
- Fix BR.

* Mon Jun 09 2014 Andy Lutomirski <luto@mit.edu> - 1.3-5
- Enable GLPK, Clp, and Cbc.

* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.3-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild

* Thu Jun 05 2014 Andy Lutomirski <luto@mit.edu> - 1.3-3
- Use _pkgdocdir consistently (f19 fix)

* Wed Jun 04 2014 Andy Lutomirski <luto@mit.edu> - 1.3-2
- Add a downstream soname for libemon.so.
- Fix conflicts with the package called 'lemon'.
- Fix directory ownership.
- Fix license.
- Fix doc timestamps.

* Wed Feb  5 2014 Andy Lutomirski <luto@mit.edu> - 1.3-1
- Initial version.