Sophie

Sophie

distrib > Mandriva > 2011.0 > x86_64 > by-pkgid > a50e2ee22e3b2a34684c3e6a5f55a46a > files > 6

lcalc-1.23-5.src.rpm

# mpfr patch not complete. Could be done by changing most places a
# template wants a mpfr_t to a double, or calling the proper mpfr_foo
# function. But due to large amount of patches required (and only a
# few done in patch0), better to just disable it to avoid breaking
# the package.

# mpfr build is also not enabled in sagemath

%define with_mpfr	0
%define name		lcalc

Name:		%{name}
Group:		Sciences/Mathematics
License:	LGPL
Summary:	C++ L-function class library and command line interface
Version:	1.23
Release:	%mkrel 5
Source:		http://pmmac03.math.uwaterloo.ca/~mrubinst/L_function_public/CODE/L-%{version}.tar.gz
# From sage tarball, lcalc spkg, debian directory
Source1:	lcalc.1
URL:		http://pmmac03.math.uwaterloo.ca/~mrubinst/L_function_public/L.html
BuildRoot:	%{_tmppath}/%{name}-%{version}-%{release}-buildroot

BuildRequires:	gcc-c++
%if %{with_mpfr}
BuildRequires:	mpfr-devel
%endif
BuildRequires:	gmpxx-devel
BuildRequires:	libpari-devel

Patch0:		L-1.21.g++4.3.2-mpfr.patch
Patch1:		L-1.23-pari.patch
Patch2:		L-1.23-lcalc_to_double.patch

%description
C++ L-function class library and command line interface.

%package	devel
Group:		Development/C++
Summary:	Development files for %{name}
Requires:	%{name} = %{version}-%{release}

%description	devel
Development files for %{name}.

%prep
%setup -q -n L-%{version}

%if %{with_mpfr}
%patch0	-p1
%endif
%patch1 -p1
%patch2 -p1

# Make it actually link with the generated library
perl -pi							\
	-e 's|/lib/|/%{_lib}/|g;'				\
	-e 's|libLfunction.so|libLfunction.so.%{version}|g;'	\
	-e 's|(\$\(CC\).*cc )lib(Lfunction).so.%{version}|$1-L. -l$2|g;'\
	src/Makefile
rm -f src/libLfunction.a

%build
pushd src
# Create link before library is created
    ln -sf libLfunction.so.%{version} libLfunction.so
    %make							\
%if %{with_mpfr}
	PREPROCESSOR_DEFINE="-DUSE_MPFR"			\
%endif
	PARI_DEFINE="-DINCLUDE_PARI"				\
	LOCATION_PARI_H="%{_includedir}/pari"			\
	LOCATION_PARI_LIBRARY="%{_libdir}"			\
	all
popd

%install
mkdir -p %{buildroot}%{_includedir}
mkdir -p %{buildroot}%{_libdir}
mkdir -p %{buildroot}%{_bindir}
mkdir -p %{buildroot}%{_mandir}/man1
pushd src
    %make							\
	INSTALL_DIR="%{buildroot}%{_prefix}"			\
	install
    rm -f %{buildroot}%{_includedir}/Lfunction/*.back
    rm -f %{buildroot}%{_includedir}/Lfunction/.??*
    rm -f %{buildroot}%{_includedir}/Lfunction/*.h.??*
    mkdir -p %{buildroot}%{_datadir}/%{name}
    cp -fa example_data_files/* %{buildroot}%{_datadir}/%{name}
popd
cp %{SOURCE1} %{buildroot}%{_mandir}/man1
lzma -f -z %{buildroot}%{_mandir}/man1/`basename %{SOURCE1}`
pushd %{buildroot}%{_libdir}
    ln -sf libLfunction.so.%{version} libLfunction.so
popd
chmod a+r %{buildroot}%{_includedir}/Lfunction/*.h
pushd %{buildroot}%{_includedir}
    ln -sf Lfunction lcalc
popd

%clean
rm -rf %{buildroot}

%files
%defattr(-,root,root)
%{_bindir}/%{name}
%dir %{_datadir}/%{name}
%{_libdir}/libLfunction.so.%{version}
%{_datadir}/%{name}/*
%{_mandir}/man1/*

%files devel
%defattr(-,root,root)
%dir %{_includedir}/Lfunction
%{_includedir}/lcalc
%{_includedir}/Lfunction/*
%{_libdir}/libLfunction.so


%changelog
* Sat Apr 09 2011 Paulo Andrade <pcpa@mandriva.com.br> 1.23-5mdv2011.0
+ Revision: 652002
- Correct build with gcc 4.6.0

* Thu Nov 11 2010 Paulo Andrade <pcpa@mandriva.com.br> 1.23-4mdv2011.0
+ Revision: 595921
- Rebuild with newer pari

* Tue Aug 17 2010 Paulo Andrade <pcpa@mandriva.com.br> 1.23-3mdv2011.0
+ Revision: 571049
+ rebuild (emptylog)

* Tue Aug 17 2010 Paulo Andrade <pcpa@mandriva.com.br> 1.23-2mdv2011.0
+ Revision: 571038
+ rebuild (emptylog)

* Wed Jul 14 2010 Paulo Andrade <pcpa@mandriva.com.br> 1.23-1mdv2011.0
+ Revision: 552977
- Update to version 1.23.

* Sat May 09 2009 Paulo Andrade <pcpa@mandriva.com.br> 1.21-2mdv2010.0
+ Revision: 373565
+ rebuild (emptylog)

* Thu Mar 26 2009 Paulo Andrade <pcpa@mandriva.com.br> 1.21-1mdv2009.1
+ Revision: 361222
- Initial import of lcalc version 1.21.
  C++ L-function class library and command line interface
  http://pmmac03.math.uwaterloo.ca/~mrubinst/L_function_public/L.html
- lcalc