Name: libtomfloat Version: 0.02 Release: 1 Summary: A portable multiple precision floating point arithmetic library Group: System Environment/Libraries License: Public Domain URL: http://www.libtom.org/?page=features&newsitems=5&whatfile=ltf Source0: http://www.libtom.org/files/ltf-%{version}.tar.bz2 Source1: http://www.libtom.org/files/ltf-%{version}.tar.bz2.sig Patch0: %{name}-%{version}-aix.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root BuildRequires: coreutils, libtommath-devel >= 0.42 Requires: libtommath >= 0.42 %description A free open source portable multiple precision floating point arithmetic library written entirely in C. The library is designed to provide a simple to work with API that provides fairly efficient routines that build out of the box without configuration. 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 %{name}.a ${CC} -qmkshrobj %{name}.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 %{name}.a ${CC} -qmkshrobj %{name}.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 %{name}.a shr32.o /usr/bin/ar -X64 -q %{name}.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/float.pdf %changelog * Tue Feb 22 2011 Michael Perzl - 0.02-1 - first version for AIX V5.1 and higher