diff --git a/cfitsio-pkgconfig-reentrant.patch b/cfitsio-pkgconfig-reentrant.patch new file mode 100644 index 0000000..02d57f4 --- /dev/null +++ b/cfitsio-pkgconfig-reentrant.patch @@ -0,0 +1,9 @@ +diff -ur cfitsio/cfitsio.pc.in cfitsio.new/cfitsio.pc.in +--- cfitsio/cfitsio.pc.in 2011-10-29 16:54:43.081132723 +0200 ++++ cfitsio.new/cfitsio.pc.in 2011-10-29 16:56:49.933619756 +0200 +@@ -8,4 +8,4 @@ + Version: 3.240 + Libs: -L${libdir} -lcfitsio @LIBS@ + Libs.private: -lm +-Cflags: -I${includedir} ++Cflags: -D_REENTRANT -I${includedir} diff --git a/cfitsio-s390.patch b/cfitsio-s390.patch new file mode 100644 index 0000000..bf7b52d --- /dev/null +++ b/cfitsio-s390.patch @@ -0,0 +1,18 @@ +diff -urN cfitsio/fitsio2.h cfitsio_new/fitsio2.h +--- cfitsio/fitsio2.h 2010-01-26 18:40:25.000000000 +0100 ++++ cfitsio_new/fitsio2.h 2010-06-30 17:24:59.000000000 +0200 +@@ -85,6 +85,14 @@ + #define MACHINE NATIVE + #define LONGSIZE 64 + ++#elif defined(__s390x__) ++#define BYTESWAPPED FALSE ++#define LONGSIZE 64 ++ ++#elif defined(__s390__) ++#define BYTESWAPPED FALSE ++#define LONGSIZE 32 ++ + #elif defined(__ia64__) || defined(__x86_64__) + /* Intel itanium 64-bit PC, or AMD opteron 64-bit PC */ + #define BYTESWAPPED TRUE diff --git a/cfitsio.spec b/cfitsio.spec index d387966..5bf402f 100644 --- a/cfitsio.spec +++ b/cfitsio.spec @@ -1,6 +1,6 @@ Name: cfitsio Version: 3.240 -Release: 2%{?dist} +Release: 3%{?dist} Summary: Library for manipulating FITS data files Group: Development/Libraries @@ -9,6 +9,9 @@ URL: http://heasarc.gsfc.nasa.gov/docs/software/fitsio/fitsio.html Source0: ftp://heasarc.gsfc.nasa.gov/software/fitsio/c/cfitsio3240.tar.gz Patch0: cfitsio.patch Patch1: cfitsio-pkgconfig.patch +Patch2: cfitsio-s390.patch +Patch3: makefile.patch +Patch4: cfitsio-pkgconfig-reentrant.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRequires: gcc-gfortran @@ -53,12 +56,15 @@ Stand-alone documentation for cfitsio. %setup -q -n cfitsio %patch0 -p1 %patch1 -p1 +%patch2 -p1 +%patch3 -p1 +%patch4 -p1 %build FC=f95 export FC export CC=gcc # fixes -O*, -g -%configure +%configure --enable-reentrant make shared %{?_smp_mflags} unset FC # Manually fix pkgconfig .pc file (BZ 436539) @@ -113,6 +119,10 @@ rm -rf %{buildroot} %doc fitsio.doc fitsio.ps cfitsio.doc cfitsio.ps %changelog +* Sun Dec 04 2011 Sergio Pascual - 3.240-3 +- Enable multithreading support +- Fix pkgconfig version number. + * Sun Feb 21 2010 Matthew Truch - 3.240-2 - Fix pkgconfig version number. diff --git a/makefile.patch b/makefile.patch new file mode 100644 index 0000000..d630e6c --- /dev/null +++ b/makefile.patch @@ -0,0 +1,12 @@ +diff -ur cfitsio/Makefile.in cfitsio.new/Makefile.in +--- cfitsio/Makefile.in 2011-10-29 16:54:43.077132582 +0200 ++++ cfitsio.new/Makefile.in 2011-10-29 16:55:38.648098260 +0200 +@@ -90,7 +90,7 @@ + shared: libcfitsio${SHLIB_SUFFIX} + + libcfitsio${SHLIB_SUFFIX}: ${OBJECTS} +- ${SHLIB_LD} ${LDFLAGS} -o $@ ${OBJECTS} ++ ${SHLIB_LD} ${LDFLAGS} ${LIBS} -lm -o $@ ${OBJECTS} + + install: libcfitsio.a $(INSTALL_DIRS) + @if [ -f libcfitsio.a ]; then \