Name: tomsfastmath Version: 0.13.1 Release: 1 Summary: A fast public domain large integer arithmetic library written in C Group: System Environment/Libraries License: Public Domain URL: https://www.libtom.net/TomsFastMath/ Source0: https://github.com/libtom/tomsfastmath/archive/%{name}-%{version}.tar.gz Patch0: %{name}-%{version}-aix.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root BuildRequires: coreutils, make, gcc >= 4.5.4-1 BuildRequires: libtommath-devel >= 1.0.1-1 Requires: libtommath >= 1.0.1-1 %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_r -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="-O3 -qstrict -qmaxmem=262144" # ------------------- 64-bits start ------------------ cd 64bit # first build the 64-bit version export OBJECT_MODE=64 gmake %{?_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 gmake %{?_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 libtfm.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} export PATH=/opt/freeware/bin:$PATH cd 32bit gmake install INCPATH=%{_includedir}/tommath DESTDIR=${RPM_BUILD_ROOT} LIBPATH=%{_libdir} INSTALL_USER=`whoami` INSTALL_GROUP=`groups` -f makefile find ${RPM_BUILD_ROOT} -name '*.h' -exec chmod 644 {} ';' rm -f ${RPM_BUILD_ROOT}%{_libdir}/libtfm.a /usr/bin/ar -X32 -rv ${RPM_BUILD_ROOT}%{_libdir}/libtfm.a shr32.o /usr/bin/ar -X64 -q ${RPM_BUILD_ROOT}%{_libdir}/libtfm.a ../64bit/shr64.o ( 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 Oct 30 2018 Michael Perzl - 0.13.1-1 - updated to version 0.13.1 * Wed Jul 18 2018 Michael Perzl - 0.13-1 - updated to version 0.13 * Tue Feb 22 2011 Michael Perzl - 0.12-1 - first version for AIX V5.1 and higher