From f6008742abbf10c4c1d4b1e4103183dbe21262ab Mon Sep 17 00:00:00 2001 From: Sergio Pascual Date: Thu, 4 Jul 2013 12:18:05 +0200 Subject: [PATCH] New upstream source (3.350) - Upstream provides soname - Removed namespaced includedir (not in upstream) - pkgconfig file rearrangement now a patch instead of using sed --- .gitignore | 1 + cfitsio-noversioncheck.patch | 10 +++---- cfitsio-zlib.patch | 32 +++++++++++----------- cfitsio.patch | 22 ---------------- cfitsio.spec | 51 ++++++++++++++++++------------------ sources | 2 +- 6 files changed, 48 insertions(+), 70 deletions(-) delete mode 100644 cfitsio.patch diff --git a/.gitignore b/.gitignore index 8d1723f..e2308b6 100644 --- a/.gitignore +++ b/.gitignore @@ -6,3 +6,4 @@ cfitsio3250.tar.gz /cfitsio3310.tar.gz /cfitsio3330.tar.gz /cfitsio3340.tar.gz +/cfitsio3350.tar.gz diff --git a/cfitsio-noversioncheck.patch b/cfitsio-noversioncheck.patch index 23779c4..e92bfbb 100644 --- a/cfitsio-noversioncheck.patch +++ b/cfitsio-noversioncheck.patch @@ -1,12 +1,12 @@ diff -ur cfitsio/longnam.h cfitsio.new/longnam.h ---- cfitsio/longnam.h 2011-05-19 22:52:26.000000000 +0200 -+++ cfitsio.new/longnam.h 2012-07-06 00:03:02.512327034 +0200 +--- cfitsio/longnam.h 2013-04-04 21:45:41.000000000 +0200 ++++ cfitsio.new/longnam.h 2013-07-04 11:05:16.423095453 +0200 @@ -19,7 +19,8 @@ - file that was used to build the CFITSIO library is the same version + that was used to build the CFITSIO library is compatible with the version as included when compiling the application program */ --#define fits_open_file(A, B, C, D) ffopentest( CFITSIO_VERSION, A, B, C, D) -+//#define fits_open_file(A, B, C, D) ffopentest( CFITSIO_VERSION, A, B, C, D) +-#define fits_open_file(A, B, C, D) ffopentest( CFITSIO_SONAME, A, B, C, D) ++/*#define fits_open_file(A, B, C, D) ffopentest( CFITSIO_SONAME, A, B, C, D)*/ +#define fits_open_file ffopen #define fits_open_data ffdopn diff --git a/cfitsio-zlib.patch b/cfitsio-zlib.patch index 0a68ff0..47a804e 100644 --- a/cfitsio-zlib.patch +++ b/cfitsio-zlib.patch @@ -1,40 +1,38 @@ -diff -ur cfitsio/Makefile.in cfitsio-zlib/Makefile.in ---- cfitsio/Makefile.in 2012-04-24 14:19:09.307351928 +0200 -+++ cfitsio-zlib/Makefile.in 2012-04-24 14:19:40.906582888 +0200 -@@ -52,9 +52,7 @@ - putcolj.c putcolk.c putcoluk.c putcoll.c putcols.c putcolsb.c \ +diff -ur cfitsio/Makefile.in cfitsio.new/Makefile.in +--- cfitsio/Makefile.in 2013-04-08 20:11:42.000000000 +0200 ++++ cfitsio.new/Makefile.in 2013-07-04 00:03:13.314991071 +0200 +@@ -61,8 +61,6 @@ putcolu.c putcolui.c putcoluj.c putkey.c region.c scalnull.c \ swapproc.c wcssub.c wcsutil.c imcompress.c quantize.c ricecomp.c \ -- pliocomp.c fits_hcompress.c fits_hdecompress.c zuncompress.c zcompress.c \ + pliocomp.c fits_hcompress.c fits_hdecompress.c zuncompress.c zcompress.c \ - adler32.c crc32.c inffast.c inftrees.c trees.c zutil.c \ - deflate.c infback.c inflate.c uncompr.c \ -+ pliocomp.c fits_hcompress.c fits_hdecompress.c zuncompress.c zcompress.c SOURCES = ${CORE_SOURCES} @F77_WRAPPERS@ -@@ -87,7 +85,7 @@ +@@ -95,7 +93,7 @@ shared: libcfitsio${SHLIB_SUFFIX} libcfitsio${SHLIB_SUFFIX}: ${OBJECTS} -- ${SHLIB_LD} ${LDFLAGS} -o $@ ${OBJECTS} -lm ${LIBS} -+ ${SHLIB_LD} ${LDFLAGS} -o $@ ${OBJECTS} -lm ${LIBS} -lz - - install: libcfitsio.a $(INSTALL_DIRS) - @if [ -f libcfitsio.a ]; then \ -@@ -109,13 +107,13 @@ +- ${SHLIB_LD} ${LDFLAGS} -o ${CFITSIO_SHLIB} ${OBJECTS} -lm ${LIBS} ++ ${SHLIB_LD} ${LDFLAGS} -o ${CFITSIO_SHLIB} ${OBJECTS} -lm -lz ${LIBS} + @if [ "x${CFITSIO_SHLIB_SONAME}" != x ]; then \ + ln -sf ${CFITSIO_SHLIB} ${CFITSIO_SHLIB_SONAME}; \ + ln -sf ${CFITSIO_SHLIB_SONAME} $@; \ +@@ -116,13 +114,13 @@ ${CC} $(CFLAGS) $(DEFS) -o smem smem.o -L. -lcfitsio -lm testprog: testprog.o libcfitsio.a ${OBJECTS} - ${CC} $(CFLAGS) $(DEFS) -o testprog testprog.o -L. -lcfitsio -lm ${LIBS} -+ ${CC} $(CFLAGS) $(DEFS) -o testprog testprog.o -L. -lcfitsio -lm ${LIBS} -lz ++ ${CC} $(CFLAGS) $(DEFS) -o testprog testprog.o -L. -lcfitsio -lz -lm ${LIBS} fpack: fpack.o fpackutil.o libcfitsio.a ${OBJECTS} - ${CC} $(CFLAGS) $(DEFS) -o fpack fpack.o fpackutil.o libcfitsio.a -lm ${LIBS} -+ ${CC} $(CFLAGS) $(DEFS) -o fpack fpack.o fpackutil.o -L. -lcfitsio -lm ${LIBS} -lz ++ ${CC} $(CFLAGS) $(DEFS) -o fpack fpack.o fpackutil.o -L. -lcfitsio -lz -lm ${LIBS} funpack: funpack.o fpackutil.o libcfitsio.a ${OBJECTS} - ${CC} $(CFLAGS) $(DEFS) -o funpack funpack.o fpackutil.o libcfitsio.a -lm ${LIBS} -+ ${CC} $(CFLAGS) $(DEFS) -o funpack funpack.o fpackutil.o -L. -lcfitsio -lm ${LIBS} -lz ++ ${CC} $(CFLAGS) $(DEFS) -o funpack funpack.o fpackutil.o -L. -lcfitsio -lz -lm ${LIBS} fitscopy: fitscopy.o libcfitsio.a ${OBJECTS} ${CC} $(CFLAGS) $(DEFS) -o fitscopy fitscopy.o -L. -lcfitsio -lm ${LIBS} diff --git a/cfitsio.patch b/cfitsio.patch deleted file mode 100644 index f47ec0e..0000000 --- a/cfitsio.patch +++ /dev/null @@ -1,22 +0,0 @@ -diff -ur cfitsio/configure cfitsio-fixed/configure ---- cfitsio/configure 2012-04-13 21:16:16.000000000 +0200 -+++ cfitsio-fixed/configure 2012-08-30 08:25:25.681081693 +0200 -@@ -3908,7 +3908,8 @@ - SHLIB_SUFFIX=".sl" - ;; - lnx) -- SHLIB_LD=":" -+ SHLIB_LD="cc -shared -Wl,-soname,libcfitsio.so.0" -+ SHLIB_SUFFIX=".so.0" - ;; - osf) - SHLIB_LD="ld -shared -expect_unresolved '*'" -@@ -3929,7 +3930,7 @@ - # Darwin uses gcc (=cc), but needs different flags (see above) - # if test "x$GCC" = xyes; then - if test "x$GCC" = xyes && test "x$EXT" != xdarwin && test "x$EXT" != xcygwin; then -- SHLIB_LD="$CC -shared" -+ SHLIB_LD="$CC -shared -Wl,-soname,libcfitsio.so.0" - lhea_shlib_cflags='-fPIC' - fi - if test "x$lhea_shlib_cflags" != x; then diff --git a/cfitsio.spec b/cfitsio.spec index 863e415..8926d46 100644 --- a/cfitsio.spec +++ b/cfitsio.spec @@ -1,13 +1,17 @@ Name: cfitsio -Version: 3.340 +Version: 3.350 Release: 1%{?dist} Summary: Library for manipulating FITS data files Group: Development/Libraries License: MIT URL: http://heasarc.gsfc.nasa.gov/fitsio/ -Source0: ftp://heasarc.gsfc.nasa.gov/software/fitsio/c/cfitsio3340.tar.gz +Source0: ftp://heasarc.gsfc.nasa.gov/software/fitsio/c/cfitsio3350.tar.gz # Unbundles zlib Patch0: cfitsio-zlib.patch +# Remove soname version check +Patch1: cfitsio-noversioncheck.patch +# Some rearrangements in pkg-config file +Patch2: cfitsio-pkgconfig.patch BuildRequires: gcc-gfortran zlib-devel Requires(post): /sbin/ldconfig @@ -73,11 +77,8 @@ compression algorithm. %prep %setup -q -n cfitsio %patch0 -p1 -# Fixing cfitsio.pc.in -sed -e 's|includedir=@includedir@|includedir=@includedir@/cfitsio|' -i cfitsio.pc.in -sed -e 's|Libs: -L${libdir} -lcfitsio @LIBS@|Libs: -L${libdir} -lcfitsio|' -i cfitsio.pc.in -sed -e 's|Libs.private: -lm|Libs.private: @LIBS@ -lz -lm|' -i cfitsio.pc.in -sed -e 's|Cflags: -I${includedir}|Cflags: -D_REENTRANT -I${includedir}|' -i cfitsio.pc.in +%patch1 -p1 +%patch2 -p1 # remove bundled zlib rm adler32.c crc32.c deflate.c infback.c inffast.c inflate.c inflate.h \ @@ -85,12 +86,10 @@ rm adler32.c crc32.c deflate.c infback.c inffast.c inflate.c inflate.h \ zutil.c zutil.h %build -FC=f95 -export FC +export FC=f95 export CC=gcc # fixes -O*, -g %configure --enable-reentrant -make shared %{?_smp_mflags} SHLIB_LD="gcc -shared -Wl,-soname,libcfitsio-%{version}.so.0" SHLIB_SUFFIX="-%{version}.so.0" -ln -s libcfitsio-%{version}.so.0 libcfitsio.so +make shared %{?_smp_mflags} make fpack %{?_smp_mflags} make funpack %{?_smp_mflags} unset FC @@ -102,21 +101,17 @@ cmp -s testprog.lis testprog.out cmp -s testprog.fit testprog.std %install -rm -rf %{buildroot} -mkdir -p %{buildroot} +mkdir -p %{buildroot}%{_bindir} mkdir -p %{buildroot}%{_libdir} -mkdir -p %{buildroot}%{_includedir}/%{name} -make LIBDIR=%{_lib} INCLUDEDIR=include/%{name} \ +mkdir -p %{buildroot}%{_includedir} +make LIBDIR=%{_libdir} INCLUDEDIR=%{_includedir} \ CFITSIO_LIB=%{buildroot}%{_libdir} \ - CFITSIO_INCLUDE=%{buildroot}%{_includedir}/%{name} \ - SHLIB_SUFFIX="-%{version}.so.0" \ + CFITSIO_INCLUDE=%{buildroot}%{_includedir} \ install -chmod 755 %{buildroot}%{_libdir}/libcfitsio-%{version}.so.0 -pushd %{buildroot}%{_libdir} -ln -s libcfitsio-%{version}.so.0 libcfitsio.so -popd -mkdir %{buildroot}%{_bindir} -cp -p f{,un}pack %{buildroot}%{_bindir}/ +# make is not installing properly the shared libs +cp -d libcfitsio.so.* %{buildroot}%{_libdir} +chmod 755 %{buildroot}%{_libdir}/libcfitsio.so.* +cp -p f{,un}pack %{buildroot}%{_bindir} chmod 755 %{buildroot}%{_bindir}/f{,un}pack %post -p /sbin/ldconfig @@ -125,10 +120,10 @@ chmod 755 %{buildroot}%{_bindir}/f{,un}pack %files %doc README License.txt changes.txt -%{_libdir}/libcfitsio-%{version}.so.0 +%{_libdir}/libcfitsio.so.* %files devel -%{_includedir}/%{name} +%{_includedir}/*.h %{_libdir}/libcfitsio.so %{_libdir}/pkgconfig/cfitsio.pc @@ -145,6 +140,12 @@ chmod 755 %{buildroot}%{_bindir}/f{,un}pack %{_bindir}/funpack %changelog +* Wed Jul 03 2013 Sergio Pascual - 3.350-1 +- New upstream source (3.350) +- Upstream provides soname +- Removed namespaced includedir (not in upstream) +- pkgconfig file rearrangement now a patch instead of using sed + * Thu Mar 21 2013 Sergio Pascual - 3.340-1 - New upstream source diff --git a/sources b/sources index 7329c79..78de60a 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -12b19a19cb4989dd58b8cd163ca6c4e3 cfitsio3340.tar.gz +0bc79cd8eeabbcd26828f64269e39e63 cfitsio3350.tar.gz