LogoopenSUSE Build Service > Projects
Sign Up | Log In

View File DSDP.spec of Package DSDP (Project home:inescid:learning)

#
# spec file for package DSDP
#
# Copyright (c) 2012 SUSE LINUX Products 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/
#


%define libname libdsdp5

Name:           DSDP
Version:        5.8
Release:        0
Summary:        Software for semidefinite programming
License:        DSDP
Group:          Development/Libraries/C and C++

Url:            http://www.mcs.anl.gov/hs/software/DSDP/
Source0:        http://www.mcs.anl.gov/hs/software/DSDP/DSDP%{version}.tar.gz
# Man pages written by Jerry James using text from the sources.
# Therefore, the man pages have the same copyright and license as the source.
Source1:        DSDP-man.tar.xz
# A substitute makefile to fix the brokenness of the distributed Makefiles
Source2:        DSDP.Makefile
# This patch fixes a buffer overflow in one of the examples.  It has not yet
# been sent upstream.
Patch0:         DSDP-overflow.patch

BuildRequires:  doxygen
BuildRequires:  lapack-devel
BuildRequires:  unzip
BuildRequires:  xz
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

%description
DSDP is a free open source implementation of an interior-point method
for semidefinite programming.  It provides primal and dual solutions,
exploits low-rank structure and sparsity in the data, and has relatively
low memory requirements for an interior-point method.  It allows
feasible and infeasible starting points and provides approximate
certificates of infeasibility when no feasible solution exists.  The
dual-scaling algorithm implemented in this package has a convergence
proof and worst-case polynomial complexity under mild assumptions on the
data.  The software can be used as a set of subroutines, through Matlab,
or by reading and writing to data files.  Furthermore, the solver offers
scalable parallel performance for large problems and a well documented
interface.  Some of the most popular applications of semidefinite
programming and linear matrix inequalities (LMI) are model control,
truss topology design, and semidefinite relaxations of combinatorial and
global optimization problems. 

%package -n %libname
Summary:        Software for semidefinite programming
Group:          Development/Libraries/C and C++

%description -n %libname
DSDP is a free open source implementation of an interior-point method
for semidefinite programming.  It provides primal and dual solutions,
exploits low-rank structure and sparsity in the data, and has relatively
low memory requirements for an interior-point method.  It allows
feasible and infeasible starting points and provides approximate
certificates of infeasibility when no feasible solution exists.  The
dual-scaling algorithm implemented in this package has a convergence
proof and worst-case polynomial complexity under mild assumptions on the
data.  The software can be used as a set of subroutines, through Matlab,
or by reading and writing to data files.  Furthermore, the solver offers
scalable parallel performance for large problems and a well documented
interface.  Some of the most popular applications of semidefinite
programming and linear matrix inequalities (LMI) are model control,
truss topology design, and semidefinite relaxations of combinatorial and
global optimization problems. 

%package devel
Summary:        Headers and libraries for developing with DSDP
Group:          Development/Libraries/C and C++
Requires:       %libname = %{version}

%description devel
This package contains the headers and libraries for developing with DSDP.

%package examples
Summary:        Example programs that use DSDP
Group:          Development/Libraries/C and C++

%description examples
This package contains the examples programs that use the DSDP library.

%package doc
Summary:        Documentation filesof the DSDP library
Group:          Documentation/Other

%description doc
This package contains the documentation files of the DSDP library.

%prep
%setup -q -n %{name}%{version}
%setup -q -n %{name}%{version} -T -D -a 1
%patch0

sed -e "s|@RPM_OPT_FLAGS@|${RPM_OPT_FLAGS}|" \
    -e "s|@libdir@|%{_libdir}|" \
    -e "s|@version@|%{version}|" \
    %{SOURCE2} > Makefile

%build
make %{?_smp_mflags}
cd docs
unzip DSDP5-api-html.zip
cd dox
rm -fr html images
doxygen

%install
# Install the library
mkdir -p $RPM_BUILD_ROOT%{_libdir}
install -p -m 0755 src/libdsdp.so.%{version} $RPM_BUILD_ROOT%{_libdir}
ln -s libdsdp.so.%{version} $RPM_BUILD_ROOT%{_libdir}/libdsdp.so.5
ln -s libdsdp.so.5 $RPM_BUILD_ROOT%{_libdir}/libdsdp.so

# Install the header files
mkdir -p $RPM_BUILD_ROOT%{_includedir}
cp -a include $RPM_BUILD_ROOT%{_includedir}/DSDP

# Install the example programs with a dsdp- prefix, except for dsdp5
mkdir -p $RPM_BUILD_ROOT%{_bindir}
for f in maxcut theta stable color; do
  install -p -m 0755 examples/$f $RPM_BUILD_ROOT%{_bindir}/dsdp-$f
done
install -p -m 0755 examples/dsdp5 $RPM_BUILD_ROOT%{_bindir}

# Install the man pages
mkdir -p $RPM_BUILD_ROOT%{_mandir}/man1
cd man
for f in *.1; do
  sed "s/@VERSION@/%{version}/" $f > $RPM_BUILD_ROOT%{_mandir}/man1/$f
done

%post -n %libname -p /sbin/ldconfig

%postun -n %libname -p /sbin/ldconfig

%files -n %libname
%defattr(-,root,root)
%doc dsdp-license
%{_libdir}/libdsdp.so.*

%files devel
%defattr(-,root,root)
%doc dsdp-license
%{_libdir}/libdsdp.so
%{_includedir}/DSDP

%files examples
%defattr(-,root,root)
%doc examples/Contents
%{_bindir}/*
%{_mandir}/man1/*

%files doc
%defattr(-,root,root)
%doc dsdp-license docs/DSDP5-API-UserGuide.pdf docs/dox
%doc docs/DSDP5-Exe-UserGuide.pdf docs/DSDP5-P1289-0905.pdf

%changelog