3fd52cf
Name:           cddlib
c0f9278
Version:        094g
fef4c4c
Release:        4%{?dist}
3fd52cf
Summary:        A library for generating all vertices in convex polyhedrons
3fd52cf
Group:          Applications/Engineering
3fd52cf
License:        GPLv2+
3fd52cf
URL:            http://www.ifor.math.ethz.ch/~fukuda/cdd_home/
c0f9278
Source0:        ftp://ftp.ifor.math.ethz.ch/pub/fukuda/cdd/%{name}-%{version}.tar.gz
58ec093
# Extracted from http://www.sagemath.org/packages/standard/cddlib-094f.p11.spkg
58ec093
Source1:        cdd_both_reps.c
eb168b2
fef4c4c
BuildRequires:  autoconf
3fd52cf
BuildRequires:  gmp-devel
eb168b2
BuildRequires:  tex(latex)
3fd52cf
58ec093
Patch0:         cddlib-sagemath.patch
3fd52cf
3fd52cf
%description
3fd52cf
The C-library cddlib is a C implementation of the Double Description 
3fd52cf
Method of Motzkin et al. for generating all vertices (i.e. extreme points)
3fd52cf
and extreme rays of a general convex polyhedron in R^d given by a system 
3fd52cf
of linear inequalities:
3fd52cf
3fd52cf
   P = { x=(x1, ..., xd)^T :  b - A  x  >= 0 }
3fd52cf
3fd52cf
where A is a given m x d real matrix, b is a given m-vector 
3fd52cf
and 0 is the m-vector of all zeros.
3fd52cf
3fd52cf
The program can be used for the reverse operation (i.e. convex hull
3fd52cf
computation). This means that one can move back and forth between 
3fd52cf
an inequality representation and a generator (i.e. vertex and ray) 
3fd52cf
representation of a polyhedron with cdd. Also, cdd can solve a linear
3fd52cf
programming problem, i.e. a problem of maximizing and minimizing 
3fd52cf
a linear function over P.
3fd52cf
3fd52cf
3fd52cf
%package devel
eb168b2
Summary:        Headers for cddlib
eb168b2
Group:          Development/Libraries
eb168b2
Requires:       gmp-devel%{?_isa}
eb168b2
Requires:       %{name}%{?_isa} = %{version}-%{release}
3fd52cf
3fd52cf
%description devel
eb168b2
Include files for cddlib.
eb168b2
eb168b2
eb168b2
%package static
eb168b2
Summary:        Static libraries for cddlib
eb168b2
Group:          Development/Libraries
eb168b2
eb168b2
%description static
eb168b2
Static libraries for cddlib.
3fd52cf
3fd52cf
b24a13f
%package tools
b24a13f
Summary:        Sample binaries that use cddlib
b24a13f
Group:          Applications/Engineering
b24a13f
Requires:       %{name}%{?_isa} = %{version}-%{release}
b24a13f
b24a13f
%description tools
b24a13f
Sample binaries that use cddlib.
b24a13f
b24a13f
3fd52cf
%prep
3fd52cf
%setup -q
58ec093
%patch0 -p1
58ec093
58ec093
# due to patch0 change to Makefile.am files
58ec093
autoreconf -ifs
58ec093
58ec093
# install sagemath extra source
58ec093
cp %{SOURCE1} src
58ec093
ln -sf ../src/cdd_both_reps.c src-gmp/cdd_both_reps.c
eb168b2
3fd52cf
# Clean up the examples
c0f9278
rm -rf src/~ src-gmp/~
c0f9278
find . -name \.DS_Store\* | xargs rm -f
c0f9278
rm doc/cddlibman.{aux,blg,dvi,log,pdf,ps}
3fd52cf
8257a28
# Fix the FSF's address
8257a28
for f in `find . -type f | xargs grep -Fl '675 Mass'`; do
8257a28
  sed -i.orig \
8257a28
    's/675 Mass Ave, Cambridge, MA 02139/51 Franklin Street, Suite 500, Boston, MA  02110-1335/' \
8257a28
    $f
8257a28
  touch -r $f.orig $f
8257a28
  rm -f $f.orig
8257a28
done
8257a28
3fd52cf
3fd52cf
%build
3fd52cf
%configure
eb168b2
c0f9278
# Get rid of undesirable hardcoded rpaths
c0f9278
sed -e 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' \
c0f9278
    -e 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' \
c0f9278
    -i libtool
c0f9278
eb168b2
# Configure finds libgmp and tries to link it with everything.
eb168b2
sed -i 's/ -lgmp//' lib-src/Makefile
eb168b2
3fd52cf
make %{?_smp_mflags}
c58279d
cd doc
c0f9278
pdflatex cddlibman.tex
c0f9278
pdflatex cddlibman.tex
3fd52cf
3fd52cf
3fd52cf
%install
cc0ec24
make install DESTDIR=$RPM_BUILD_ROOT INSTALL="install -p"
c58279d
mkdir $RPM_BUILD_ROOT%{_includedir}/cddlib
c58279d
mv $RPM_BUILD_ROOT%{_includedir}/{cdd,cdd_f,cddmp,cddmp_f,cddtypes,cddtypes_f,setoper}.h \
c58279d
  $RPM_BUILD_ROOT%{_includedir}/cddlib/
eb168b2
rm -f $RPM_BUILD_ROOT%{_libdir}/*.la
3fd52cf
3fd52cf
eb168b2
%post -p /sbin/ldconfig
eb168b2
eb168b2
eb168b2
%postun -p /sbin/ldconfig
eb168b2
eb168b2
eb168b2
%files
eb168b2
%doc AUTHORS ChangeLog COPYING README
eb168b2
%{_libdir}/*.so.*
3fd52cf
3fd52cf
3fd52cf
%files devel
c0f9278
%doc doc/cddlibman.pdf examples*
c58279d
%{_includedir}/cddlib
eb168b2
%{_libdir}/*.so
eb168b2
eb168b2
eb168b2
%files static
3fd52cf
%{_libdir}/libcdd.a
3fd52cf
%{_libdir}/libcddgmp.a
3fd52cf
3fd52cf
b24a13f
%files tools
b24a13f
%{_bindir}/*
b24a13f
b24a13f
3fd52cf
%changelog
fef4c4c
* Sun Jul 22 2012 Conrad Meyer <konrad@tylerc.org> - 094g-4
fef4c4c
- Add autoconf BR as per mass rebuild build failure
fef4c4c
5dc55c0
* Wed Jul 18 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 094g-3
5dc55c0
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
5dc55c0
58ec093
* Thu Jul 5 2012 pcpa <paulo.cesar.pereira.de.andrade@gmail.com> - 094g-2
58ec093
- Add sagemath patches
58ec093
c0f9278
* Tue Apr 24 2012 Jerry James <loganjerry@gmail.com> - 094g-1
c0f9278
- New upstream release
c0f9278
- All patches upstreamed
c0f9278
- Non-free sources removed from upstream tarball
c0f9278
b24a13f
* Fri Apr 20 2012 Jerry James <loganjerry@gmail.com> - 094f-15
b24a13f
- Package the sample binaries in -tools for the use of projects such as LattE
b24a13f
- Add memleak patch from upstream
b24a13f
a157da4
* Fri Feb 24 2012 Jerry James <loganjerry@gmail.com> - 094f-14
a157da4
- Actually apply the const patch
a157da4
8257a28
* Fri Feb 24 2012 Jerry James <loganjerry@gmail.com> - 094f-13
8257a28
- Add const qualifier to public function parameters
8257a28
- Fix the FSF's address
8257a28
631ea9e
* Sat Jan  7 2012 Jerry James <loganjerry@gmail.com> - 094f-12
631ea9e
- Rebuild for GCC 4.7
631ea9e
- Minor spec file cleanups
631ea9e
67f3aa6
* Thu Oct 20 2011 Marcela Mašláňová <mmaslano@redhat.com> - 094f-11.2
67f3aa6
- rebuild with new gmp without compat lib
67f3aa6
83467ee
* Mon Oct 10 2011 Peter Schiffer <pschiffe@redhat.com> - 094f-11.1
83467ee
- rebuild with new gmp
83467ee
eb168b2
* Thu Apr  7 2011 Jerry James <loganjerry@gmail.com> - 094f-11
eb168b2
- Build shared libraries as well as static
eb168b2
- Drop BuildRoot and the clean section
eb168b2
009b56c
* Tue Feb 08 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 094f-10
009b56c
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
009b56c
c0d2d0e
* Fri Jul 24 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 094f-9
c0d2d0e
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
c0d2d0e
40345a5
* Mon Feb 23 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 094f-8
40345a5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild
40345a5
cc0ec24
* Fri Nov 28 2008 Conrad Meyer <konrad@tylerc.org> - 094f-7
cc0ec24
- Install headers with install -p to save timestamps.
c58279d
- Install headers to namespaced directory.
c58279d
- Generate pdf from latex source.
cc0ec24
3fd52cf
* Fri Oct 31 2008 Conrad Meyer <konrad@tylerc.org> - 094f-6
3fd52cf
- Describe vividly the process whereby the non-free file is
3fd52cf
  stripped from the source tarball.
3fd52cf
3fd52cf
* Thu Oct 30 2008 Conrad Meyer <konrad@tylerc.org> - 094f-5
3fd52cf
- Tarball scrubbed of content we are unable to ship.
3fd52cf
3fd52cf
* Tue Oct 28 2008 Conrad Meyer <konrad@tylerc.org> - 094f-4
3fd52cf
- Remove modules that do not meet licensing guidelines.
3fd52cf
- Don't generate debuginfo.
3fd52cf
3fd52cf
* Tue Oct 28 2008 Conrad Meyer <konrad@tylerc.org> - 094f-3
3fd52cf
- Fix permissions on documentation.
3fd52cf
3fd52cf
* Mon Oct 27 2008 Conrad Meyer <konrad@tylerc.org> - 094f-2
3fd52cf
- Incorporate several suggestions from review.
3fd52cf
3fd52cf
* Thu Sep 25 2008 Conrad Meyer <konrad@tylerc.org> - 094f-1
3fd52cf
- Initial package.