From f94c63b2bf95e459b89f4c49e46f5256147da9a6 Mon Sep 17 00:00:00 2001 From: Mario Ceresa Date: Mar 19 2011 19:29:30 +0000 Subject: Update to new upstream releasen --- diff --git a/gdcm-2.0.16-remove-stdafx.patch b/gdcm-2.0.16-remove-stdafx.patch index 7b85343..66267e5 100644 --- a/gdcm-2.0.16-remove-stdafx.patch +++ b/gdcm-2.0.16-remove-stdafx.patch @@ -1,5 +1,5 @@ diff --git a/Source/MediaStorageAndFileFormat/gdcmJPEGLSCodec.cxx b/Source/MediaStorageAndFileFormat/gdcmJPEGLSCodec.cxx -index a44a2b1..d51832f 100644 +index aae07ed..3f1fa8b 100644 --- a/Source/MediaStorageAndFileFormat/gdcmJPEGLSCodec.cxx +++ b/Source/MediaStorageAndFileFormat/gdcmJPEGLSCodec.cxx @@ -19,7 +19,7 @@ diff --git a/gdcm-2.0.17-install2libarch.patch b/gdcm-2.0.17-install2libarch.patch new file mode 100644 index 0000000..d1680d6 --- /dev/null +++ b/gdcm-2.0.17-install2libarch.patch @@ -0,0 +1,13 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index c920c15..75bc60f 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -207,7 +207,7 @@ ENDIF(NOT GDCM_INSTALL_BIN_DIR) + + IF(NOT GDCM_INSTALL_LIB_DIR) + #SET(GDCM_INSTALL_LIB_DIR "lib/${PROJECT_NAME}") +- SET(GDCM_INSTALL_LIB_DIR "lib") ++ SET(GDCM_INSTALL_LIB_DIR "lib${LIB_SUFFIX}") + ENDIF(NOT GDCM_INSTALL_LIB_DIR) + + IF(NOT GDCM_INSTALL_DATA_DIR) diff --git a/gdcm-2.0.17-no_versioned_dir.patch b/gdcm-2.0.17-no_versioned_dir.patch new file mode 100644 index 0000000..8b825bb --- /dev/null +++ b/gdcm-2.0.17-no_versioned_dir.patch @@ -0,0 +1,13 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 29f5802..93a2a24 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -199,7 +199,7 @@ ENDIF(MSVC) + # Install directories + + STRING(TOLOWER ${PROJECT_NAME} projectname) +-SET(subdir "${projectname}-${GDCM_MAJOR_VERSION}.${GDCM_MINOR_VERSION}") ++SET(subdir "${projectname}") + + IF(NOT GDCM_INSTALL_BIN_DIR) + SET(GDCM_INSTALL_BIN_DIR "bin") diff --git a/gdcm-2.0.17-use_openjpeg_1x.patch b/gdcm-2.0.17-use_openjpeg_1x.patch new file mode 100644 index 0000000..7b7b4bd --- /dev/null +++ b/gdcm-2.0.17-use_openjpeg_1x.patch @@ -0,0 +1,83 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 93a2a24..7076a45 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -305,7 +305,7 @@ IF(GDCM_USE_SYSTEM_OPENJPEG) + # For some reason I cannot specify the version I want. + # FIND_PACKAGE(OpenJPEG 2.0 REQUIRED) + # oh well we should handle both 1.0 and 2.0 anyway... +- #FIND_PACKAGE(OpenJPEG REQUIRED) ++ FIND_PACKAGE(OpenJPEG REQUIRED) + SET(GDCM_OPENJPEG_LIBRARIES ${OPENJPEG_LIBRARIES}) + ELSE(GDCM_USE_SYSTEM_OPENJPEG) + SET(GDCM_OPENJPEG_LIBRARIES gdcmopenjpeg) +@@ -758,6 +758,11 @@ IF(EXISTS "${CMAKE_ROOT}/Modules/CPack.cmake") + set(CPACK_COMPONENT_GROUP_DEVELOPMENT_DESCRIPTION + "All of the tools you'll ever need to develop software using GDCM") + ++ if(CMAKE_VERSION VERSION_EQUAL 2.8.3) ++ # The following is needed for CMake 2.8.3 and above to preserve backward compat ++ set(CPACK_MONOLITHIC_INSTALL 1) ++ endif(CMAKE_VERSION VERSION_EQUAL 2.8.3) ++ + # It doesn't make sense to install the headers without the libraries + # (because you could never use the headers!), so make the headers component + # depend on the libraries component. +diff --git a/Source/Common/gdcmConfigure.h.in b/Source/Common/gdcmConfigure.h.in +index a203235..534845a 100644 +--- a/Source/Common/gdcmConfigure.h.in ++++ b/Source/Common/gdcmConfigure.h.in +@@ -63,8 +63,7 @@ + #ifndef GDCM_USE_SYSTEM_OPENJPEG + #define OPENJPEG_MAJOR_VERSION 2 + #else +-//#define OPENJPEG_MAJOR_VERSION @OPENJPEG_MAJOR_VERSION@ +-#define OPENJPEG_MAJOR_VERSION 2 ++#define OPENJPEG_MAJOR_VERSION @OPENJPEG_MAJOR_VERSION@ + #endif //GDCM_USE_SYSTEM_OPENJPEG + + #ifndef OPENJPEG_MAJOR_VERSION +diff --git a/Source/Common/gdcmCryptographicMessageSyntax.cxx b/Source/Common/gdcmCryptographicMessageSyntax.cxx +index ec48f40..054d72a 100644 +--- a/Source/Common/gdcmCryptographicMessageSyntax.cxx ++++ b/Source/Common/gdcmCryptographicMessageSyntax.cxx +@@ -102,8 +102,8 @@ public: + ::X509 *ret = sk_X509_value(recips, i); + return ret; + } +- void SetPrivateKey(::EVP_PKEY* pkey) { +- this->pkey = pkey; ++ void SetPrivateKey(::EVP_PKEY* thepkey) { ++ this->pkey = thepkey; + } + ::EVP_PKEY* GetPrivateKey() const { + return pkey; +diff --git a/Source/MediaStorageAndFileFormat/gdcmJPEG2000Codec.cxx b/Source/MediaStorageAndFileFormat/gdcmJPEG2000Codec.cxx +index 4c6d95b..3b6c1b6 100644 +--- a/Source/MediaStorageAndFileFormat/gdcmJPEG2000Codec.cxx ++++ b/Source/MediaStorageAndFileFormat/gdcmJPEG2000Codec.cxx +@@ -446,6 +446,7 @@ bool JPEG2000Codec::Decode(std::istream &is, std::ostream &os) + return false; + } + ++ int reversible; + #if OPENJPEG_MAJOR_VERSION == 1 + /* catch events using our callbacks and give a local context */ + opj_set_event_mgr((opj_common_ptr)dinfo, &event_mgr, NULL); +@@ -484,7 +485,6 @@ bool JPEG2000Codec::Decode(std::istream &is, std::ostream &os) + /* setup the decoder decoding parameters using user parameters */ + opj_setup_decoder(dinfo, ¶meters); + bool bResult; +- int reversible; + OPJ_INT32 l_tile_x0,l_tile_y0; + OPJ_UINT32 l_tile_width,l_tile_height,l_nb_tiles_x,l_nb_tiles_y; + bResult = opj_read_header( +@@ -586,7 +586,7 @@ bool JPEG2000Codec::Decode(std::istream &is, std::ostream &os) + unsigned long len = Dimensions[0]*Dimensions[1] * (PF.GetBitsAllocated() / 8) * image->numcomps; + char *raw = new char[len]; + //assert( len == fsrc->len ); +- for (unsigned int compno = 0; compno < image->numcomps; compno++) ++ for (unsigned int compno = 0; compno < (unsigned int)image->numcomps; compno++) + { + opj_image_comp_t *comp = &image->comps[compno]; + diff --git a/gdcm-2.0.17-use_system_charls b/gdcm-2.0.17-use_system_charls new file mode 100644 index 0000000..cc4a0f4 --- /dev/null +++ b/gdcm-2.0.17-use_system_charls @@ -0,0 +1,102 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 75bc60f..29f5802 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -271,6 +271,12 @@ ENDIF(UNIX) + OPTION(GDCM_USE_SYSTEM_EXPAT "Use system expat" OFF) + OPTION(GDCM_USE_SYSTEM_LJPEG "Use system ljpeg (ijg lib)" OFF) + OPTION(GDCM_USE_SYSTEM_OPENJPEG "Use system openjpeg (1.x)" OFF) ++ ++IF(GDCM_USE_JPEGLS) ++ OPTION(GDCM_USE_SYSTEM_JPEGLS "Use system JPEGLS (CharLS)" OFF) ++ MARK_AS_ADVANCED(GDCM_USE_SYSTEM_JPEGLS) ++ENDIF(GDCM_USE_JPEGLS) ++ + MARK_AS_ADVANCED(GDCM_USE_SYSTEM_ZLIB GDCM_USE_SYSTEM_UUID GDCM_USE_SYSTEM_EXPAT GDCM_USE_SYSTEM_OPENSSL) + MARK_AS_ADVANCED(GDCM_USE_SYSTEM_OPENJPEG GDCM_USE_SYSTEM_LJPEG) + OPTION(GDCM_USE_SYSTEM_POPPLER "Use system poppler (pdf)" OFF) +@@ -305,6 +311,13 @@ ELSE(GDCM_USE_SYSTEM_OPENJPEG) + SET(GDCM_OPENJPEG_LIBRARIES gdcmopenjpeg) + ENDIF(GDCM_USE_SYSTEM_OPENJPEG) + ++IF(GDCM_USE_SYSTEM_JPEGLS) ++ FIND_PACKAGE(CharLS REQUIRED) ++ SET(GDCM_CHARLS_LIBRARIES ${CHARLS_LIBRARIES}) ++ELSE(GDCM_USE_SYSTEM_JPEGLS) ++ SET(GDCM_CHARLS_LIBRARIES gdcmcharls) ++ENDIF(GDCM_USE_SYSTEM_JPEGLS) ++ + # Very advanced user option: + # This will cause building of the broken JPEG library released by the Standford PVRG group: + OPTION(GDCM_USE_PVRG "Use pvrg lib, only turn it on if you know what you are doing." OFF) +diff --git a/Source/MediaStorageAndFileFormat/CMakeLists.txt b/Source/MediaStorageAndFileFormat/CMakeLists.txt +index 290a5b7..3eee74c 100644 +--- a/Source/MediaStorageAndFileFormat/CMakeLists.txt ++++ b/Source/MediaStorageAndFileFormat/CMakeLists.txt +@@ -141,7 +141,7 @@ ADD_LIBRARY(gdcmMSFF ${MSFF_SRCS}) + TARGET_LINK_LIBRARIES(gdcmMSFF gdcmIOD gdcmDSED gdcmDICT ${GDCM_LJPEG_LIBRARIES} ${GDCM_OPENJPEG_LIBRARIES}) + SET_TARGET_PROPERTIES(gdcmMSFF PROPERTIES ${GDCM_LIBRARY_PROPERTIES} LINK_INTERFACE_LIBRARIES "gdcmDSED;gdcmDICT;gdcmIOD") + IF(GDCM_USE_JPEGLS) +- TARGET_LINK_LIBRARIES(gdcmMSFF gdcmcharls) ++ TARGET_LINK_LIBRARIES(gdcmMSFF ${GDCM_CHARLS_LIBRARIES}) + ENDIF(GDCM_USE_JPEGLS) + + IF(CMAKE_COMPILER_IS_GNUCXX AND MINGW) +diff --git a/Source/MediaStorageAndFileFormat/gdcmJPEGLSCodec.cxx b/Source/MediaStorageAndFileFormat/gdcmJPEGLSCodec.cxx +index fda51bc..aae07ed 100644 +--- a/Source/MediaStorageAndFileFormat/gdcmJPEGLSCodec.cxx ++++ b/Source/MediaStorageAndFileFormat/gdcmJPEGLSCodec.cxx +@@ -18,6 +18,16 @@ + #include "gdcmDataElement.h" + + // CharLS includes ++#ifdef GDCM_USE_SYSTEM_EXPAT ++#include "CharLS/stdafx.h" // sigh... ++#include "CharLS/interface.h" ++#include "CharLS/util.h" ++#include "CharLS/defaulttraits.h" ++#include "CharLS/losslesstraits.h" ++#include "CharLS/colortransform.h" ++#include "CharLS/streams.h" ++#include "CharLS/processline.h" ++#else + #include "gdcmcharls/stdafx.h" // sigh... + #include "gdcmcharls/interface.h" + #include "gdcmcharls/util.h" +@@ -26,7 +36,7 @@ + #include "gdcmcharls/colortransform.h" + #include "gdcmcharls/streams.h" + #include "gdcmcharls/processline.h" +- ++#endif + + namespace gdcm + { +diff --git a/Utilities/CMakeLists.txt b/Utilities/CMakeLists.txt +index 8ade58c..8b417aa 100644 +--- a/Utilities/CMakeLists.txt ++++ b/Utilities/CMakeLists.txt +@@ -33,14 +33,17 @@ IF(NOT GDCM_USE_SYSTEM_OPENJPEG) + ENDIF(NOT GDCM_USE_SYSTEM_OPENJPEG) + + # Do jpegls (JPEG-LS aka near lossless implementation) ++ + APPEND_COPYRIGHT(${CMAKE_CURRENT_SOURCE_DIR}/gdcmcharls/License.txt) + IF(GDCM_USE_JPEGLS) +- SET(CHARLS_NAMESPACE "GDCMCHARLS") +- SET(CHARLS_INSTALL_NO_LIBRARIES ${GDCM_INSTALL_NO_LIBRARIES}) +- SET(CHARLS_INSTALL_BIN_DIR ${GDCM_INSTALL_BIN_DIR}) +- SET(CHARLS_INSTALL_LIB_DIR ${GDCM_INSTALL_LIB_DIR}) +- SET(CHARLS_INSTALL_INCLUDE_DIR ${GDCM_INSTALL_INCLUDE_DIR}/gdcmcharls) +- SUBDIRS(gdcmcharls) ++ IF(NOT GDCM_USE_SYSTEM_JPEGLS) ++ SET(CHARLS_NAMESPACE "GDCMCHARLS") ++ SET(CHARLS_INSTALL_NO_LIBRARIES ${GDCM_INSTALL_NO_LIBRARIES}) ++ SET(CHARLS_INSTALL_BIN_DIR ${GDCM_INSTALL_BIN_DIR}) ++ SET(CHARLS_INSTALL_LIB_DIR ${GDCM_INSTALL_LIB_DIR}) ++ SET(CHARLS_INSTALL_INCLUDE_DIR ${GDCM_INSTALL_INCLUDE_DIR}) ++ SUBDIRS(gdcmcharls) ++ ENDIF(NOT GDCM_USE_SYSTEM_JPEGLS) + ENDIF(GDCM_USE_JPEGLS) + + # Do md5 diff --git a/gdcm.spec b/gdcm.spec index f0add6e..b2562be 100644 --- a/gdcm.spec +++ b/gdcm.spec @@ -10,13 +10,13 @@ %endif Name: gdcm -Version: 2.0.16 -Release: 17%{?dist} +Version: 2.0.17 +Release: 1%{?dist} Summary: Grassroots DiCoM is a C++ library to parse DICOM medical files Group: Development/Libraries License: BSD URL: http://sourceforge.net/apps/mediawiki/gdcm/index.php?title=Main_Page -Source0: http://download.sourceforge.net/project/gdcm/gdcm%202.x/GDCM%202.0.16/gdcm-2.0.16.tar.bz2 +Source0: http://sourceforge.net/projects/gdcm/files/gdcm%202.x/GDCM%202.0.17/gdcm-2.0.17.tar.bz2 #Source1: http://downloads.sourceforge.net/project/gdcm/gdcmData/gdcmData/gdcmData.tar.bz2 Source2: FindCharLS.cmake Buildroot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) @@ -25,13 +25,14 @@ ExcludeArch: ppc ppc64 Patch1: gdcm-2.0.14-inplacebuild.patch Patch2: gdcm-2.0.14-usecopyright.patch -Patch3: gdcm-2.0.14-use_system_charls.patch -Patch4: gdcm-2.0.16-fix_dso_link.patch -Patch5: gdcm-2.0.16-remove_versioned_install_dir.patch -Patch6: gdcm-2.0.16-fix_ptrdiff.patch -Patch7: gdcm-2.0.16-remove-stdafx.patch -Patch8: gdcm-2.0.16-fix-decode.patch -Patch9: gdcm-2.0.16-JlsParameters.patch +Patch3: gdcm-2.0.16-fix_ptrdiff.patch +Patch4: gdcm-2.0.16-fix-decode.patch +Patch5: gdcm-2.0.16-JlsParameters.patch +Patch6: gdcm-2.0.17-install2libarch.patch +Patch7: gdcm-2.0.17-use_openjpeg_1x.patch +Patch8: gdcm-2.0.17-use_system_charls +Patch9: gdcm-2.0.16-remove-stdafx.patch +Patch10: gdcm-2.0.17-no_versioned_dir.patch BuildRequires: cmake >= 2.6.0 BuildRequires: openssl-devel @@ -90,13 +91,14 @@ used this library with python %setup -q %patch1 %patch2 -%patch3 -%patch4 -p1 -%patch5 -%patch6 -p2 -%patch7 -p1 -%patch8 -p1 -%patch9 -p1 +%patch3 -p 2 +%patch4 -p 1 +%patch5 -p 1 +%patch6 -p 1 +%patch7 -p 1 +%patch8 -p 1 +%patch9 -p 1 +%patch10 -p 1 # Remove bundled utilities (we use Fedora's ones) @@ -157,7 +159,7 @@ mv $RPM_BUILD_ROOT%{_libdir}/vtkgdcm.py $RPM_BUILD_ROOT%{python_sitelib}/ ## Rearranging directory layout and removing version from dir mv $RPM_BUILD_ROOT%{_libdir}/gdcm/*.cmake $RPM_BUILD_ROOT%{_datadir}/gdcm/ -rmdir $RPM_BUILD_ROOT%{_libdir}/gdcm/ +rmdir $RPM_BUILD_ROOT%{_libdir}/gdcm ## Cleaning Example dir from cmake cache files + remove 0-lenght files find %{_builddir}/%{?buildsubdir}/Examples -depth -name CMakeFiles | xargs rm -rf @@ -196,6 +198,9 @@ ctest . %{python_sitelib}/* %changelog +* Sat Mar 19 2011 Mario Ceresa mrceresa gmailcom - 2.0.17-1 +- Updated to version 2.0.17 + * Thu Mar 17 2011 Marek Kasik - 2.0.16-17 - Fix BuildRequires @@ -205,9 +210,6 @@ ctest . * Sun Feb 20 2011 Orion Poplawski - 2.0.16-15 - Rebuild for new vtk with fixed sonames -* Mon Feb 14 2011 Mario Ceresa - 2.0.16-14 -- Re-enabled python bindings - * Mon Feb 14 2011 Mario Ceresa - 2.0.16-13 - Adapted to new version of CharLS lib (v 1.0)