3fd52c
Name:           cddlib
3fd52c
Version:        094f
b24a13
Release:        15%{?dist}
3fd52c
Summary:        A library for generating all vertices in convex polyhedrons
3fd52c
Group:          Applications/Engineering
3fd52c
License:        GPLv2+
3fd52c
URL:            http://www.ifor.math.ethz.ch/~fukuda/cdd_home/
eb168b
#Source0:       ftp://ftp.ifor.math.ethz.ch/pub/fukuda/cdd/%%{name}-094f.tar.gz
3fd52c
#tar -xzf cddlib-094f.tar.gz
3fd52c
#rm cddlib-094f/examples-ml/Combinatorica5.m
3fd52c
#tar -czf cddlib-094-free.tar.gz cddlib-094f/
3fd52c
Source0:        %{name}-094f-free.tar.bz2
eb168b
# This patch was last sent upstream on 7 Apr 2011.  It adds the ability to
eb168b
# create a shared library, rather than a static library only.
eb168b
Patch0:         cddlib-configure.patch
b24a13
# This patch was sent upstream on 24 Feb 2012.  It adds const qualifiers to
a157da
# some parameters of public methods.  Their absence caused some compilation
a157da
# problems in C++ clients.
a157da
Patch1:         cddlib-const.patch
b24a13
# Patch from upstream to fix some memory leaks.
b24a13
Patch2:         cddlib-memleak.patch
eb168b
3fd52c
BuildRequires:  gmp-devel
eb168b
BuildRequires:  tex(latex)
3fd52c
3fd52c
3fd52c
%description
3fd52c
The C-library cddlib is a C implementation of the Double Description 
3fd52c
Method of Motzkin et al. for generating all vertices (i.e. extreme points)
3fd52c
and extreme rays of a general convex polyhedron in R^d given by a system 
3fd52c
of linear inequalities:
3fd52c
3fd52c
   P = { x=(x1, ..., xd)^T :  b - A  x  >= 0 }
3fd52c
3fd52c
where A is a given m x d real matrix, b is a given m-vector 
3fd52c
and 0 is the m-vector of all zeros.
3fd52c
3fd52c
The program can be used for the reverse operation (i.e. convex hull
3fd52c
computation). This means that one can move back and forth between 
3fd52c
an inequality representation and a generator (i.e. vertex and ray) 
3fd52c
representation of a polyhedron with cdd. Also, cdd can solve a linear
3fd52c
programming problem, i.e. a problem of maximizing and minimizing 
3fd52c
a linear function over P.
3fd52c
3fd52c
3fd52c
%package devel
eb168b
Summary:        Headers for cddlib
eb168b
Group:          Development/Libraries
eb168b
Requires:       gmp-devel%{?_isa}
eb168b
Requires:       %{name}%{?_isa} = %{version}-%{release}
3fd52c
3fd52c
%description devel
eb168b
Include files for cddlib.
eb168b
eb168b
eb168b
%package static
eb168b
Summary:        Static libraries for cddlib
eb168b
Group:          Development/Libraries
eb168b
eb168b
%description static
eb168b
Static libraries for cddlib.
3fd52c
3fd52c
b24a13
%package tools
b24a13
Summary:        Sample binaries that use cddlib
b24a13
Group:          Applications/Engineering
b24a13
Requires:       %{name}%{?_isa} = %{version}-%{release}
b24a13
b24a13
%description tools
b24a13
Sample binaries that use cddlib.
b24a13
b24a13
3fd52c
%prep
3fd52c
%setup -q
eb168b
%patch0 -p1
a157da
%patch1
b24a13
%patch2
eb168b
3fd52c
# Clean up the examples
3fd52c
rm -rf src/~
3fd52c
rm -rf src*/.DS_Store* src*/.gdb_history examples*/.DS_Store*
3fd52c
rm -rf src-gmp/~
3fd52c
chmod -x -R examples*/* src*/*
c58279
rm doc/cddlibman.pdf
3fd52c
8257a2
# Fix the FSF's address
8257a2
for f in `find . -type f | xargs grep -Fl '675 Mass'`; do
8257a2
  sed -i.orig \
8257a2
    's/675 Mass Ave, Cambridge, MA 02139/51 Franklin Street, Suite 500, Boston, MA  02110-1335/' \
8257a2
    $f
8257a2
  touch -r $f.orig $f
8257a2
  rm -f $f.orig
8257a2
done
8257a2
3fd52c
3fd52c
%build
3fd52c
%configure
eb168b
eb168b
# Configure finds libgmp and tries to link it with everything.
eb168b
sed -i 's/ -lgmp//' lib-src/Makefile
eb168b
3fd52c
make %{?_smp_mflags}
c58279
cd doc
c58279
  pdflatex cddlibman.tex
3fd52c
3fd52c
3fd52c
%install
cc0ec2
make install DESTDIR=$RPM_BUILD_ROOT INSTALL="install -p"
c58279
mkdir $RPM_BUILD_ROOT%{_includedir}/cddlib
c58279
mv $RPM_BUILD_ROOT%{_includedir}/{cdd,cdd_f,cddmp,cddmp_f,cddtypes,cddtypes_f,setoper}.h \
c58279
  $RPM_BUILD_ROOT%{_includedir}/cddlib/
eb168b
rm -f $RPM_BUILD_ROOT%{_libdir}/*.la
3fd52c
3fd52c
eb168b
%post -p /sbin/ldconfig
eb168b
eb168b
eb168b
%postun -p /sbin/ldconfig
eb168b
eb168b
eb168b
%files
eb168b
%doc AUTHORS ChangeLog COPYING README
eb168b
%{_libdir}/*.so.*
3fd52c
3fd52c
3fd52c
%files devel
3fd52c
%doc doc/cddlibman.pdf
b24a13
%doc examples* src-mathlink*
c58279
%{_includedir}/cddlib
eb168b
%{_libdir}/*.so
eb168b
eb168b
eb168b
%files static
3fd52c
%{_libdir}/libcdd.a
3fd52c
%{_libdir}/libcddgmp.a
3fd52c
3fd52c
b24a13
%files tools
b24a13
%{_bindir}/*
b24a13
b24a13
3fd52c
%changelog
b24a13
* Fri Apr 20 2012 Jerry James <loganjerry@gmail.com> - 094f-15
b24a13
- Package the sample binaries in -tools for the use of projects such as LattE
b24a13
- Add memleak patch from upstream
b24a13
a157da
* Fri Feb 24 2012 Jerry James <loganjerry@gmail.com> - 094f-14
a157da
- Actually apply the const patch
a157da
8257a2
* Fri Feb 24 2012 Jerry James <loganjerry@gmail.com> - 094f-13
8257a2
- Add const qualifier to public function parameters
8257a2
- Fix the FSF's address
8257a2
631ea9
* Sat Jan  7 2012 Jerry James <loganjerry@gmail.com> - 094f-12
631ea9
- Rebuild for GCC 4.7
631ea9
- Minor spec file cleanups
631ea9
Marcela Mašláňová 67f3aa
* Thu Oct 20 2011 Marcela Mašláňová <mmaslano@redhat.com> - 094f-11.2
Marcela Mašláňová 67f3aa
- rebuild with new gmp without compat lib
Marcela Mašláňová 67f3aa
Marcela Mašláňová 83467e
* Mon Oct 10 2011 Peter Schiffer <pschiffe@redhat.com> - 094f-11.1
Marcela Mašláňová 83467e
- rebuild with new gmp
Marcela Mašláňová 83467e
eb168b
* Thu Apr  7 2011 Jerry James <loganjerry@gmail.com> - 094f-11
eb168b
- Build shared libraries as well as static
eb168b
- Drop BuildRoot and the clean section
eb168b
009b56
* Tue Feb 08 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 094f-10
009b56
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
009b56
c0d2d0
* Fri Jul 24 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 094f-9
c0d2d0
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
c0d2d0
40345a
* Mon Feb 23 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 094f-8
40345a
- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild
40345a
cc0ec2
* Fri Nov 28 2008 Conrad Meyer <konrad@tylerc.org> - 094f-7
cc0ec2
- Install headers with install -p to save timestamps.
c58279
- Install headers to namespaced directory.
c58279
- Generate pdf from latex source.
cc0ec2
3fd52c
* Fri Oct 31 2008 Conrad Meyer <konrad@tylerc.org> - 094f-6
3fd52c
- Describe vividly the process whereby the non-free file is
3fd52c
  stripped from the source tarball.
3fd52c
3fd52c
* Thu Oct 30 2008 Conrad Meyer <konrad@tylerc.org> - 094f-5
3fd52c
- Tarball scrubbed of content we are unable to ship.
3fd52c
3fd52c
* Tue Oct 28 2008 Conrad Meyer <konrad@tylerc.org> - 094f-4
3fd52c
- Remove modules that do not meet licensing guidelines.
3fd52c
- Don't generate debuginfo.
3fd52c
3fd52c
* Tue Oct 28 2008 Conrad Meyer <konrad@tylerc.org> - 094f-3
3fd52c
- Fix permissions on documentation.
3fd52c
3fd52c
* Mon Oct 27 2008 Conrad Meyer <konrad@tylerc.org> - 094f-2
3fd52c
- Incorporate several suggestions from review.
3fd52c
3fd52c
* Thu Sep 25 2008 Conrad Meyer <konrad@tylerc.org> - 094f-1
3fd52c
- Initial package.