Name: tomsfastmath Version: 0.12 Release: 1 Summary: A fast public domain large integer arithmetic library written in C Group: System Environment/Libraries License: Public Domain URL: http://www.libtom.org/?page=features&newsitems=5&whatfile=tfm Source0: http://www.libtom.org/files/tfm-%{version}.tar.bz2 Source1: http://www.libtom.org/files/tfm-%{version}.tar.bz2.sig Patch0: %{name}-%{version}-aix.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root BuildRequires: coreutils, gcc >= 4.2.3-2 BuildRequires: libtommath-devel >= 0.42 Requires: libtommath >= 0.42 %description TomsFastMath is a fast public domain, open source, large integer arithmetic library written in portable ISO C. It is a port of LibTomMath with optional support for inline assembler multipliers. It has the following features: * Builds with GCC [preferably v3.3.x or higher] on any 32-bit/64-bit box * Includes ASM optimizations (inline) for - x86-32 (e.g. i386 and SSE2) - x86-64 (e.g. AMD64) - ARM (ARMv4 and higher) - PPC32 (e.g. G3/G4) - PPC64 (e.g. G5) - AVR32 (Atmel 32-bit RISC processor) - MIPS (32-bit) * Includes fairly complete API (provides most of what LibTomMath provides) * Uses similar API as LibTomMath makes porting easy * Competitive speeds (and getting higher). - Faster than OpenSSL on the AMD64 - Still room for improvements * No heap usage (malloc/calloc/free) * Uses only inline asm, simplifies build process, simple to add new ports The library is available as 32-bit and 64-bit. %package devel Summary: Development files for %{name} Group: Development/Libraries Requires: %{name} = %{version}-%{release} %description devel The %{name}-devel package contains libraries and header files for developing applications that use %{name}. If you are compiling a 32-bit program, no special compiler options are needed. If you are compiling a 64-bit program, you have to compile and link your application with "cc -q64" or "gcc -maix64". %package doc Summary: Documentation files for %{name} Group: Documentation Requires: %{name} = %{version}-%{release} %description doc The %{name}-doc package contains PDF documentation for using %{name}. %prep %setup -q %patch0 mkdir ../32bit mv * ../32bit mv ../32bit . mkdir 64bit cd 32bit && tar cf - . | (cd ../64bit ; tar xpf -) %build export CFLAGS="-O5 -qstrict -qmaxmem=-1" # ------------------- 64-bits start ------------------ cd 64bit # first build the 64-bit version export OBJECT_MODE=64 make %{?_smp_mflags} -f makefile # create shared object CreateExportList -X64 %{name}.exp libtfm.a ${CC} -qmkshrobj libtfm.a -o shr64.o -bE:%{name}.exp -bernotok -L/opt/freeware/lib -ltommath rm -f %{name}.exp # ------------------- 64-bits end ------------------ # ------------------- 32-bits start ------------------ # now build the 32-bit version cd ../32bit export OBJECT_MODE=32 make %{?_smp_mflags} -f makefile # create shared object CreateExportList -X32 %{name}.exp libtfm.a ${CC} -qmkshrobj libtfm.a -o shr32.o -bE:%{name}.exp -bernotok -L/opt/freeware/lib -ltommath rm -f %{name}.exp # ------------------- 32-bits end ------------------ # now create the AIX-style shared library rm -f %{name}.a /usr/bin/ar -X32 -rv libtfm.a shr32.o /usr/bin/ar -X64 -q libtfm.a ../64bit/shr64.o %install [ "${RPM_BUILD_ROOT}" != "/" ] && rm -rf ${RPM_BUILD_ROOT} cd 32bit make install INCPATH=%{_includedir}/tommath DESTDIR=${RPM_BUILD_ROOT} LIBPATH=%{_libdir} -f makefile find ${RPM_BUILD_ROOT} -name '*.h' -exec chmod 644 {} ';' ( cd ${RPM_BUILD_ROOT} for dir in include lib do mkdir -p usr/${dir} cd usr/${dir} ln -sf ../..%{_prefix}/${dir}/* . cd - done ) %clean [ "${RPM_BUILD_ROOT}" != "/" ] && rm -rf ${RPM_BUILD_ROOT} %files %defattr(-,root,system,-) %doc 32bit/LICENSE %{_libdir}/*.a /usr/lib/*.a %files devel %defattr(-,root,system,-) %doc 32bit/LICENSE %{_includedir}/* /usr/include/* %files doc %defattr(-,root,system,-) %doc 32bit/LICENSE %doc 32bit/doc/tfm.pdf %changelog * Tue Feb 22 2011 Michael Perzl - 0.12-1 - first version for AIX V5.1 and higher