Name: cfitsio Version: 3.410 Release: 1 Summary: Library for manipulating FITS data files Group: Development/Libraries License: GPLv2+ URL: http://heasarc.gsfc.nasa.gov/docs/software/fitsio/fitsio.html Source0: ftp://heasarc.gsfc.nasa.gov/software/fitsio/c/cfitsio3410.tar.gz BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root Patch0: %{name}-%{version}-aix.patch %define _libdir64 %{_prefix}/lib64 %description CFITSIO is a library of C and FORTRAN subroutines for reading and writing data files in FITS (Flexible Image Transport System) data format. CFITSIO simplifies the task of writing software that deals with FITS files by providing an easy to use set of high-level routines that insulate the programmer from the internal complexities of the FITS file format. At the same time, CFITSIO provides many advanced features that have made it the most widely used FITS file programming interface in the astronomical community. The library is available as 32-bit and 64-bit. %package devel Group: Development/Libraries Summary: Headers required when building programs against cfitsio Requires: %{name} = %{version}-%{release} Requires: pkg-config %description devel Headers required when building a program against the cfitsio library. 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". %package docs Summary: Documentation for cfitsio Group: Development/Libraries %description docs Stand-alone documentation for cfitsio. %package -n fpack Summary: FPACK FITS image compression and decompression utilites Group: Applications/Engineering Requires: %{name} = %{version}-%{release} %description -n fpack fpack optimally compresses FITS format images and funpack restores them to the original state. * Integer format images are losslessly compressed using the Rice compression algorithm. * typically 30% better compression than GZIP * about 3 times faster compression speed than GZIP * about the same uncompression speed as GUNZIP * Floating-point format images are compressed with a lossy algorithm * truncates the image pixel noise by a user-specified amount to produce much higher compression than by lossless techniques * the precision of scientific measurements in the compressed image (relative to those in the original image) depends on the selected amount of compression %prep %setup -q -n cfitsio %patch0 mkdir ../32bit mv * ../32bit mv ../32bit . mkdir 64bit cd 32bit && tar cf - . | (cd ../64bit ; tar xpf -) %build export CC="xlc_r" # force to use XL Fortran Compiler export FC="xlf95_r" cd 64bit # first build the 64-bit version export OBJECT_MODE=64 export LDFLAGS="-L/opt/freeware/lib64 -L/opt/freeware/lib -Wl,-blibpath:/opt/freeware/lib64:/opt/freeware/lib:/usr/lib:/lib -Wl,-bmaxdata:0x80000000" ./configure \ --prefix=%{_prefix} \ --libdir=%{_libdir64} \ --enable-reentrant make %{?_smp_mflags} CreateExportList -X64 %{name}.exp lib%{name}.a ${CC} -qmkshrobj lib%{name}.a -o shr64.o -bE:%{name}.exp -bernotok -lm # create shared library /usr/bin/rm -f lib%{name}.a /usr/bin/ar -X64 -q lib%{name}.a shr64.o make fpack %{?_smp_mflags} make funpack %{?_smp_mflags} # manually fix pkgconfig .pc file (BZ 436539, BZ 618291) sed 's|/usr/include|%{_includedir}/%{name}|' %{name}.pc > %{name}.pc.new mv %{name}.pc.new %{name}.pc cd ../32bit # now build the 32-bit version export OBJECT_MODE=32 export LDFLAGS="-L/opt/freeware/lib -Wl,-blibpath:/opt/freeware/lib:/usr/lib:/lib -Wl,-bmaxdata:0x80000000" ./configure \ --prefix=%{_prefix} \ --enable-reentrant make %{?_smp_mflags} CreateExportList -X32 %{name}.exp lib%{name}.a ${CC} -qmkshrobj lib%{name}.a -o shr32.o -bE:%{name}.exp -bernotok -lm # 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 make fpack %{?_smp_mflags} make funpack %{?_smp_mflags} # manually fix pkgconfig .pc file (BZ 436539, BZ 618291) sed 's|/usr/include|%{_includedir}/%{name}|' %{name}.pc > %{name}.pc.new mv %{name}.pc.new %{name}.pc %install [ "${RPM_BUILD_ROOT}" != "/" ] && rm -rf ${RPM_BUILD_ROOT} mkdir -p ${RPM_BUILD_ROOT}%{_bindir} cd 64bit make DESTDIR=${RPM_BUILD_ROOT} install cp f*pack ${RPM_BUILD_ROOT}%{_bindir}/ ( cd ${RPM_BUILD_ROOT}%{_bindir} for f in * ; do mv -f ${f} ${f}_64 done ) cd ../32bit make DESTDIR=${RPM_BUILD_ROOT} install cp f*pack ${RPM_BUILD_ROOT}%{_bindir}/ chmod 0755 ${RPM_BUILD_ROOT}%{_bindir}/* /usr/bin/strip -X32_64 ${RPM_BUILD_ROOT}%{_bindir}/* mkdir -p ${RPM_BUILD_ROOT}%{_includedir}/%{name} mv ${RPM_BUILD_ROOT}%{_includedir}/*.h ${RPM_BUILD_ROOT}%{_includedir}/%{name}/ ( 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/README 32bit/License.txt 32bit/docs/changes.txt %{_libdir}/*.a /usr/lib/*.a %files devel %defattr(-,root,system,-) %{_includedir}/%{name} %{_libdir}/pkgconfig/*.pc %{_libdir64}/pkgconfig/*.pc /usr/include/%{name} %files docs %defattr(-,root,system,-) %doc 32bit/License.txt %doc 32bit/docs/cfitsio.doc 32bit/docs/cfitsio.pdf 32bit/docs/cfitsio.ps %doc 32bit/docs/fitsio.doc 32bit/docs/fitsio.pdf 32bit/docs/fitsio.ps %files -n fpack %defattr(-,root,system,-) %doc 32bit/docs/fpackguide.pdf 32bit/License.txt %{_bindir}/f*pack* /usr/bin/f*pack* %changelog * Fri Dec 09 2016 Michael Perzl - 3.410-1 - updated to version 3.410 * Mon May 02 2016 Michael Perzl - 3.390-1 - updated to version 3.390 * Mon May 02 2016 Michael Perzl - 3.380-1 - updated to version 3.380 * Mon Jun 23 2014 Michael Perzl - 3.370-1 - updated to version 3.370 * Sat Jan 04 2014 Michael Perzl - 3.360-1 - updated to version 3.360 * Wed Jul 17 2013 Michael Perzl - 3.350-1 - updated to version 3.350 * Mon Apr 15 2013 Michael Perzl - 3.340-1 - updated to version 3.340 * Mon Apr 15 2013 Michael Perzl - 3.330-1 - updated to version 3.330 * Sat Jul 28 2012 Michael Perzl - 3.310-1 - updated to version 3.310 * Thu Apr 19 2012 Michael Perzl - 3.300-1 - updated to version 3.300 * Thu Dec 15 2011 Michael Perzl - 3.290-1 - updated to version 3.290 * Mon Nov 21 2011 Michael Perzl - 3.280-1 - updated to version 3.280 * Fri Mar 11 2011 Michael Perzl - 3.270-1 - first version for AIX V5.1 and higher