ufsparse/ufsparse.spec

315 lines
9.7 KiB
RPMSpec

Name: ufsparse
Version: 1.2
Release: 1%{?dist}
Summary: University of Florida sparse matrix libraries
Group: System Environment/Libraries
License: Distributable
URL: http://www.cise.ufl.edu/research/sparse/UFsparse
Source0: http://www.cise.ufl.edu/research/sparse/UFsparse/v%{version}/UFsparse.tar.gz
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires: blas-devel
Obsoletes: umfpack
%description
ufsparse is a collection of libraries for computations involving sparse
matrices. The package includes the following libraries:
AMD approximate minimum degree ordering
BTF permutation to block triangular form (beta)
COLAMD column approximate minimum degree ordering
CCOLAMD constrained column approximate minimum degree ordering
CHOLMOD sparse Cholesky factorization
CSparse a concise sparse matrix package
CXSparse CSparse extended: complex matrix, int and long int support
KLU sparse LU factorization, primarily for circuit simulation
LDL a simple LDL' factorization
UMFPACK sparse LU factorization
UFconfig configuration file for all the above packages.
%package devel
Summary: Development headers and files for UFSparse
Group: Development/Libraries
Requires: %{name} = %{version}-%{release}
Obsoletes: umfpack-devel
%description devel
The ufsparse-devel package contains files needed for developing
applications which use the ufsparse libraries.
%prep
%setup -q -n UFsparse
%build
%define amd_version 1.2
%define amd_version_major 1
mkdir Devel
mkdir Doc
mkdir Lib
mkdir Include
pushd AMD
pushd Source
make -f Makefile CFLAGS="$RPM_OPT_FLAGS -fPIC"
gcc -shared -Wl,-soname,libamd.so.%{amd_version_major} -o ../Lib/libamd.so.%{amd_version} `ls *.o`
popd
cp Lib/*.a Lib/*.so* ../Lib
cp Include/*.h ../Include
mkdir ../Doc/AMD/
cp README.txt Doc/License Doc/ChangeLog ../Doc/AMD/
mkdir ../Devel/AMD/
cp Doc/*.pdf ../Devel/AMD/
popd
pushd Lib
ln -sf libamd.so.%{amd_version} libamd.so.%{amd_version_major}
ln -sf libamd.so.%{amd_version} libamd.so
popd
%define btf_version 0.7
%define btf_version_major 0
pushd BTF
pushd Lib
make -f Makefile CFLAGS="$RPM_OPT_FLAGS -fPIC" libbtf.a
gcc -shared -Wl,-soname,libbtf.so.%{btf_version_major} -o libbtf.so.%{btf_version} `ls *.o`
popd
cp Lib/*.a Lib/*.so* ../Lib
cp Include/*.h ../Include
mkdir ../Doc/BTF/
cp README.txt Doc/lesser.txt ../Doc/BTF/
popd
pushd Lib
ln -sf libbtf.so.%{btf_version} libbtf.so.%{btf_version_major}
ln -sf libbtf.so.%{btf_version} libbtf.so
popd
%define ccolamd_version 1.0
%define ccolamd_version_major 1
pushd CCOLAMD
make -f Makefile CFLAGS="$RPM_OPT_FLAGS -fPIC"
gcc -shared -Wl,-soname,libccolamd.so.%{ccolamd_version_major} -o libccolamd.so.%{ccolamd_version} `ls *.o`
cp *.a *.so* ../Lib
cp *.h ../Include
mkdir ../Doc/CCOLAMD/
cp README.txt lesser.txt ChangeLog ../Doc/CCOLAMD
popd
pushd Lib
ln -sf libccolamd.so.%{ccolamd_version} libccolamd.so.%{ccolamd_version_major}
ln -sf libccolamd.so.%{ccolamd_version} libccolamd.so
popd
%define cholmod_version 1.0
%define cholmod_version_major 1
### CHOLMOD can also be compiled to use the METIS library, but it is not
### used here because its licensing terms exclude it from Fedora Extras.
### To compile with METIS, define enable_metis as 1 below.
%define enable_metis 0
%if "%{?enable_metis}" == "1"
CHOLMOD_FLAGS="$RPM_OPT_FLAGS -I%{_includedir}/metis -fPIC"
%else
CHOLMOD_FLAGS="$RPM_OPT_FLAGS -DNPARTITION -fPIC"
%endif
pushd CHOLMOD
pushd Lib
make -f Makefile CFLAGS="$CHOLMOD_FLAGS"
gcc -shared -Wl,-soname,libcholmod.so.%{cholmod_version_major} -o ../Lib/libcholmod.so.%{cholmod_version} `ls *.o`
popd
cp Lib/*.a Lib/*.so* ../Lib
cp Include/*.h ../Include
mkdir ../Doc/CHOLMOD
cp README.txt ../Doc/CHOLMOD/
cp Cholesky/License.txt ../Doc/CHOLMOD/Cholesky_License.txt
cp Core/License.txt ../Doc/CHOLMOD/Core_License.txt
cp MatrixOps/License.txt ../Doc/CHOLMOD/MatrixOps_License.txt
cp Partition/License.txt ../Doc/CHOLMOD/Partition_License.txt
cp Supernodal/License.txt ../Doc/CHOLMOD/Supernodal_License.txt
mkdir ../Devel/CHOLMOD/
cp Doc/*.pdf ../Devel/CHOLMOD/
popd
pushd Lib
ln -sf libcholmod.so.%{cholmod_version} libcholmod.so.%{cholmod_version_major}
ln -sf libcholmod.so.%{cholmod_version} libcholmod.so
popd
%define colamd_version 2.4
%define colamd_version_major 2
pushd COLAMD
make -f Makefile CFLAGS="$RPM_OPT_FLAGS -fPIC" library
gcc -shared -Wl,-soname,libcolamd.so.%{colamd_version_major} -o libcolamd.so.%{colamd_version} `ls *.o`
cp *.a *.so* ../Lib
cp *.h ../Include
mkdir ../Doc/COLAMD/
cp README.txt ChangeLog ../Doc/COLAMD
popd
pushd Lib
ln -sf libcolamd.so.%{colamd_version} libcolamd.so.%{colamd_version_major}
ln -sf libcolamd.so.%{colamd_version} libcolamd.so
popd
### CXSparse is a superset of CSparse, and the two share common header
### names, so it does not make sense to build both. CXSparse is built
### by default, but CSparse can be built instead by defining
### enable_csparse as 1 below.
%define enable_csparse 0
%if "%{?enable_csparse}" == "1"
%define csparse_version 1.2
%define csparse_version_major 1
pushd CSparse
pushd Source
make -f Makefile CFLAGS="$RPM_OPT_FLAGS -fPIC" libcsparse.a
gcc -shared -Wl,-soname,libcsparse.so.%{csparse_version_major} -o libcsparse.so.%{csparse_version} `ls *.o`
cp *.a *.so* ../../Lib
cp cs.h ../../Include
popd
mkdir ../Doc/CSparse/
cp README.txt License.txt lesser.txt ../Doc/CSparse
popd
pushd Lib
ln -sf libcsparse.so.%{csparse_version} libcsparse.so.%{csparse_version_major}
ln -sf libcsparse.so.%{csparse_version} libcsparse.so
popd
%else
%define cxsparse_version 1.2
%define cxsparse_version_major 1
pushd CXSparse
pushd Source
make -f Makefile CFLAGS="$RPM_OPT_FLAGS -fPIC" libcxsparse.a
gcc -shared -Wl,-soname,libcxsparse.so.%{cxsparse_version_major} -o libcxsparse.so.%{cxsparse_version} `ls *.o`
cp *.a *.so* ../../Lib
cp cs.h ../../Include
popd
mkdir ../Doc/CXSparse/
cp README.txt License.txt lesser.txt ../Doc/CXSparse
popd
pushd Lib
ln -sf libcxsparse.so.%{cxsparse_version} libcxsparse.so.%{cxsparse_version_major}
ln -sf libcxsparse.so.%{cxsparse_version} libcxsparse.so
popd
%endif
%define klu_version 0.7
%define klu_version_major 0
pushd KLU
pushd Lib
make -f Makefile CFLAGS="$RPM_OPT_FLAGS -fPIC" libklu.a
gcc -shared -Wl,-soname,libklu.so.%{klu_version_major} -o libklu.so.%{klu_version} `ls *.o`
popd
cp Lib/*.a Lib/*.so* ../Lib
cp Include/*.h ../Include
mkdir ../Doc/KLU/
cp README.txt Doc/lesser.txt ../Doc/KLU/
mkdir ../Devel/KLU/
popd
pushd Lib
ln -sf libklu.so.%{klu_version} libklu.so.%{klu_version_major}
ln -sf libklu.so.%{klu_version} libklu.so
popd
%define ldl_version 1.2
%define ldl_version_major 1
pushd LDL
make -f Makefile CFLAGS="$RPM_OPT_FLAGS -fPIC" libldl.a
gcc -shared -Wl,-soname,libldl.so.%{ldl_version_major} -o libldl.so.%{ldl_version} `ls *.o`
cp *.a *.so* ../Lib
cp *.h ../Include
mkdir ../Doc/LDL/
cp README.txt ChangeLog lesser.txt ../Doc/LDL/
mkdir ../Devel/LDL/
cp *.pdf *.ps ../Devel/LDL/
popd
pushd Lib
ln -sf libldl.so.%{ldl_version} libldl.so.%{ldl_version_major}
ln -sf libldl.so.%{ldl_version} libldl.so
popd
%define umfpack_version 4.6
%define umfpack_version_major 4
pushd UMFPACK
pushd Source
make -f Makefile CFLAGS="$RPM_OPT_FLAGS -fPIC"
gcc -shared -Wl,-soname,libumfpack.so.%{umfpack_version_major} -o ../Lib/libumfpack.so.%{umfpack_version} `ls *.o` -lblas -lm
popd
cp Lib/*.a Lib/*.so* ../Lib
cp Include/*.h ../Include
mkdir ../Doc/UMFPACK
cp Doc/License Doc/ChangeLog Doc/lesser.txt README.txt ../Doc/UMFPACK
mkdir ../Devel/UMFPACK/
cp Doc/*.pdf ../Devel/UMFPACK/
popd
pushd Lib
ln -sf libumfpack.so.%{umfpack_version} libumfpack.so.%{umfpack_version_major}
ln -sf libumfpack.so.%{umfpack_version} libumfpack.so
popd
%install
rm -rf ${RPM_BUILD_ROOT}
mkdir -p ${RPM_BUILD_ROOT}%{_libdir}
mkdir -p ${RPM_BUILD_ROOT}%{_includedir}/%{name}
pushd Lib
for f in *.a *.so*; do
cp -a $f ${RPM_BUILD_ROOT}%{_libdir}/$f
done
popd
pushd Include
for f in *.h; do
cp -a $f ${RPM_BUILD_ROOT}%{_includedir}/%{name}/$f
done
popd
%clean
rm -rf ${RPM_BUILD_ROOT}
%post -p /sbin/ldconfig
%postun -p /sbin/ldconfig
%files
%defattr(-,root,root)
%doc Doc/*
%{_libdir}/lib*.so.*
%files devel
%defattr(-,root,root)
%doc Devel/*
%{_includedir}/%{name}
%{_libdir}/lib*.a
%{_libdir}/lib*.so
%changelog
* Tue Mar 7 2006 Quentin Spencer <qspencer@users.sourceforge.net> 1.2-1
- New release.
- Build newly added library CXSparse (but not CSparse--see comments
in build section).
* Wed Feb 15 2006 Quentin Spencer <qspencer@users.sourceforge.net> 0.93-2
- Rebuild for Fedora Extras 5.
* Thu Feb 9 2006 Quentin Spencer <qspencer@users.sourceforge.net> 0.93-1
- New release. Remove old patch.
* Wed Dec 14 2005 Quentin Spencer <qspencer@users.sourceforge.net> 0.92-2
- Add patch0--fixes LDL/Makefile so CFLAGS are used when compiling ldl.a.
* Wed Dec 14 2005 Quentin Spencer <qspencer@users.sourceforge.net> 0.92-1
- Update to Dec 8 2005 version.
* Tue Oct 25 2005 Quentin Spencer <qspencer@users.sourceforge.net> 0.91-2
- Rebuild.
* Tue Oct 18 2005 Quentin Spencer <qspencer@users.sourceforge.net> 0.91-1
- New upstream release, incorporating previous patches
- chmod the build directory to ensure all headers are world readable
* Fri Oct 07 2005 Quentin Spencer <qspencer@users.sourceforge.net> 0.9-3
- Build cholmod, but disable METIS using -DNPARTITION flag.
* Sat Oct 01 2005 Quentin Spencer <qspencer@users.sourceforge.net> 0.9-2
- Modify description, other modifications for import into FE.
- Add dist tag, cosmetic changes.
* Tue Sep 08 2005 David Bateman <dbateman@free.fr> 0.9-1
- First version.