Name: zn_poly Version: 0.9 Release: 1 Summary: C library for polynomial arithmetic Group: Development/Libraries # see COPYING to see, which file has which license License: (GPLv2 or GPLv3) and GPLv2+ and LGPLv2+ URL: http://web.maths.unsw.edu.au/~davidharvey/code/zn_poly/ Source0: http://web.maths.unsw.edu.au/~davidharvey/code/zn_poly/releases/%{name}-%{version}.tar.gz Patch0: %{name}-%{version}-aix.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root BuildRequires: python >= 2.6.2 BuildRequires: gmp-devel >= 4.3.2-2 Requires: gmp >= 4.3.2-2 %description zn_poly is a C library for polynomial arithmetic in Z/nZ[x], where n is any modulus that fits into an unsigned long. The library is available as 32-bit and 64-bit. %package devel Summary: Development files for %{name} Group: Development/Libraries Requires: %{name} = %{version}-%{release} Requires: gmp-devel >= 4.3.2-2 %description devel zn_poly is a C library for polynomial arithmetic in Z/nZ[x], where n is any modulus that fits into an unsigned long. This package contains the development files. 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 "xlc_r -q64" or "gcc -maix64". %prep %setup -q %patch0 mkdir ../32bit mv * ../32bit mv ../32bit . mkdir 64bit cd 32bit && tar cf - . | (cd ../64bit ; tar xpf -) %build export CC="xlc_r" cd 64bit # first build the 64-bit version export OBJECT_MODE=64 ./configure \ --prefix=%{_prefix} \ --gmp-prefix=%{_prefix} \ --ntl-prefix=%{_prefix} \ --flint-prefix=%{_prefix} make %{?_smp_mflags} CC="${CC}" CreateExportList -X64 %{name}.exp lib%{name}.a ${CC} -qmkshrobj lib%{name}.a -o shr64.o -bE:%{name}.exp -bernotok -L/opt/freeware/lib -lgmp cd ../32bit # now build the 32-bit version export OBJECT_MODE=32 ./configure \ --prefix=%{_prefix} \ --gmp-prefix=%{_prefix} \ --ntl-prefix=%{_prefix} \ --flint-prefix=%{_prefix} make %{?_smp_mflags} CC="${CC}" CreateExportList -X32 %{name}.exp lib%{name}.a ${CC} -qmkshrobj lib%{name}.a -o shr32.o -bE:%{name}.exp -bernotok -L/opt/freeware/lib -lgmp # create shared library /usr/bin/rm -f lib%{name}.a /usr/bin/ar -X32 -rv lib%{name}.a shr32.o /usr/bin/ar -X64 -q lib%{name}.a ../64bit/shr64.o %install [ "${RPM_BUILD_ROOT}" != "/" ] && rm -rf ${RPM_BUILD_ROOT} # install manually, because makefile does not honor DESTDIR cd 32bit mkdir -p ${RPM_BUILD_ROOT}%{_includedir}/%{name} cp -pr include/*.h ${RPM_BUILD_ROOT}%{_includedir}/%{name}/ mkdir -p ${RPM_BUILD_ROOT}%{_libdir} cp -pr libzn_poly.a ${RPM_BUILD_ROOT}%{_libdir}/ ( 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/COPYING 32bit/gpl-?.0.txt %doc 32bit/demo/bernoulli/bernoulli.c 32bit/doc/REFERENCES %{_libdir}/*.a /usr/lib/*.a %files devel %defattr(-,root,system,-) %{_includedir}/* /usr/include/* %changelog * Tue Oct 09 2012 Michael Perzl - 0.9-1 - first version for AIX V5.1 and higher