%define sorev 5 Summary: General dimension convex hull programs Name: qhull Version: 2010.1 Release: 1 License: Qhull Group: System Environment/Libraries Source0: http://www.qhull.org/download/%{name}-%{version}-src.tgz Source1: http://www.qhull.org/download/%{name}-%{version}.md5sum URL: http://www.qhull.org BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root BuildRequires: tofrodos %define _libdir64 %{_prefix}/lib64 %description Qhull is a general dimension convex hull program that reads a set of points from stdin, and outputs the smallest convex set that contains the points to stdout. It also generates Delaunay triangulations, Voronoi diagrams, furthest-site Voronoi diagrams, and halfspace intersections about a point. The library is available as 32-bit and 64-bit. %package devel Group: Development/Libraries Summary: Development files for %{name} Requires: %{name} = %{version}-%{release} %description devel Qhull is a general dimension convex hull program that reads a set of points from stdin, and outputs the smallest convex set that contains the points to stdout. It also generates Delaunay triangulations, Voronoi diagrams, furthest-site Voronoi diagrams, and halfspace intersections about a point. 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 -q64" or "gcc -maix64". %prep %setup -q find . -exec fromdos {} \; mkdir ../32bit mv * ../32bit mv ../32bit . mkdir 64bit cp -r 32bit/* 64bit/ %build export CC="xlc_r" export LDFLAGS="-L/opt/freeware/lib -Wl,-blibpath:/opt/freeware/lib:/usr/lib:/lib -Wl,-bmaxdata:0x80000000" cd 64bit/src # first build the 64-bit version export OBJECT_MODE=64 make CC="${CC}" CCOPTS1="${CFLAGS}" lib%{name}.a # create shared object CreateExportList -X64 %{name}.exp lib%{name}.a ${CC} -qmkshrobj lib%{name}.a -o lib%{name}.so.%{sorev} -bE:%{name}.exp -bernotok -lm rm -f lib%{name}.a %{name}.exp # build shared library /usr/bin/ar -rv lib%{name}.a lib%{name}.so.%{sorev} ln -s src/lib%{name}.a .. # finish compile step make CC="${CC}" CCOPTS1="${CFLAGS}" CCOPTS2="${LDFLAGS}" cd ../../32bit/src # now build the 32-bit version export OBJECT_MODE=32 make CC="${CC}" CCOPTS1="${CFLAGS}" lib%{name}.a CreateExportList -X32 %{name}.exp lib%{name}.a ${CC} -qmkshrobj lib%{name}.a -o lib%{name}.so.%{sorev} -bE:%{name}.exp -bernotok -lm rm -f lib%{name}.a %{name}.exp # build shared library /usr/bin/ar -rv lib%{name}.a lib%{name}.so.%{sorev} ln -s src/lib%{name}.a .. # finish compile step make CC="${CC}" CCOPTS1="${CFLAGS}" CCOPTS2="${LDFLAGS}" %install [ "${RPM_BUILD_ROOT}" != "/" ] && rm -rf ${RPM_BUILD_ROOT} mkdir -p ${RPM_BUILD_ROOT}%{_bindir} mkdir -p ${RPM_BUILD_ROOT}%{_mandir}/man1 cd 64bit/src make install BINDIR=${RPM_BUILD_ROOT}%{_bindir} MANDIR=${RPM_BUILD_ROOT}%{_mandir}/man1 ( cd ${RPM_BUILD_ROOT}%{_bindir} for f in * ; do mv -f ${f} ${f}_64 done ) cd ../../32bit/src make install BINDIR=${RPM_BUILD_ROOT}%{_bindir} MANDIR=${RPM_BUILD_ROOT}%{_mandir} cd ../.. /usr/bin/strip -X32_64 ${RPM_BUILD_ROOT}%{_bindir}/* || : # install libraries mkdir -p ${RPM_BUILD_ROOT}%{_libdir} mkdir -p ${RPM_BUILD_ROOT}%{_libdir64} cp 32bit/src/lib%{name}.so.%{sorev} ${RPM_BUILD_ROOT}%{_libdir}/ cp 64bit/src/lib%{name}.so.%{sorev} ${RPM_BUILD_ROOT}%{_libdir64}/ /usr/bin/ar -X32 -rv ${RPM_BUILD_ROOT}%{_libdir}/lib%{name}.a 32bit/src/lib%{name}.so.%{sorev} /usr/bin/ar -X64 -q ${RPM_BUILD_ROOT}%{_libdir}/lib%{name}.a 64bit/src/lib%{name}.so.%{sorev} # install header files mkdir -p ${RPM_BUILD_ROOT}%{_includedir}/%{name} cp 32bit/src/*.h ${RPM_BUILD_ROOT}%{_includedir}/%{name}/ chmod 0644 ${RPM_BUILD_ROOT}%{_includedir}/%{name}/* # setup examples directory cd 32bit mv -f eg examples cp src/user_eg*.c examples/ cp cpp/qhull_interface.cpp examples/ rm -f examples/qhull-zip.sh ( cd ${RPM_BUILD_ROOT} for dir in bin include lib lib64 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/*.txt 32bit/examples 32bit/html %{_bindir}/* %{_libdir}/*.a %{_libdir}/*.so* %{_libdir64}/*.so* %{_mandir}/man1/* /usr/bin/* /usr/lib/*.a /usr/lib/*.so* /usr/lib64/*.so* %files devel %defattr(-,root,system) %{_includedir}/* /usr/include/* %changelog * Wed Feb 16 2011 Michael Perzl - 2010.1-1 - updated to version 2010.1 * Mon Nov 22 2010 Michael Perzl - 2009.1.1-1 - updated to version 2009.1.1, added RTL-style shared libraries * Tue Sep 29 2009 Michael Perzl - 2003.1-1 - first version for AIX V5.1 and higher